[llvm] 24caf01 - [IndVarSimplify] Remove duplicate call to getSCEV. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 09:47:17 PDT 2023


Author: Craig Topper
Date: 2023-03-21T09:47:07-07:00
New Revision: 24caf0196d03858bd9fe90d14133fb69c8cea444

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

LOG: [IndVarSimplify] Remove duplicate call to getSCEV. NFC

We already did this same call on the line before.

Reviewed By: nikic

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 2b19842050a5..18c3fe06503b 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1080,8 +1080,7 @@ linearFunctionTestReplace(Loop *L, BasicBlock *ExitingBB,
     // a truncate within in.
     bool Extended = false;
     const SCEV *IV = SE->getSCEV(CmpIndVar);
-    const SCEV *TruncatedIV = SE->getTruncateExpr(SE->getSCEV(CmpIndVar),
-                                                  ExitCnt->getType());
+    const SCEV *TruncatedIV = SE->getTruncateExpr(IV, ExitCnt->getType());
     const SCEV *ZExtTrunc =
       SE->getZeroExtendExpr(TruncatedIV, CmpIndVar->getType());
 


        


More information about the llvm-commits mailing list