[llvm-branch-commits] [flang] [mlir] [flang][OpenMP] Lower align modifiers on allocate clauses (PR #211624)

Tom Eccles via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 24 07:06:16 PDT 2026


================
@@ -1958,8 +1960,21 @@ allocatePrivateVars(T op, llvm::IRBuilderBase &builder,
         return llvm::createStringError(
             "failed to find converted OpenMP allocator operand");
       llvm::OpenMPIRBuilder::LocationDescription ompLoc(builder);
-      llvmPrivateVar = ompBuilder->createOMPAlloc(
-          ompLoc, sizeValue, allocator->second, "omp.private.alloc");
+      int64_t alignment =
+          allocateAlignments ? allocateAlignments[allocateIndex] : 0;
+      if (alignment != 0) {
+        uint64_t alignmentValue = static_cast<uint64_t>(alignment);
----------------
tblah wrote:

I think this should take the maximum value of the private type's natural alignment and the alignment specified in the align clause. Clang does seem to do this.

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


More information about the llvm-branch-commits mailing list