[PATCH] D29925: Implement intrinsic mangling for literal struct types.Fixes PR 31921

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 11:28:04 PST 2017


Hi Daniel,


On February 27, 2017 at 10:43:59 AM, Daniel Berlin (dberlin at dberlin.org) wrote:
> On Mon, Feb 27, 2017 at 10:19 AM, Sanjoy Das via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
> > sanjoy added a comment.
> >
> > In https://reviews.llvm.org/D29925#687131, @dberlin wrote:
> >
> > > I wasn't aware intrinsics were allowed to have a calling convention,
> > since they are internal to llvm.
> > > No intrinsic defined in Intrinsics* has one, from what i can tell, and
> > as you can see, the code we use to upgrade generically does not do anything
> > with calling convention either.
> > > I'm not even sure what it would mean for an intrinsic to have a calling
> > convention (instead of something it *lowers to* to have a calling
> > convention).
> >
> >
> > It is used for statepoints and patchpoints. `call cconv42
> > @statepoint(@foo)` is lowered to a call to `@foo`, and `cconv42` is
> > interpreted as the calling convention for the lowered call to `@foo`.
> >
> >
>
> Interesting.
> Okay, so then should we handle calling convention and attributes or just
> calling convention?

Yes, we need to maintain:

 - The calling convention
 - Attributes
 - Operand bundles

(Of course, metadata is allowed to be dropped.)

I think CI->setCalledFunction(NewFn) is probably the simplest path forward here.

-- Sanjoy


More information about the llvm-commits mailing list