andykaylor wrote:

> Does alloca operations emitted by CIRGen always have the alignment attribute 
> set? If so, maybe we could just make the alignment attribute mandatory. 
> Otherwise I hope we could have a CIRGen test for that.

Good question. I see that the alignment attribute is marked as optional, but we 
don't have a builder without an alignment argument.

@Men-cotton How did you encounter the crash you are fixing here? Fuzz testing?

The LLVM Language Reference says this about alignment on the `alloca` 
instruction:

`The alignment is only optional when parsing textual IR; for in-memory IR, it 
is always present. An omitted align argument means that the operation has the 
ABI alignment for the target.`

I'm not sure that defaulting to zero matches those semantics. We should 
probably just make it a required attribute in CIR.

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