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

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 17 14:43:01 PDT 2003


Changes in directory llvm/lib/Transforms/Utils:

Local.cpp updated: 1.7 -> 1.8
SimplifyCFG.cpp updated: 1.12 -> 1.13

---
Log message:

Fix bug: SimplifyCFG/2003-08-17-BranchFoldOrdering.ll



---
Diffs of the changes:

Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.7 llvm/lib/Transforms/Utils/Local.cpp:1.8
--- llvm/lib/Transforms/Utils/Local.cpp:1.7	Sun Aug 17 14:34:55 2003
+++ llvm/lib/Transforms/Utils/Local.cpp	Sun Aug 17 14:41:53 2003
@@ -74,6 +74,12 @@
       BI->setUnconditionalDest(Dest1);
       return true;
     }
+  } else if (SwitchInst *SI = dyn_cast<SwitchInst>(TI)) {
+    if (ConstantInt *CI = dyn_cast<ConstantInt>(SI->getCondition())) {
+
+
+    }
+
   }
   return false;
 }


Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.12 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.13
--- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.12	Tue Aug  5 11:27:44 2003
+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp	Sun Aug 17 14:41:53 2003
@@ -121,6 +121,10 @@
     return true;
   }
 
+  // Check to see if we can constant propagate this terminator instruction
+  // away...
+  bool Changed = ConstantFoldTerminator(BB);
+
   // Check to see if this block has no non-phi instructions and only a single
   // successor.  If so, replace references to this basic block with references
   // to the successor.
@@ -251,5 +255,5 @@
     }
   }
   
-  return false;
+  return Changed;
 }





More information about the llvm-commits mailing list