[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp

Chris Lattner sabre at nondot.org
Fri Jan 12 16:03:04 PST 2007



Changes in directory llvm/lib/Transforms/Scalar:

LoopUnswitch.cpp updated: 1.56 -> 1.57
---
Log message:

fix a bug in a recent patch


---
Diffs of the changes:  (+1 -1)

 LoopUnswitch.cpp |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.56 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.57
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.56	Thu Jan 11 22:24:46 2007
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp	Fri Jan 12 18:02:49 2007
@@ -486,7 +486,7 @@
   // Insert a conditional branch on LIC to the two preheaders.  The original
   // code is the true version and the new code is the false version.
   Value *BranchVal = LIC;
-  if (Val->getType() != Type::Int1Ty)
+  if (Val->getType() != Type::Int1Ty || !isa<ConstantInt>(Val))
     BranchVal = new ICmpInst(ICmpInst::ICMP_EQ, LIC, Val, "tmp", InsertPt);
   else if (Val != ConstantInt::getTrue())
     // We want to enter the new loop when the condition is true.






More information about the llvm-commits mailing list