<div dir="ltr">I understand what you're going for here, but I don't think this is the right approach.<div><br></div><div>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.</div>
<div><br></div><div>I would suggest:</div><div><br></div><div>1) If we don't already do so, add a pass which propagates function attributes onto instruction attributes, and strips the function attributes.</div><div>2) Teach the inliner to simply refuse to inline across differently attributed functions.</div>
<div><br></div><div>#1 will make #2 only matter for non-canonical IR coming into the inliner by being conservatively correct.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 10:22 PM, Puyan Lotfi <span dir="ltr"><<a href="mailto:plotfi@apple.com" target="_blank">plotfi@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ping.<br>
<br>
<br><br>
<br>
On Apr 10, 2014, at 10:10 PM, Puyan Lotfi <<a href="mailto:plotfi@apple.com">plotfi@apple.com</a>> wrote:<br>
<br>
> Hi All<br>
><br>
> 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.<br>
> 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).<br>
><br>
> Could someone review this please?<br>
><br>
> Thanks<br>
><br>
> -Puyan<br>
><br>
> <unsafeattr2.patch><br>
><br>
> P.S.<br>
><br>
> This is a ping of a patch I sent previously, but I thought I’d rewrite the email body for clarity. _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>