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? :)

llvm-svn: 17276
This commit is contained in:
Chris Lattner 2004-10-27 05:57:15 +00:00
parent c193790dbb
commit 70c2039b39
1 changed files with 4 additions and 0 deletions

View File

@ -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());
}
}