[llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 17 23:57:01 PST 2004


Changes in directory llvm/lib/Transforms/Utils:

CodeExtractor.cpp updated: 1.15 -> 1.16

---
Log message:

Fix bug: CodeExtractor/2004-03-17-MissedLiveIns.ll
With this fix we now successfully extract all 149 loops from 256.bzip2 without
crashing or miscompiling the program!


---
Diffs of the changes:  (+5 -0)

Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp
diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.15 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.16
--- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.15	Wed Mar 17 23:38:31 2004
+++ llvm/lib/Transforms/Utils/CodeExtractor.cpp	Wed Mar 17 23:56:32 2004
@@ -75,6 +75,11 @@
           if (!BlocksToExtract.count(PN->getIncomingBlock(i)) &&
               (isa<Instruction>(V) || isa<Argument>(V)))
             inputs.push_back(V);
+          else if (Instruction *opI = dyn_cast<Instruction>(V)) {
+            if (!BlocksToExtract.count(opI->getParent()))
+              inputs.push_back(opI);
+          } else if (isa<Argument>(V))
+            inputs.push_back(V);
         }
       } else {
         // All other instructions go through the generic input finder





More information about the llvm-commits mailing list