[flang-commits] [flang] [Flang] [OpenMP] Run `MarkDeclareTarget` pass again before `HostOpFiltering` (PR #210049)
Sergio Afonso via flang-commits
flang-commits at lists.llvm.org
Mon Jul 20 03:04:33 PDT 2026
================
@@ -0,0 +1,29 @@
+!===----------------------------------------------------------------------===!
+! This directory can be used to add Integration tests involving multiple
+! stages of the compiler (for eg. from Fortran to LLVM IR). It should not
+! contain executable tests. We should only add tests here sparingly and only
+! if there is no other way to test. Repeat this message in each test that is
+! added to this directory and sub-directories.
+!===----------------------------------------------------------------------===!
+
+!REQUIRES: amdgpu-registered-target
+!RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -fopenmp -nogpulib -fopenmp-is-target-device -mmlir --mlir-print-ir-before-all -S %s -o /dev/null 2>&1 | FileCheck %s
+
+
+! This tests the fix for https://github.com/llvm/llvm-project/issues/209123
+! We are only interested in ensuring that functions used in target regions should have
+! the omp.declare_target attribute so the -omp-host-op-fitler pass doesn't crash.
+
+! CHECK-LABEL: IR Dump Before HostOpFilteringPass: omp-host-op-filter
+! CHECK: llvm.func{{.*}}@__mlir_math_ipowi_i32
+! CHECK-SAME: attributes{{.*}}omp.declare_target
----------------
skatrak wrote:
Nit: Also make sure here that the `device_type` is not host-only. Otherwise, we'd end up with the same issue.
https://github.com/llvm/llvm-project/pull/210049
More information about the flang-commits
mailing list