[llvm] [LoopPeeling] Fix weights updating of peeled off branches (PR #70094)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 12:32:02 PDT 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 888f07031bb6d64fd099516e187ed0bd818c59c3 46a9bdf6e1c969d878994fa391b88f362b57a255 -- llvm/lib/Transforms/Utils/LoopPeel.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp
index cc3ad5fcbf25..30c525dd82bb 100644
--- a/llvm/lib/Transforms/Utils/LoopPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp
@@ -638,9 +638,9 @@ static void updateBranchWeights(Instruction *Term, WeightInfo &Info) {
     if (SubWeight != 0)
       // Don't set the probability of taking the edge from latch to loop header
       // to less than 1, as this could significantly reduce the loop's hotness,
-      // which would be incorrect in the case of underestimating the trip count.    
+      // which would be incorrect in the case of underestimating the trip count.
       Info.Weights[Idx] =
-          Info.Weights[Idx] > SubWeight  
+          Info.Weights[Idx] > SubWeight
               ? std::max(Info.Weights[Idx] - SubWeight, SubWeight)
               : SubWeight;
 }

``````````

</details>


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


More information about the llvm-commits mailing list