Alex Rosenberg
2012-Aug-27 18:51 UTC
[LLVMdev] PROPOSAL: IR representation of detailed struct assignment information
On Aug 27, 2012, at 11:37 AM, gohman at apple.com wrote:> On Aug 24, 2012, at 5:56 PM, Alex Rosenberg <alexr at leftfield.org> wrote: > > > 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. +------------------------------------------------------------+ | Alexander M. Rosenberg <mailto:alexr at leftfield.org> | | Nobody cares what I say, so no disclaimer appears here. |
Peter Cooper
2012-Aug-27 19:46 UTC
[LLVMdev] PROPOSAL: IR representation of detailed struct assignment information
On Aug 27, 2012, at 11:51 AM, Alex Rosenberg <alexr at leftfield.org> wrote:> On Aug 27, 2012, at 11:37 AM, gohman at apple.com wrote: > >> On Aug 24, 2012, at 5:56 PM, Alex Rosenberg <alexr at leftfield.org> wrote: >> >>> 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> > +------------------------------------------------------------+ > | Alexander M. Rosenberg <mailto:alexr at leftfield.org> | > | Nobody cares what I say, so no disclaimer appears here. | > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev