[llvm] [nfc] Improve testability of PGOInstrumentationGen (PR #104490)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 12:47:47 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 85da39debd8ee8c3186d88b462a924ea57b812ec c82371a92fe03e7dc2f0fba3cbc47e8ac1a60874 --extensions cpp,h -- llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h llvm/lib/Passes/PassBuilderPipelines.cpp llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 7867bee5c6..f165cd85c7 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -368,7 +368,7 @@ public:
       bool IsCS = false, bool IsCtxProf = false)
       : M(M), F(F), TLI(TLI), ComdatMembers(ComdatMembers), BPI(BPI), BFI(BFI),
         IsCS(IsCS), IsCtxProf(IsCtxProf) {}
-  
+
   void instrument();
 };
 } // namespace
@@ -902,8 +902,8 @@ void FunctionInstrumenter::instrument() {
       PGOBlockCoverage);
 
   auto Name = FuncInfo.FuncNameVar;
-  auto CFGHash = ConstantInt::get(Type::getInt64Ty(M.getContext()),
-                                  FuncInfo.FunctionHash);
+  auto CFGHash =
+      ConstantInt::get(Type::getInt64Ty(M.getContext()), FuncInfo.FunctionHash);
   if (PGOFunctionEntryCoverage) {
     auto &EntryBB = F.getEntryBlock();
     IRBuilder<> Builder(&EntryBB, EntryBB.getFirstInsertionPt());
@@ -978,8 +978,8 @@ void FunctionInstrumenter::instrument() {
     //                          i32 <index>)
     Builder.CreateCall(
         Intrinsic::getDeclaration(&M, PGOBlockCoverage
-                                         ? Intrinsic::instrprof_cover
-                                         : Intrinsic::instrprof_increment),
+                                          ? Intrinsic::instrprof_cover
+                                          : Intrinsic::instrprof_increment),
         {Name, CFGHash, Builder.getInt32(NumCounters), Builder.getInt32(I++)});
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list