From 5c3c21e10a84c73671bda1ca497fe3208d5fab5c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 22 Oct 2004 04:53:16 +0000 Subject: Fix a bug Nate noticed, where we miscompiled a simple testcase llvm-svn: 17157 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 3119e570440..61acad04f32 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1285,7 +1285,7 @@ Instruction *InstCombiner::OptAndOp(Instruction *Op, Constant *AllOne = ConstantIntegral::getAllOnesValue(AndRHS->getType()); Constant *ShrMask = ConstantExpr::getUShr(AllOne, OpRHS); Constant *CI = ConstantExpr::getAnd(AndRHS, ShrMask); - if (CI == ShrMask) { // Masking out bits shifted in. + if (CI == AndRHS) { // Masking out bits shifted in. // Make the argument unsigned. Value *ShVal = Op->getOperand(0); ShVal = InsertCastBefore(ShVal, -- cgit v1.2.3