add is always integer, thanks to Frits for noticing this.

llvm-svn: 125774
This commit is contained in:
Chris Lattner 2011-02-17 20:55:29 +00:00
parent 2a666fc2c7
commit d406764d52
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
return BinaryOperator::CreateXor(LHS, RHS);
// X + X --> X << 1
if (LHS == RHS && I.getType()->isIntegerTy()) {
if (LHS == RHS) {
BinaryOperator *New =
BinaryOperator::CreateShl(LHS, ConstantInt::get(I.getType(), 1));
New->setHasNoSignedWrap(I.hasNoSignedWrap());