[llvm] [SCEV] Try to re-use pointer LCSSA phis when expanding SCEVs. (PR #147824)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 13:46:47 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index ca9183b91..437977728 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -1237,7 +1237,7 @@ Value *SCEVExpander::tryToReuseLCSSAPhi(const SCEVAddRecExpr *S) {
     auto *ExitSCEV = SE.getSCEV(&PN);
     Type *PhiTy = PN.getType();
     if (STy->isIntegerTy() && PhiTy->isPointerTy())
-      ExitSCEV= SE.getPtrToIntExpr(ExitSCEV, STy);
+      ExitSCEV = SE.getPtrToIntExpr(ExitSCEV, STy);
     else if (S->getType() != PN.getType())
       continue;
     const SCEV *Diff = SE.getMinusSCEV(S, ExitSCEV);

``````````

</details>


https://github.com/llvm/llvm-project/pull/147824


More information about the llvm-commits mailing list