[flang-commits] [flang] [llvm] [flang][openmp] Fix GPU byref reduction descriptor initialization (PR #178934)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Sat Jan 31 10:56:02 PST 2026


================
@@ -0,0 +1,36 @@
+! RUN: %if amdgpu-registered-target %{ %flang_fc1 -triple amdgcn-amd-amdhsa -fopenmp -fopenmp-is-target-device -emit-llvm %s -o - | FileCheck %s %}
+! RUN: %if nvptx-registered-target %{ %flang_fc1 -triple nvptx64-nvidia-cuda -fopenmp -fopenmp-is-target-device -emit-llvm %s -o - | FileCheck %s %}
----------------
tblah wrote:

Normally we discourage `-emit-llvm` in flang/test (there is flang/test/Integration for exceptional cases) because going all of the way from fortran to LLVM-IR makes tests easily broken by unrelated changes.

In this particular case, you are checking only minimal details and so this might not break easily.

However, in this case you have only modified code in llvm/Frontend. The closest module to that in which you could test these changes would be to come up with a minimal test case in mlir/test/Target/LLVMIR for conversion from mlir -> llvm-ir. This is preferable because people modifying llvm/Frontend may not realise that they need to run flang tests. The MLIR translation is extremely closely coupled with llvm/Frontend so I think that connection is more reasonable.

You can get some approximately minimal MLIR for a fortran source file using `flang -fc1 -emit-hlfir -fopenmp file.f90 -o - | tco -test-gen`. This may need some manual modification to make it even simpler.

Treat this as a nitpick: no need to wait for another round of review from me after making this change if one of the other reviewers approves.

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


More information about the flang-commits mailing list