Revert the accidental commit I made reverting the previous commit.
authorEric Christopher <echristo@apple.com>
Thu, 11 Nov 2010 20:50:14 +0000 (20:50 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 11 Nov 2010 20:50:14 +0000 (20:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118835 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMTargetMachine.cpp

index d15963986c7772786383818c15e91eb331ca44e3..81279d257c013a6adc4195434214170fe8b203c8 100644 (file)
@@ -148,7 +148,7 @@ bool ARMBaseTargetMachine::addInstSelector(PassManagerBase &PM,
 bool ARMBaseTargetMachine::addPreRegAlloc(PassManagerBase &PM,
                                           CodeGenOpt::Level OptLevel) {
   // FIXME: temporarily disabling load / store optimization pass for Thumb1.
-  if (!Subtarget.isThumb1Only())
+  if (OptLevel != CodeGenOpt::None && !Subtarget.isThumb1Only())
     PM.add(createARMLoadStoreOptimizationPass(true));
 
   return true;
@@ -157,11 +157,12 @@ bool ARMBaseTargetMachine::addPreRegAlloc(PassManagerBase &PM,
 bool ARMBaseTargetMachine::addPreSched2(PassManagerBase &PM,
                                         CodeGenOpt::Level OptLevel) {
   // FIXME: temporarily disabling load / store optimization pass for Thumb1.
-  if (!Subtarget.isThumb1Only())
-    PM.add(createARMLoadStoreOptimizationPass());
-  
-  if (OptLevel != CodeGenOpt::None && Subtarget.hasNEON())
-    PM.add(createNEONMoveFixPass());
+  if (OptLevel != CodeGenOpt::None) {
+    if (!Subtarget.isThumb1Only())
+      PM.add(createARMLoadStoreOptimizationPass());
+    if (Subtarget.hasNEON())
+      PM.add(createNEONMoveFixPass());
+  }
 
   // Expand some pseudo instructions into multiple instructions to allow
   // proper scheduling.