[clang] [CIR] Make cir.alloca alignment mandatory with default 0 (PR #172663)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 6 10:38:44 PST 2026


================
@@ -530,7 +530,7 @@ def CIR_AllocaOp : CIR_Op<"alloca", [
     StrAttr:$name,
     UnitAttr:$init,
     UnitAttr:$constant,
-    ConfinedAttr<OptionalAttr<I64Attr>, [IntMinValue<0>]>:$alignment,
+    ConfinedAttr<DefaultValuedAttr<I64Attr, "0">, [IntMinValue<0>]>:$alignment,
----------------
andykaylor wrote:

I see that the attribute was marked as optional previously, but I don't see any places where we are calling `AllocaOp::create` that do not provide an alignment value. Am I missing something?

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


More information about the cfe-commits mailing list