[Mlir-commits] [flang] [mlir] [LLVM-Flang][OpenMP] Fix to resolve the crash with SIMD aligned clause. (PR #150612)
Kaviya Rajendiran
llvmlistbot at llvm.org
Mon Jul 28 06:28:36 PDT 2025
================
@@ -2893,6 +2893,11 @@ convertOmpSimd(Operation &opInst, llvm::IRBuilderBase &builder,
alignment = builder.getInt64(intAttr.getInt());
assert(ty->isPointerTy() && "Invalid type for aligned variable");
assert(alignment && "Invalid alignment value");
+ // Check if the alignment value is not a power of 2. If so, skip emitting
+ // alignment.
+ if (!intAttr.getValue().isPowerOf2())
+ continue;
----------------
kaviya2510 wrote:
Thankyou for reviewing the patch.
yes, I agree with you. As you mentioned, it would be more accurate to place the warning in openmp mlir instead of handling it in Flang frontend.
https://github.com/llvm/llvm-project/pull/150612
More information about the Mlir-commits
mailing list