[Mlir-commits] [flang] [llvm] [mlir] [Flang] [OpenMP] [MLIR] Add lowering support for OMP ALLOCATE directives and its clauses (PR #187167)

Tom Eccles llvmlistbot at llvm.org
Wed Mar 18 04:03:56 PDT 2026


================
@@ -0,0 +1,45 @@
+! This test checks lowering of OpenMP allocate Directive with align and allocator
+! clauses to LLVM IR. Verifies code generation for:
+!   - align(16) only (null allocator)
+!   - allocator(1) only (no align)
+!   - align(64) allocator(6) (both clauses, array variable)
+!   - align(32) allocator(3) (both clauses, multiple variables)
+
+! RUN: %flang_fc1 -emit-llvm %openmp_flags -fopenmp-version=51 %s -o - 2>&1 | FileCheck %s
----------------
tblah wrote:

Please just check that this lowers to mlir (`flang_fc1 -emit-hlfir ...`) here, and have a test under `mlir/` ensuring the AllocateDirOps are converted to LLVM-IR correctly.

We do have full Fortran->LLVM-IR tests in flang/test/Integration but they are only for exceptional cases because they tend to increase maintenance burden (they simultaneously test all of Flang's pipleine and so need to be updated more often).

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


More information about the Mlir-commits mailing list