This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] allocas created for byval now respect addrspace
Needs ReviewPublic

Authored by RossBrunton on Jul 6 2022, 5:39 AM.

Details

Summary

Some targets support allocas in non-default address spaces. These
allocas may be used as "byval" parameters for functions.

When inlining functions, the inliner needs to create an alloca to
hold each inlinee's local copy of those arguments. Before this
patch, those allocas would always be in the target's "alloca
address space". However, if the type of the byval parameter is a
pointer to some other address space, then the address space of the
new alloca will not match its user's in the function's body.

This change makes the byval alloca's address space match the
address space of the respective parameter's argument.

Diff Detail

Event Timeline

RossBrunton created this revision.Jul 6 2022, 5:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 5:39 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
RossBrunton requested review of this revision.Jul 6 2022, 5:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2022, 5:39 AM