[llvm] Make 'UnrollMaxUpperBound' to be overridable by target. (PR #76029)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 01:21:55 PST 2023


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 fd59f07f6ab5fe76e6ec9883da29bbc1027168a4 4546bc62664f6c5e1554aa68b5529a7f0f2aefcc -- llvm/include/llvm/Analysis/TargetTransformInfo.h llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index 3d7191b902..63bba4e885 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -560,12 +560,13 @@ public:
     // (set to UINT_MAX to disable). This does not apply in cases where the
     // loop is being fully unrolled.
     unsigned MaxCount;
-    /// Set the maximum upper bound of trip count. Considering a loop with 'pragma 
-    /// unroll' specified but without 'full' or 'n' field, it depends on the 
-    /// UnrollMaxUpperBound option if the loop trip is unknown. However, the 
+    /// Set the maximum upper bound of trip count. Considering a loop with
+    /// 'pragma unroll' specified but without 'full' or 'n' field, it depends on
+    /// the UnrollMaxUpperBound option if the loop trip is unknown. However, the
     /// default value is 8 for this option which might not suitable for certain
-    /// target. Allowing the MaxUpperBound to be overrided by a target gives more
-    /// flexiblity on such cases. By default, MaxUpperBound uses UnrollMaxUpperBound
+    /// target. Allowing the MaxUpperBound to be overrided by a target gives
+    /// more flexiblity on such cases. By default, MaxUpperBound uses
+    /// UnrollMaxUpperBound
     unsigned MaxUpperBound;
     /// Set the maximum unrolling factor for full unrolling. Like MaxCount, but
     /// applies even if full unrolling is selected. This allows a target to fall
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index ddc532ea24..7cfeb019af 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -200,7 +200,7 @@ TargetTransformInfo::UnrollingPreferences llvm::gatherUnrollingPreferences(
   UP.Count = 0;
   UP.DefaultUnrollRuntimeCount = 8;
   UP.MaxCount = std::numeric_limits<unsigned>::max();
-  UP.MaxUpperBound = UnrollMaxUpperBound; 
+  UP.MaxUpperBound = UnrollMaxUpperBound;
   UP.FullUnrollMaxCount = std::numeric_limits<unsigned>::max();
   UP.BEInsns = 2;
   UP.Partial = false;

``````````

</details>


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


More information about the llvm-commits mailing list