summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-07-03 18:24:06 +0000
committerPhilip Reames <listmail@philipreames.com>2019-07-03 18:24:06 +0000
commit4c80281c96291abcd7bb734dab114f8eeecd38bb (patch)
treebed2229e366022ddee27518dd895407e9b63f118 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parent83cca94194b14aae5e0fd8d3feca9292a631578e (diff)
downloadbcm5719-llvm-4c80281c96291abcd7bb734dab114f8eeecd38bb.tar.gz
bcm5719-llvm-4c80281c96291abcd7bb734dab114f8eeecd38bb.zip
[LFTR] Remove falsely generalized (dead) code [NFC]
llvm-svn: 365067
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 4f939b21a2e..0566a1558b0 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2477,11 +2477,8 @@ linearFunctionTestReplace(Loop *L, BasicBlock *ExitingBB,
Count = Count.zext(CmpIndVarSize);
if (UsePostInc)
++Count;
- APInt NewLimit;
- if (cast<SCEVConstant>(ARStep)->getValue()->isNegative())
- NewLimit = Start - Count;
- else
- NewLimit = Start + Count;
+ assert(cast<SCEVConstant>(ARStep)->getValue()->isOne());
+ APInt NewLimit = Start + Count;
ExitCnt = ConstantInt::get(CmpIndVar->getType(), NewLimit);
} else {
// We try to extend trip count first. If that doesn't work we truncate IV.
OpenPOWER on IntegriCloud