[llvm] [flang][rt] Add noinline attributes for CUDA compile path for successful compilation (PR #161760)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 2 18:40:07 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 origin/main HEAD --extensions cpp -- flang-rt/lib/runtime/extrema.cpp flang-rt/lib/runtime/findloc.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/flang-rt/lib/runtime/extrema.cpp b/flang-rt/lib/runtime/extrema.cpp
index 3c9af38a6..e268ff926 100644
--- a/flang-rt/lib/runtime/extrema.cpp
+++ b/flang-rt/lib/runtime/extrema.cpp
@@ -403,10 +403,9 @@ struct DoPartialMaxOrMinLocHelper {
 #if defined(__CUDACC__)
     __attribute__((noinline))
 #endif
-    RT_API_ATTRS void
-    operator()(const char *intrinsic, Descriptor &result, const Descriptor &x,
-        int kind, int dim, const Descriptor *mask, bool back,
-        Terminator &terminator) const {
+    RT_API_ATTRS void operator()(const char *intrinsic, Descriptor &result,
+        const Descriptor &x, int kind, int dim, const Descriptor *mask,
+        bool back, Terminator &terminator) const {
       DoPartialMaxOrMinLoc<CAT, KIND, IS_MAX, COMPARE>(
           intrinsic, result, x, kind, dim, mask, back, terminator);
     }
diff --git a/flang-rt/lib/runtime/findloc.cpp b/flang-rt/lib/runtime/findloc.cpp
index e1060bf82..64ae2c585 100644
--- a/flang-rt/lib/runtime/findloc.cpp
+++ b/flang-rt/lib/runtime/findloc.cpp
@@ -159,10 +159,10 @@ struct NumericFindlocHelper {
 #if defined(__CUDACC__)
     __attribute__((noinline))
 #endif
-    RT_API_ATTRS void
-    operator()(TypeCategory targetCat, int targetKind, Descriptor &result,
-        const Descriptor &x, const Descriptor &target, int kind, int dim,
-        const Descriptor *mask, bool back, Terminator &terminator) const {
+    RT_API_ATTRS void operator()(TypeCategory targetCat, int targetKind,
+        Descriptor &result, const Descriptor &x, const Descriptor &target,
+        int kind, int dim, const Descriptor *mask, bool back,
+        Terminator &terminator) const {
       switch (targetCat) {
       case TypeCategory::Integer:
       case TypeCategory::Unsigned:

``````````

</details>


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


More information about the llvm-commits mailing list