From 3fdde110eb55116242f9c7dd9e687cbd102beb7c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 15 Feb 2006 19:05:52 +0000 Subject: [PATCH] Checking the wrong value. This caused us to emit silly code like 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 3686e49dcdd..a4da2501f9f 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -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(BranchVal)) { + if (!isa(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.