<p dir="ltr">Please don't do this in this way, just have the pass return that it did no work rather than conditionally including it in the pipeline. </p>
<p dir="ltr">Thanks. :)</p>
<p dir="ltr">-eric</p>
<div class="gmail_quote">On Jun 12, 2014 8:29 AM, "James Molloy" <<a href="mailto:james.molloy@arm.com">james.molloy@arm.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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 significant correctness problems. Disable by default until these have been 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: <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>
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Thu Jun 12 10:18:33 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 pass<br>
+  if (getOptLevel() != CodeGenOpt::None && !getARMSubtarget().isThumb1Only())<br>
     addPass(createARMLoadStoreOptimizationPass(true));<br>
   if (getOptLevel() != CodeGenOpt::None && 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 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: <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>
--- llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll (original)<br>
+++ llvm/trunk/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.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>
 define void @foo(i32* %A) #0 {<br>
 entry:<br>
<br>
Modified: llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll<br>
URL: <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>
--- llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll (original)<br>
+++ llvm/trunk/test/CodeGen/Thumb/dyn-stackalloc.ll Thu Jun 12 10:18:33 2014<br>
@@ -1,5 +1,5 @@<br>
-; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra | FileCheck %s -check-prefix=CHECK -check-prefix=RA_GREEDY<br>
-; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra -regalloc=basic | FileCheck %s -check-prefix=CHECK -check-prefix=RA_BASIC<br>
+; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra | FileCheck %s<br>
+; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -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, 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: <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>
--- 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: <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>
--- 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 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">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>
</blockquote></div>