[llvm] d66e42c - [LoopIdiomRecognize] Replace getNegativeSCEV(getOne()) with getMinusOne. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 13:44:21 PDT 2023


Author: Craig Topper
Date: 2023-04-12T13:42:35-07:00
New Revision: d66e42ca4127db5b09fe47791c867f1907ee1b55

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

LOG: [LoopIdiomRecognize] Replace getNegativeSCEV(getOne()) with getMinusOne. NFC

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 6922ba3d70027..3e7d33a44c6b6 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -1001,7 +1001,7 @@ static const SCEV *getTripCount(const SCEV *BECount, Type *IntPtr,
           DL->getTypeSizeInBits(IntPtr) &&
       SE->isLoopEntryGuardedByCond(
           CurLoop, ICmpInst::ICMP_NE, BECount,
-          SE->getNegativeSCEV(SE->getOne(BECount->getType())))) {
+          SE->getMinusOne(BECount->getType()))) {
     TripCountS = SE->getZeroExtendExpr(
         SE->getAddExpr(BECount, SE->getOne(BECount->getType()), SCEV::FlagNUW),
         IntPtr);


        


More information about the llvm-commits mailing list