[llvm] [SCEV] Use context sensative reasoning in howFarToZero (PR #94525)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 12:26:57 PDT 2024


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 c8d63516ac9e15831975392dd9f6b9ae6a31b21c 215810d3d72e0f211f3f2537f0827e238ad3ff9c -- llvm/lib/Analysis/ScalarEvolution.cpp
``````````

</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 8b947870e6..b63c773a71 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -10508,9 +10508,9 @@ ScalarEvolution::ExitLimit ScalarEvolution::howFarToZero(const SCEV *V,
     APInt MaxBECount = getUnsignedRangeMax(applyLoopGuards(Distance, L));
     MaxBECount = APIntOps::umin(MaxBECount, getUnsignedRangeMax(Distance));
 
-    // When a loop like "for (int i = 0; i != n; ++i) { /* body */ }" is rotated,
-    // we end up with a loop whose backedge-taken count is n - 1.  Detect this
-    // case, and see if we can improve the bound.
+    // When a loop like "for (int i = 0; i != n; ++i) { /* body */ }" is
+    // rotated, we end up with a loop whose backedge-taken count is n - 1.
+    // Detect this case, and see if we can improve the bound.
     //
     // Explicitly handling this here is necessary because getUnsignedRange
     // isn't context-sensitive; it doesn't know that we only care about the

``````````

</details>


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


More information about the llvm-commits mailing list