[llvm] [SCEV] Consolidate code for proving wrap flags of controlling finite IVs (PR #101404)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 13:23:10 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 35a2e6d24bcb94720ec7b3aa00e58a1b7b837fbc c494305d4427fa8e8a3efd29a831858cf455f1d3 --extensions cpp -- 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 acfadfa3e7..056e6273db 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -9176,14 +9176,15 @@ ScalarEvolution::ExitLimit ScalarEvolution::computeExitLimitFromICmp(
     // last value before (un)signed wrap.  Since we know that last value
     // didn't exit, nor will any smaller one.
     if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_ULT) {
-      auto WrapType = Pred == ICmpInst::ICMP_SLT ? SCEV::FlagNSW : SCEV::FlagNUW;
+      auto WrapType =
+          Pred == ICmpInst::ICMP_SLT ? SCEV::FlagNSW : SCEV::FlagNUW;
       if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(LHS);
           AR && AR->getLoop() == L && AR->isAffine() &&
           !AR->getNoWrapFlags(WrapType) && AR->hasNoSelfWrap() &&
           isKnownPositive(AR->getStepRecurrence(*this))) {
         auto Flags = AR->getNoWrapFlags();
         Flags = setFlags(Flags, WrapType);
-        SmallVector<const SCEV*> Operands{AR->operands()};
+        SmallVector<const SCEV *> Operands{AR->operands()};
         Flags = StrengthenNoWrapFlags(this, scAddRecExpr, Operands, Flags);
         setNoWrapFlags(const_cast<SCEVAddRecExpr *>(AR), Flags);
       }

``````````

</details>


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


More information about the llvm-commits mailing list