erichkeane wrote:

SO it IS a touch of a hack unfortunately.  LLVM doesn't really have a way of 
separating bitint from its iN types, so the automatic alignment is set by them. 
 So it comes down to when we need to do the layout adjustment for our structs 
and arrays to be properly aligned.

I considered doing it later (during LowertoLLVM) but the impact is actually 
quite huge, we end up having to modify all of the constant lowering, change how 
arrays are stored at that point, etc.  It just touches a lot.  THIS on the 
other hand just separates out their 'natural'/'automatic' alignment, and the 
'required' alignment of our struct layouts fall out of it.  

SO I don't really have a better way of doing this?  We HAVE to set our 
alignments for these somewhere, and there isn't a clear-cut way to do it.  We 
COULD stop representing _BitInt separately in CIR (and frankly, this removes 
SOME of that?), but I think it still keeps most of the value, without 
overcomplicating our storage (that is, making a CIR bitint-128 BE effectively 
an LLVM i128 in size/alignment, rather than a AST-level bitint-128 for that 
purpose).  I see it a bit the same as to how we have our load/store 
instructions still keep the alignment in them.

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

Reply via email to