================
@@ -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:

In that case, we're providing the alignment in the call to `emitAlloca` (via 
the `CharUnits()` argument). We're doing it wrong, but that's where we're doing 
it, so it has nothing to do with the AllocaOp needing to provide a default 
value.

The equivalent code in classic codegen calls the `llvm::AllocaInst` constructor 
directly without an alignment argument, and that in turn calls 
`computeAllocaDefaultAlign`. We should be doing something equivalent to that in 
`createTempAlloca` (and any other place that doesn't reasonably compute the 
alignment). I think that's beyond the scope of this PR.

https://github.com/llvm/llvm-project/pull/172663
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to