[llvm] [HIPSTDPAR] Add handling for math builtins (PR #140158)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 15 16:05:51 PDT 2025


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 HEAD~1 HEAD --extensions h,cpp -- llvm/include/llvm/Transforms/HipStdPar/HipStdPar.h llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp b/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
index 815878089..a5db4a6d1 100644
--- a/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
+++ b/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
@@ -390,8 +390,8 @@ PreservedAnalyses HipStdParMathFixupPass::run(Module &M,
 
     switch (ID) {
     case Intrinsic::not_intrinsic: {
-      auto It = find_if(MathLibToHipStdPar,
-                        [&](auto &&M) { return M.first == N; });
+      auto It =
+          find_if(MathLibToHipStdPar, [&](auto &&M) { return M.first == N; });
       if (It == std::cend(MathLibToHipStdPar))
         continue;
       ToReplace.emplace_back(&F, It->second);
@@ -433,8 +433,9 @@ PreservedAnalyses HipStdParMathFixupPass::run(Module &M,
     ToReplace.emplace_back(&F, std::move(N));
   }
   for (auto &&F : ToReplace)
-    F.first->replaceAllUsesWith(M.getOrInsertFunction(
-        F.second, F.first->getFunctionType()).getCallee());
+    F.first->replaceAllUsesWith(
+        M.getOrInsertFunction(F.second, F.first->getFunctionType())
+            .getCallee());
 
   return PreservedAnalyses::none();
 }
\ No newline at end of file

``````````

</details>


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


More information about the llvm-commits mailing list