[Mlir-commits] [flang] [mlir] [LLVM-Flang][OpenMP] Fix to resolve the crash with SIMD aligned clause. (PR #150612)
Kiran Chandramohan
llvmlistbot at llvm.org
Mon Jul 28 03:15:54 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;
----------------
kiranchandramohan wrote:
I am just thinking out loud what we really want to do here.
Should we
1. Ignore this clause without doing anything
2. Ignore this clause with a warning
3. Error out
Previous situation was 3, this patch changes it to 2. I am assuming Option 1 is incorrect IR?
In the current implementation for non-Flang users of OpenMP MLIR, this would be a surprise. Ideally, we should emit the warning at the point the clause is ignored. I guess this might mean that the warning cannot be controlled with a Flang frontend flag. WDYT?
https://github.com/llvm/llvm-project/pull/150612
More information about the Mlir-commits
mailing list