summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorEhsan Amiri <amehsan@ca.ibm.com>2016-08-11 14:51:14 +0000
committerEhsan Amiri <amehsan@ca.ibm.com>2016-08-11 14:51:14 +0000
commit3818f1b38ae7b29dfeed0f11cff1a6b30fcc4f0e (patch)
tree4e77b0393a4d8b07ef29d398592375c7c18dd2d6 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parent82c73bee2b7e11dc9105d47ef61957fbea383f80 (diff)
downloadbcm5719-llvm-3818f1b38ae7b29dfeed0f11cff1a6b30fcc4f0e.tar.gz
bcm5719-llvm-3818f1b38ae7b29dfeed0f11cff1a6b30fcc4f0e.zip
revert 278334
llvm-svn: 278337
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index ddd5cdc6bcc..056886f80e6 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1989,34 +1989,7 @@ linearFunctionTestReplace(Loop *L,
DEBUG(dbgs() << " Widen RHS:\t" << *ExitCnt << "\n");
} else {
- // We try to extend trip count first. If that doesn't work we truncate IV.
- // Zext(trunc(IV)) == IV implies equivalence of the following two:
- // Trunc(IV) == ExitCnt and IV == zext(ExitCnt). Similarly for sext. If
- // one of the two holds, extend the trip count, otherwise truncate IV.
- bool Extended = false;
- const SCEV *IV = SE->getSCEV(CmpIndVar);
- const SCEV *ZExtTrunc =
- SE->getZeroExtendExpr(SE->getTruncateExpr(SE->getSCEV(CmpIndVar),
- ExitCnt->getType()),
- CmpIndVar->getType());
-
- if (ZExtTrunc == IV) {
- Extended = true;
- ExitCnt = Builder.CreateZExt(ExitCnt, IndVar->getType(),
- "wide.trip.count");
- } else {
- const SCEV *SExtTrunc =
- SE->getSignExtendExpr(SE->getTruncateExpr(SE->getSCEV(CmpIndVar),
- ExitCnt->getType()),
- CmpIndVar->getType());
- if (SExtTrunc == IV) {
- Extended = true;
- ExitCnt = Builder.CreateSExt(ExitCnt, IndVar->getType(),
- "wide.trip.count");
- }
- }
- if (!Extended)
CmpIndVar = Builder.CreateTrunc(CmpIndVar, ExitCnt->getType(),
"lftr.wideiv");
}
OpenPOWER on IntegriCloud