[llvm] [SCEV] Make PHI handling fully iterative. (PR #226624)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 27 10:26:02 PDT 2026
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 origin/main HEAD --extensions h,cpp -- llvm/include/llvm/Analysis/ScalarEvolution.h llvm/lib/Analysis/ScalarEvolution.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 24002beb0..38eafb084 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -5399,9 +5399,10 @@ static const Loop *isIntegerLoopHeaderPHI(const PHINode *PN, LoopInfo &LI) {
// will return the pair {NewAddRec, SmallPredsVec} where:
// NewAddRec = {%Start,+,%Step}
// SmallPredsVec = {P1, P2, P3} as follows:
-// P1(WrapPred): AR: {trunc(%Start),+,(trunc %Step)}<nsw> Flags: <nssw>
-// P2(EqualPred): %Start == (sext i32 (trunc i64 %Start to i32) to i64)
-// P3(EqualPred): %Step == (sext i32 (trunc i64 %Step to i32) to i64)
+// P1(WrapPred): AR: {trunc(%Start),+,(trunc %Step)}<nsw> Flags:
+// <nssw> P2(EqualPred): %Start == (sext i32 (trunc i64 %Start to i32)
+// to i64) P3(EqualPred): %Step == (sext i32 (trunc i64 %Step to i32)
+// to i64)
// The returned pair means that SymbolicPHI can be rewritten into NewAddRec
// under the predicates {P1,P2,P3}.
// This predicated rewrite will be cached in PredicatedSCEVRewrites:
``````````
</details>
https://github.com/llvm/llvm-project/pull/226624
More information about the llvm-commits
mailing list