[PATCH] D122835: [SCEV] Fix a bug that caused an invalid assertion.

YangguangLi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 13:38:21 PDT 2022


Yangguang updated this revision to Diff 419849.
Yangguang edited the summary of this revision.

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

https://reviews.llvm.org/D122835

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp


Index: llvm/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolution.cpp
+++ llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8437,10 +8437,9 @@
           EL0.ExactNotTaken, EL1.ExactNotTaken,
           /*Sequential=*/!isa<BinaryOperator>(ExitCond));
 
-      // If EL0.ExactNotTaken was zero and ExitCond was a short-circuit form,
-      // it should have been simplified to zero (see the condition (3) above)
-      assert(!isa<BinaryOperator>(ExitCond) || !EL0.ExactNotTaken->isZero() ||
-             BECount->isZero());
+      // If EL0.ExactNotTaken was zero, the BECount should have been simplified
+      // to zero.
+      assert(!EL0.ExactNotTaken->isZero() || BECount->isZero());
     }
     if (EL0.MaxNotTaken == getCouldNotCompute())
       MaxBECount = EL1.MaxNotTaken;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122835.419849.patch
Type: text/x-patch
Size: 862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220401/9902b2d4/attachment.bin>


More information about the llvm-commits mailing list