[PATCH] D14933: Add the allocsize attribute to LLVM

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 11:31:25 PST 2016


george.burgess.iv added a comment.

Thank you both for the feedback/thoughts.

@sanjoy -

> Have you considered using operand bundles to express arbitrary allocation size information? With operand bundles, the representation would be something like


TIL those exist -- neat! I think that would be a better approach than requiring custom intrinsics in the example I posted above.

@ab -

> One could justify the expression support as simplifying the transition for users (the alternative you show does require manual work),


I agree, but I'm not sure how strong of an argument that would be, given that in most cases, the difference seems to be writing a few expressions in an attribute vs writing those same expressions in a small wrapper.

> but I think this attribute is enough


Yay :)

> So, I was thinking you'd IRGen the whole expression at every callsite; and this is what I meant with "wrapping" the calls


Ah, okay. I ruled that out initially because of the "side-effects must be allowed" restriction, but didn't consider it when we lifted that. Apologies.

> I think this avoids all problems except [...]


Agreed

----

Thought experiments aside, ISTM that no one's unhappy with the design of this attribute as-is. Is this correct?


http://reviews.llvm.org/D14933





More information about the llvm-commits mailing list