[llvm] [LoopUnroll] Allow expensive trip count emitting which is estimated to be infinite (PR #79869)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 09:42:35 PST 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 4a39d08908942b2d415db405844cbe4af73e75d4 7ef0291b6f8662ac52cc730958bec963c2570958 -- llvm/include/llvm/Transforms/Utils/LoopUtils.h llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp llvm/lib/Transforms/Utils/LoopUtils.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 2f3d33121b..763e19afc7 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -1042,7 +1042,7 @@ bool llvm::computeUnrollCount(
else
UP.AllowExpensiveTripCount = true;
} else if (isInfiniteTripCount(L))
- UP.AllowExpensiveTripCount = true;
+ UP.AllowExpensiveTripCount = true;
}
UP.Runtime |= PragmaEnableUnroll || PragmaCount > 0 || UserUnrollCount;
if (!UP.Runtime) {
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 8d85d0ec88..3e1015de8f 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -905,7 +905,7 @@ bool llvm::isInfiniteTripCount(Loop *L) {
std::swap(LoopWeight, ExitWeight);
if (!ExitWeight)
- return true;
+ return true;
}
return false;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/79869
More information about the llvm-commits
mailing list