[PATCH] Caller/Calllee unsafe-fp-math attribute fixup prior to inlining.

Chandler Carruth chandlerc at google.com
Tue Apr 15 23:01:48 PDT 2014


I understand what you're going for here, but I don't think this is the
right approach.

We have per-instruction unsafe math flags *specifically* to make them work
even in the presence of inlining. Given that, I don't understand why we
want to have even remotely clever handling of the function attributes.

I would suggest:

1) If we don't already do so, add a pass which propagates function
attributes onto instruction attributes, and strips the function attributes.
2) Teach the inliner to simply refuse to inline across differently
attributed functions.

#1 will make #2 only matter for non-canonical IR coming into the inliner by
being conservatively correct.


On Tue, Apr 15, 2014 at 10:22 PM, Puyan Lotfi <plotfi at apple.com> wrote:

> Ping.
>
>
>
>
> On Apr 10, 2014, at 10:10 PM, Puyan Lotfi <plotfi at apple.com> wrote:
>
> > Hi All
> >
> > The following patch checks that when inlining a callee into a a caller
> with unsafe-fp-math set, that the callee also has the attribute for
> unsafe-fp-math set (or others that apply) too.
> > The idea is to make the caller being altered by inlining be as safe as
> the callee, and the check is made immediately prior to the actual inlining
> (where it will modify whatever function attributes necessary).
> >
> > Could someone review this please?
> >
> > Thanks
> >
> > -Puyan
> >
> > <unsafeattr2.patch>
> >
> > P.S.
> >
> > This is a ping of a patch I sent previously, but I thought I’d rewrite
> the email body for clarity. _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140415/f60ec4b4/attachment.html>


More information about the llvm-commits mailing list