summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2014-09-30 03:17:42 +0000
committerChad Rosier <mcrosier@codeaurora.org>2014-09-30 03:17:42 +0000
commitaab5d7bd33ef6047c0037c5e0f01029c35924bf1 (patch)
tree44d6ae0df93c7ad01c79e2e0bafcc770e173dead /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parentaaf8e03d92f9f65e3b5bd6fd9f3be59fb87f8fdd (diff)
downloadbcm5719-llvm-aab5d7bd33ef6047c0037c5e0f01029c35924bf1.tar.gz
bcm5719-llvm-aab5d7bd33ef6047c0037c5e0f01029c35924bf1.zip
[IndVarSimplify] Widen loop unsigned compares.
This patch extends r217953 to handle unsigned comparison. Phabricator revision: http://reviews.llvm.org/D5526 llvm-svn: 218659
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 68a134ebfd8..2959c7bd3c7 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -936,12 +936,8 @@ bool WidenIV::WidenLoopCompare(NarrowIVDefUse DU) {
if (!Cmp)
return false;
- // Must be a signed compare.
- if (!CmpInst::isSigned(Cmp->getPredicate()))
- return false;
-
- // Must be a signed IV user.
- if (!IsSigned)
+ // Sign of IV user and compare must match.
+ if (IsSigned != CmpInst::isSigned(Cmp->getPredicate()))
return false;
Value *Op = Cmp->getOperand(Cmp->getOperand(0) == DU.NarrowDef ? 1 : 0);
OpenPOWER on IntegriCloud