[Mlir-commits] [flang] [mlir] [OpenMP][Flang][MLIR] Introduce omp.declare_simd op and emit from Flang (PR #175604)

Tom Eccles llvmlistbot at llvm.org
Wed Jan 14 05:46:25 PST 2026


================
@@ -0,0 +1,204 @@
+! This test CHECKs the lowering of the OpenMP `declare simd` directive with
+! different clauses (e.g. aligned, linear, simdlen). It also verifies that
+! the `omp.declare_simd` operation is emitted after the function prologue,
+! since the directive requires access to function arguments.
+
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck %s
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=60 %s -o - | FileCheck %s
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=60 -cpp -DOMP_60 %s -o - | FileCheck %s --check-prefix=CHECK60
+
+subroutine declare_simd_no_clause()
+  !$omp declare simd
+end subroutine declare_simd_no_clause
+
+! CHECK-LABEL: func.func @_QPdeclare_simd_no_clause()
+! CHECK: omp.declare_simd
+! CHECK-NOT: {{omp\.declare_simd[[:space:]]*(aligned|linear|simdlen)\(}}
----------------
tblah wrote:

Oh yeah that works too an is a bit clearer. Maybe a CHECK-SAME-NOT

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


More information about the Mlir-commits mailing list