summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSterling Augustine <saugustine@google.com>2019-07-12 18:51:08 +0000
committerSterling Augustine <saugustine@google.com>2019-07-12 18:51:08 +0000
commit6d75a9e873651db3e9cb0223ccb24e06520f9209 (patch)
treee50879e7ca91d769379862795865638323aae1ad
parent38ec89a670a2b814988fbf863f415fcc46c29d1c (diff)
downloadbcm5719-llvm-6d75a9e873651db3e9cb0223ccb24e06520f9209.tar.gz
bcm5719-llvm-6d75a9e873651db3e9cb0223ccb24e06520f9209.zip
The variable "Latch" is only used in an assert, which makes builds that use "-DNDEBUG" fail with unused variable messages.
Summary: Move the logic into the assert itself. Subscribers: hiraditya, sanjoy, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64654 llvm-svn: 365943
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 7f2979a9030..70508bf7525 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2627,7 +2627,6 @@ bool IndVarSimplify::sinkUnusedInvariants(Loop *L) {
bool IndVarSimplify::optimizeLoopExits(Loop *L) {
SmallVector<BasicBlock*, 16> ExitingBlocks;
L->getExitingBlocks(ExitingBlocks);
- BasicBlock * const Latch = L->getLoopLatch();
// Form an expression for the maximum exit count possible for this loop. We
// merge the max and exact information to approximate a version of
@@ -2641,7 +2640,7 @@ bool IndVarSimplify::optimizeLoopExits(Loop *L) {
for (BasicBlock *ExitingBB : ExitingBlocks) {
const SCEV *ExitCount = SE->getExitCount(L, ExitingBB);
if (!isa<SCEVCouldNotCompute>(ExitCount)) {
- assert(DT->dominates(ExitingBB, Latch) &&
+ assert(DT->dominates(ExitingBB, L->getLoopLatch()) &&
"We should only have known counts for exiting blocks that "
"dominate latch!");
ExitCounts.push_back(ExitCount);
OpenPOWER on IntegriCloud