aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-27 05:57:15 +0000
committerChris Lattner <sabre@nondot.org>2004-10-27 05:57:15 +0000
commitdc781222425c688e2c75a871f6abecaa30392b88 (patch)
tree5461efebf8f87777fbaf9c6b8eea45cbb1a5eb4c
parent4c3480169ba413a86463a3ca8791f23816a8acc2 (diff)
Hrm, this code was severely botched. As it turns out, this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041018/019708.html exposed ANOTHER latent bug in this xform, which caused Prolangs-C/bison to fill the zion nightly tester disk up and make the tester barf. This is obviously not a good thing, so lets fix this bug shall we? :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17276 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 61acad04f3..f8f0573395 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -1294,6 +1294,10 @@ Instruction *InstCombiner::OptAndOp(Instruction *Op,
ShVal = InsertNewInstBefore(new ShiftInst(Instruction::Shr, ShVal,
OpRHS, Op->getName()),
TheAnd);
+ Value *AndRHS2 = ConstantExpr::getCast(AndRHS, ShVal->getType());
+ ShVal = InsertNewInstBefore(BinaryOperator::createAnd(ShVal, AndRHS2,
+ TheAnd.getName()),
+ TheAnd);
return new CastInst(ShVal, Op->getType());
}
}