[IndVarSimplify] Partially revert r217953 to see if this fixes the bots.

Specifically, disable widening of unsigned compare instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217962 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier
2014-09-17 16:35:09 +00:00
parent 0a277ea23d
commit c6b1a7e577
2 changed files with 4 additions and 29 deletions

View File

@ -936,6 +936,10 @@ bool WidenIV::WidenLoopCompare(NarrowIVDefUse DU) {
if (!Cmp)
return false;
bool IsSigned = CmpInst::isSigned(Cmp->getPredicate());
if (!IsSigned)
return false;
Value *Op = Cmp->getOperand(Cmp->getOperand(0) == DU.NarrowDef ? 1 : 0);
unsigned CastWidth = SE->getTypeSizeInBits(Op->getType());
unsigned IVWidth = SE->getTypeSizeInBits(WideType);
@ -947,7 +951,6 @@ bool WidenIV::WidenLoopCompare(NarrowIVDefUse DU) {
// Widen the other operand of the compare, if necessary.
if (CastWidth < IVWidth) {
bool IsSigned = CmpInst::isSigned(Cmp->getPredicate());
Value *ExtOp = getExtend(Op, WideType, IsSigned, Cmp);
DU.NarrowUse->replaceUsesOfWith(Op, ExtOp);
}