Fix a bug in foldSelectICmpAndOr.

Differences in bitwidth between X and Y could exist even if C1 and C2 have
the same Log2 representation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2013-04-30 10:36:33 +00:00
parent 62d77858be
commit 527db3f26b

View File

@ -401,7 +401,8 @@ static Value *foldSelectICmpAndOr(const SelectInst &SI, Value *TrueVal,
} else if (C1Log > C2Log) {
V = Builder->CreateLShr(V, C1Log - C2Log);
V = Builder->CreateZExtOrTrunc(V, Y->getType());
}
} else
V = Builder->CreateZExtOrTrunc(V, Y->getType());
ICmpInst::Predicate Pred = IC->getPredicate();
if ((Pred == ICmpInst::ICMP_NE && OrOnFalseVal) ||