From 9b9918246caedae5b236cc1eabfb0634bc540437 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 22 Oct 2004 04:53:16 +0000 Subject: [PATCH] Fix a bug Nate noticed, where we miscompiled a simple testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17157 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 3119e570440..61acad04f32 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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,