[llvm] 3a82669 - [SCEV] Removed an unnecessary assertion

via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 14:26:57 PDT 2022


Author: Yangguang Li
Date: 2022-05-03T17:26:27-04:00
New Revision: 3a8266902b58978a6fd52b779e8ad94fbf368182

URL: https://github.com/llvm/llvm-project/commit/3a8266902b58978a6fd52b779e8ad94fbf368182
DIFF: https://github.com/llvm/llvm-project/commit/3a8266902b58978a6fd52b779e8ad94fbf368182.diff

LOG: [SCEV] Removed an unnecessary assertion

The assertion is to check we always get backedge taken count
(`BECount`) of zero when the exit condition is in select form
(`isa<BinaryOperation>(ExitCond)`) and the exit limit for the
first operand is zero `EL0.ExactNotTaken->isZero()`). However
the assertion is checking that the exit condition is NOT in
select form. Removing the the whole assertion since we now handle
select form in ScalarEvolution::getSequentialMinMaxExpr.

Reviewed By: reames, nikic

Differential Revision: https://reviews.llvm.org/D122835

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 6ff8ce2cdf159..f927ea2307a09 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8464,11 +8464,6 @@ ScalarEvolution::computeExitLimitFromCondFromBinOp(
       BECount = getUMinFromMismatchedTypes(
           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.MaxNotTaken == getCouldNotCompute())
       MaxBECount = EL1.MaxNotTaken;


        


More information about the llvm-commits mailing list