From 307b50b0f66941a5bbdb7761db57d3572124f783 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Wed, 17 Sep 2014 16:35:09 +0000 Subject: [IndVarSimplify] Partially revert r217953 to see if this fixes the bots. Specifically, disable widening of unsigned compare instructions. llvm-svn: 217962 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp') diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 532666ea7c1..7cc34e1ad86 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -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); } -- cgit v1.2.3