[llvm-branch-commits] [llvm] [ctx_prof] Handle `select` (PR #109185)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Sep 18 12:53:06 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 987562aab1c409b62b1a4c5d6d8566ad812b8313 09642a4889da1d0e10f54b17b84e32dae5c8557e --extensions cpp,h -- llvm/include/llvm/Analysis/CtxProfAnalysis.h llvm/lib/Analysis/CtxProfAnalysis.cpp llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp llvm/lib/Transforms/Utils/InlineFunction.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp b/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp
index 30bb251364..3a3c47e90a 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp
@@ -154,7 +154,7 @@ class ProfileAnnotator final {
bool hasCount() const { return Count.has_value(); }
- uint64_t getCount() const { return *Count;}
+ uint64_t getCount() const { return *Count; }
bool trySetSingleUnknownInEdgeCount() {
if (UnknownCountInEdges == 1) {
@@ -347,11 +347,12 @@ public:
if (auto *SI = dyn_cast<SelectInst>(&I)) {
if (auto *Step = CtxProfAnalysis::getSelectInstrumentation(*SI)) {
auto Index = Step->getIndex()->getZExtValue();
- assert(Index < Counters.size() &&
- "The index of the step instruction must be inside the "
- "counters vector by "
- "construction - tripping this assertion indicates a bug in "
- "how the contextual profile is managed by IPO transforms");
+ assert(
+ Index < Counters.size() &&
+ "The index of the step instruction must be inside the "
+ "counters vector by "
+ "construction - tripping this assertion indicates a bug in "
+ "how the contextual profile is managed by IPO transforms");
auto TotalCount = BBInfo.getCount();
auto TrueCount = Counters[Index];
auto FalseCount =
``````````
</details>
https://github.com/llvm/llvm-project/pull/109185
More information about the llvm-branch-commits
mailing list