PROPOSAL: IR representation of detailed struct assignment information

You're describing structure padding and doing so as metadata on memcpy operations. I think it would be better to describe it in the struct definition itself, which is where the end of struct alignment padding I mentioned would also want to be described. Is padding really metadata? One might argue that the end padding is, but between proper elements, it seems quite first-class to me.

If we can also describe the alignment padding inserted at the end of a struct when it is placed in an array, then we can improve the current LoopIdiom pass to build more memcpys. I would think that would be attached to the struct definition.

Perhaps, though that would be unrelated in implementation and use from
what I'm working on.

You're describing structure padding and doing so as metadata on memcpy operations. I think it would be better to describe it in the struct definition itself, which is where the end of struct alignment padding I mentioned would also want to be described. Is padding really metadata? One might argue that the end padding is, but between proper elements, it seems quite first-class to me.

I like this approach. I think it makes more sense on the struct definition.

It would also be nice to make __attribute__((unused)) count as padding for this. Vector math libraries in particular have an unused field on a vec3 to pad to a vec4 and it would be nice to know thats just padding.

Pete