<div dir="ltr">Hi Eric,<div><br></div><div>Sure. Sorry, I didn't know there was a preferred way of doing this. The reason I did it like I did was simply that was how it was disabled before Moritz reenabled it!</div><div>
<br></div><div>I'll bear in mind for the future.</div><div>Cheers,</div><div><br></div><div>James</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 15 June 2014 02:48, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><p dir="ltr"><br>
On Jun 14, 2014 6:39 PM, "David Blaikie" <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
><br>
> I know already, but it might be useful to explain why (especially<br>
> given that there are other examples of similar code there already).<br>
></p>
</div><p dir="ltr">Good idea. :)</p><div class="">
<p dir="ltr">> My half-baked attempt: James: the subtarget may vary from function to<br>
> function (in Eric's glorious ifunc future) and he'd like to have just<br>
> one pass pipeline that can be used for all functions, even across<br>
> subtarget variations. While the world isn't there yet, it'd be nice to<br>
> avoid making more work.<br>
><br>
> Eric - are there passes that already do this? Precedent to point to<br>
> for an example of the way you think will work? Or is it all backwards<br>
> for now?</p>
</div><p dir="ltr">X86, PPC, aarch64, and I thought arm all did it this way. I fixed them a while back. </p><span class="HOEnZb"><font color="#888888">
<p dir="ltr">-eric</p></font></span><div class="HOEnZb"><div class="h5">
<p dir="ltr">><br>
> - David<br>
><br>
> On Sat, Jun 14, 2014 at 6:27 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br>
> > Please don't do this in this way, just have the pass return that it did no<br>
> > work rather than conditionally including it in the pipeline.<br>
> ><br>
> > Thanks. :)<br>
> ><br>
> > -eric<br>
> ><br>
> > On Jun 12, 2014 8:29 AM, "James Molloy" <<a href="mailto:james.molloy@arm.com" target="_blank">james.molloy@arm.com</a>> wrote:<br>
> >><br>
> >> Author: jamesm<br>
> >> Date: Thu Jun 12 10:18:33 2014<br>
> >> New Revision: 210789<br>
> >><br>
> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=210789&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=210789&view=rev</a><br>
> >> Log:<br>
> >> Disable the load/store optimization pass for Thumb-1.<br>
> >><br>
> >> Moritz's changes have improved codegen a lot, but further testing showed<br>
> >> significant correctness problems. Disable by default until these have been<br>
> >> worked out.<br>
> >><br>
> >> Patch by Moritz Roth!<br>
> >><br>
> >> Modified:<br>
> >> llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp<br>
> >> llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll<br>
> >> llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll<br>
> >> llvm/trunk/test/CodeGen/Thumb/thumb-ldm.ll<br>
> >> llvm/trunk/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll<br>
> >><br>
> >> Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp<br>
> >> URL:<br>
> >> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=210789&r1=210788&r2=210789&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=210789&r1=210788&r2=210789&view=diff</a><br>
> >><br>
> >> ==============================================================================<br>
> >> --- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)<br>
> >> +++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Thu Jun 12 10:18:33<br>
> >> 2014<br>
> >> @@ -265,7 +265,8 @@ bool ARMPassConfig::addInstSelector() {<br>
> >> }<br>
> >><br>
> >> bool ARMPassConfig::addPreRegAlloc() {<br>
> >> - if (getOptLevel() != CodeGenOpt::None)<br>
> >> + // FIXME: Temporarily disabling Thumb-1 pre-RA Load/Store optimization<br>
> >> pass<br>
> >> + if (getOptLevel() != CodeGenOpt::None &&<br>
> >> !getARMSubtarget().isThumb1Only())<br>
> >> addPass(createARMLoadStoreOptimizationPass(true));<br>
> >> if (getOptLevel() != CodeGenOpt::None &&<br>
> >> getARMSubtarget().isCortexA9())<br>
> >> addPass(createMLxExpansionPass());<br>
> >> @@ -280,8 +281,11 @@ bool ARMPassConfig::addPreRegAlloc() {<br>
> >><br>
> >> bool ARMPassConfig::addPreSched2() {<br>
> >> if (getOptLevel() != CodeGenOpt::None) {<br>
> >> - addPass(createARMLoadStoreOptimizationPass());<br>
> >> - printAndVerify("After ARM load / store optimizer");<br>
> >> + // FIXME: Temporarily disabling Thumb-1 post-RA Load/Store<br>
> >> optimization pass<br>
> >> + if (!getARMSubtarget().isThumb1Only()) {<br>
> >> + addPass(createARMLoadStoreOptimizationPass());<br>
> >> + printAndVerify("After ARM load / store optimizer");<br>
> >> + }<br>
> >><br>
> >> if (getARMSubtarget().hasNEON())<br>
> >> addPass(createExecutionDependencyFixPass(&ARM::DPRRegClass));<br>
> >><br>
> >> Modified: llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll<br>
> >> URL:<br>
> >> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll?rev=210789&r1=210788&r2=210789&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll?rev=210789&r1=210788&r2=210789&view=diff</a><br>
> >><br>
> >> ==============================================================================<br>
> >> --- llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll<br>
> >> (original)<br>
> >> +++ llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll Thu<br>
> >> Jun 12 10:18:33 2014<br>
> >> @@ -1,4 +1,5 @@<br>
> >> ; RUN: llc < %s -mtriple=thumbv6m-eabi -o - | FileCheck %s<br>
> >> +; XFAIL: *<br>
> >><br>
> >> define void @foo(i32* %A) #0 {<br>
> >> entry:<br>
> >><br>
> >> Modified: llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll<br>
> >> URL:<br>
> >> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll?rev=210789&r1=210788&r2=210789&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll?rev=210789&r1=210788&r2=210789&view=diff</a><br>
> >><br>
> >> ==============================================================================<br>
> >> --- llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll (original)<br>
> >> +++ llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll Thu Jun 12 10:18:33<br>
> >> 2014<br>
> >> @@ -1,5 +1,5 @@<br>
> >> -; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts<br>
> >> -disable-post-ra | FileCheck %s -check-prefix=CHECK -check-prefix=RA_GREEDY<br>
> >> -; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts<br>
> >> -disable-post-ra -regalloc=basic | FileCheck %s -check-prefix=CHECK<br>
> >> -check-prefix=RA_BASIC<br>
> >> +; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts<br>
> >> -disable-post-ra | FileCheck %s<br>
> >> +; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts<br>
> >> -disable-post-ra -regalloc=basic | FileCheck %s<br>
> >><br>
> >> %struct.state = type { i32, %<a href="http://struct.info" target="_blank">struct.info</a>*, float**, i32, i32, i32,<br>
> >> i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* }<br>
> >> %<a href="http://struct.info" target="_blank">struct.info</a> = type { i32, i32, i32, i32, i32, i32, i32, i8* }<br>
> >> @@ -45,8 +45,7 @@ define void @t2(%struct.comment* %vc, i8<br>
> >> ; CHECK: sub sp, #<br>
> >> ; CHECK: mov r[[R0:[0-9]+]], sp<br>
> >> ; CHECK: str r{{[0-9+]}}, [r[[R0]]<br>
> >> -; RA_GREEDY: str r{{[0-9+]}}, [r[[R0]]<br>
> >> -; RA_BASIC: stm r[[R0]]!<br>
> >> +; CHECK: str r{{[0-9+]}}, [r[[R0]]<br>
> >> ; CHECK-NOT: ldr r0, [sp<br>
> >> ; CHECK: mov r[[R1:[0-9]+]], sp<br>
> >> ; CHECK: subs r[[R2:[0-9]+]], r[[R1]], r{{[0-9]+}}<br>
> >><br>
> >> Modified: llvm/trunk/test/CodeGen/Thumb/thumb-ldm.ll<br>
> >> URL:<br>
> >> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/thumb-ldm.ll?rev=210789&r1=210788&r2=210789&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/thumb-ldm.ll?rev=210789&r1=210788&r2=210789&view=diff</a><br>
> >><br>
> >> ==============================================================================<br>
> >> --- llvm/trunk/test/CodeGen/Thumb/thumb-ldm.ll (original)<br>
> >> +++ llvm/trunk/test/CodeGen/Thumb/thumb-ldm.ll Thu Jun 12 10:18:33 2014<br>
> >> @@ -1,4 +1,5 @@<br>
> >> ; RUN: llc < %s -mtriple=thumbv6m-eabi -o - | FileCheck %s<br>
> >> +; XFAIL: *<br>
> >><br>
> >> @X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]<br>
> >><br>
> >><br>
> >> Modified: llvm/trunk/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll<br>
> >> URL:<br>
> >> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll?rev=210789&r1=210788&r2=210789&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll?rev=210789&r1=210788&r2=210789&view=diff</a><br>
> >><br>
> >> ==============================================================================<br>
> >> --- llvm/trunk/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll (original)<br>
> >> +++ llvm/trunk/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll Thu Jun 12<br>
> >> 10:18:33 2014<br>
> >> @@ -1,4 +1,5 @@<br>
> >> ; RUN: llc -mtriple=thumbv6m-eabi %s -o - | FileCheck %s<br>
> >> +; XFAIL: *<br>
> >><br>
> >> @d = external global [64 x i32]<br>
> >> @s = external global [64 x i32]<br>
> >><br>
> >><br>
> >> _______________________________________________<br>
> >> llvm-commits mailing list<br>
> >> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> ><br>
</p>
</div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>