[llvm] 569f7e5 - [SCEV][NFC] Convert check to assert getSmallConstantTripMultiple()

Joshua Cao via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 20:12:10 PDT 2023


Author: Joshua Cao
Date: 2023-04-10T19:59:01-07:00
New Revision: 569f7e547d4124943a2aaa8da31bd82af0db37f2

URL: https://github.com/llvm/llvm-project/commit/569f7e547d4124943a2aaa8da31bd82af0db37f2
DIFF: https://github.com/llvm/llvm-project/commit/569f7e547d4124943a2aaa8da31bd82af0db37f2.diff

LOG: [SCEV][NFC] Convert check to assert getSmallConstantTripMultiple()

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 52bd161cf9dd..ce77ccea0480 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8247,7 +8247,8 @@ unsigned ScalarEvolution::getSmallConstantTripMultiple(const Loop *L,
   // Guard against huge trip counts (this requires checking
   // for zero to handle the case where the trip count == -1 and the
   // addition wraps).
-  if (!Result || Result->getValue().getActiveBits() > 32 ||
+  assert(Result && "SCEVConstant expected to have non-null ConstantInt");
+  if (Result->getValue().getActiveBits() > 32 ||
       Result->getValue().getActiveBits() == 0)
     return 1;
 


        


More information about the llvm-commits mailing list