Checking the wrong value. This caused us to emit silly code like
authorChris Lattner <sabre@nondot.org>
Wed, 15 Feb 2006 19:05:52 +0000 (19:05 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Feb 2006 19:05:52 +0000 (19:05 +0000)
Y = seteq bool X, true
instead of just using X :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopUnswitch.cpp

index 3686e49dcddbbec957c212e99ee887b66ce7d525..a4da2501f9f0bb529ed25b29dac52b5c37ad7a14 100644 (file)
@@ -442,7 +442,7 @@ static void EmitPreheaderBranchOnCondition(Value *LIC, Constant *Val,
   // 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 (!isa<ConstantBool>(BranchVal)) {
+  if (!isa<ConstantBool>(Val)) {
     BranchVal = BinaryOperator::createSetEQ(LIC, Val, "tmp", InsertPt);
   } else if (Val != ConstantBool::True) {
     // We want to enter the new loop when the condition is true.