Temporarily disable on-demand fast-isel.
authorDan Gohman <gohman@apple.com>
Thu, 1 Jul 2010 12:15:30 +0000 (12:15 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 1 Jul 2010 12:15:30 +0000 (12:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107393 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/CodeGen/X86/fast-isel-loads.ll

index bf3137e49536ea3b190e748bbcab256afced6218..d437370031deb0ee2582f0d776e4e16819d3c38f 100644 (file)
@@ -329,15 +329,19 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
   if (OptLevel != CodeGenOpt::None)
     PM.add(createOptimizePHIsPass());
 
-  if (OptLevel != CodeGenOpt::None) {
-    // With optimization, dead code should already be eliminated. However
-    // there is one known exception: lowered code for arguments that are only
-    // used by tail calls, where the tail calls reuse the incoming stack
-    // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
-    PM.add(createDeadMachineInstructionElimPass());
-    printAndVerify(PM, "After codegen DCE pass",
-                   /* allowDoubleDefs= */ true);
+  // Delete dead machine instructions regardless of optimization level.
+  //
+  // At -O0, fast-isel frequently creates dead instructions.
+  //
+  // With optimization, dead code should already be eliminated. However
+  // there is one known exception: lowered code for arguments that are only
+  // used by tail calls, where the tail calls reuse the incoming stack
+  // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
+  PM.add(createDeadMachineInstructionElimPass());
+  printAndVerify(PM, "After codegen DCE pass",
+                 /* allowDoubleDefs= */ true);
 
+  if (OptLevel != CodeGenOpt::None) {
     PM.add(createOptimizeExtsPass());
     if (!DisableMachineLICM)
       PM.add(createMachineLICMPass());
index 073e2964d2082b678f0a95289146c8456a964c7c..94f0efcb70adf89a169a182f8c1bffad217e6882 100644 (file)
@@ -709,11 +709,13 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
       FastIS->startNewBlock(BB);
       // Do FastISel on as many instructions as possible.
       for (; BI != End; ++BI) {
+#if 0
         // Defer instructions with no side effects; they'll be emitted
         // on-demand later.
         if (BI->isSafeToSpeculativelyExecute() &&
             !FuncInfo->isExportedInst(BI))
           continue;
+#endif
 
         // Try to select the instruction with FastISel.
         if (FastIS->SelectInstruction(BI))
index 2fbb46c0b9f50773cb11cd15773e5b3833947df9..027363e4688f7d18ee523601cf3ce439e56ce7ab 100644 (file)
@@ -5,7 +5,7 @@
 ; CHECK: foo:
 ; CHECK-NEXT: movq  %rdi, -8(%rsp)
 ; CHECK-NEXT: movq  %rsi, -16(%rsp)
-; CHECK-NEXT: movsd 128(%rsi,%rdi,8), %xmm0
+; CHECK: movsd 128(%rsi,%rdi,8), %xmm0
 ; CHECK-NEXT: ret
 
 define double @foo(i64 %x, double* %p) nounwind {