[PATCH] D64654: The variable "Latch" is only used in an assert, which makes builds that use "-DNDEBUG" fail with unused variable messages.

Sterling Augustine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 11:50:53 PDT 2019


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365943: The variable "Latch" is only used in an assert, which makes builds that use "… (authored by saugustine, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64654?vs=209552&id=209553#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64654/new/

https://reviews.llvm.org/D64654

Files:
  llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp


Index: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -2627,7 +2627,6 @@
 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 @@
   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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64654.209553.patch
Type: text/x-patch
Size: 1037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190712/3c4f4542/attachment.bin>


More information about the llvm-commits mailing list