[PATCH] D146444: [IndVarSimplify] Remove duplicate call to getSCEV. NFC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 11:09:42 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: reames, nikic.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a project: LLVM.

We already did this same call on the line before.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146444

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


Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1081,8 +1081,7 @@
     // 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());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146444.506657.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230320/d72a23c6/attachment.bin>


More information about the llvm-commits mailing list