[llvm-commits] [llvm] r50202 - /llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Chris Lattner sabre at nondot.org
Wed Apr 23 17:19:54 PDT 2008


Author: lattner
Date: Wed Apr 23 19:19:54 2008
New Revision: 50202

URL: http://llvm.org/viewvc/llvm-project?rev=50202&view=rev
Log:
Don't replace multiple result of calls with undef, 
sccp tracks getresult values, not call values in this
case.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=50202&r1=50201&r2=50202&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Wed Apr 23 19:19:54 2008
@@ -1516,7 +1516,8 @@
       //
       for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
         Instruction *Inst = BI++;
-        if (Inst->getType() == Type::VoidTy || 
+        if (Inst->getType() == Type::VoidTy ||
+            isa<StructType>(Inst->getType()) ||
             isa<TerminatorInst>(Inst))
           continue;
         
@@ -1692,7 +1693,8 @@
       } else {
         for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) {
           Instruction *Inst = BI++;
-          if (Inst->getType() != Type::VoidTy) {
+          if (Inst->getType() != Type::VoidTy &&
+              !isa<StructType>(Inst->getType())) {
             LatticeVal &IV = Values[Inst];
             if (IV.isConstant() ||
                 (IV.isUndefined() && !isa<TerminatorInst>(Inst))) {





More information about the llvm-commits mailing list