[Mlir-commits] [flang] [mlir] [Flang][OpenMP] Fix to resolve the crash with SIMD aligned clause. (PR #150612)

Kaviya Rajendiran llvmlistbot at llvm.org
Tue Jul 29 05:10:45 PDT 2025


================
@@ -2893,6 +2893,15 @@ 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()) {
+      emitWarning(simdOp->getLoc())
+          << "The specified alignment value, " << intAttr.getInt()
+          << " is not a power of two and will be ignored";
----------------
kaviya2510 wrote:

Thankyou for pointing out the file. I have added a testcase for this scenario.

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


More information about the Mlir-commits mailing list