Page MenuHomePhabricator

IR: Reject unsized sret in verifier
Needs ReviewPublic

Authored by arsenm on Fri, Sep 25, 11:28 AM.

Details

Summary

The same is enforced for the other ABI pointer attributes.

Not sure why MemCpyOpt/memcpy.ll seems to have been testing for
exactly this with a referenced radar number, although I don't see how
that makes sense.

Diff Detail

Event Timeline

arsenm created this revision.Fri, Sep 25, 11:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Sep 25, 11:28 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
arsenm requested review of this revision.Fri, Sep 25, 11:28 AM

I'm in favor.

llvm/test/Transforms/MemCpyOpt/memcpy.ll
234

FWIW, this was introduced in bd254f260127 and I cannot tell if such code should even be legal in the first place (and this patch says its not)

sret marks that a parameter needs the special indirect-return argument ABI, which does *not* require a sized type on many architectures. Swift actually relies on being able to trigger this ABI on a value of unknown size. Swift can, of course, just use a meaningless sized type, but since I assume you intend to actually use the type for something, I am concerned.