<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 12, 2012, at 4:49 PM, Shuxin Yang <<a href="mailto:shuxin.llvm@gmail.com">shuxin.llvm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
Hi, Eli, Mike and Lang:<br>
<br>
Thank you all for the input. This is one e.g which might be
difficult for isel: <br>
a*b + c*d + e => a*b + (c*d + e). <br>
<br></div></blockquote><div><br></div><div>You hit send right when I did!</div><div>For your example, do you mean that it's grouped like:</div><div>(fadd (fadd (fmul a b) (fmul c d)) e)</div><div><br></div><div>How would your pass go about handling these patterns and is that something that would be too complicated for fast-isel to do on the fly?</div><br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000">
Thanks<br>
Shuxin<br>
<br>
<div class="moz-cite-prefix">On 12/12/12 4:43 PM, Lang Hames wrote:<br>
</div>
<blockquote cite="mid:CALLttgp4Sr-CYF7BT-rU+P4pEW_5vppZM9TPuTfUx7jWKRjF9g@mail.gmail.com" type="cite">A little background:
<div><br>
</div>
<div>The fmuladd intrinsic was introduced to support the
FP_CONTRACT pragma in C. llvm.fmuladd.* is generated by clang
when it sees an expression of the form 'a * b + c' within a
single source statement.
<div>
<br>
</div>
<div>If you want to opportunistically form FMA target
instructions my inclination would be to skip llvm.fmuladd.*
and just form them from a*b+c expressions at isel time. I
don't see any fundamental problem with forming llvm.fmuladd.*
to model FMA formation opportunities in an IR pass though.</div>
<div><br>
</div>
<div>- Lang.</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, Dec 12, 2012 at 4:11 PM,
Michael Ilseman <span dir="ltr"><<a moz-do-not-send="true" href="mailto:milseman@apple.com" target="_blank">milseman@apple.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br>
<div>
<div class="im">
<div>On Dec 12, 2012, at 3:40 PM, Shuxin Yang <<a moz-do-not-send="true" href="mailto:shuxin.llvm@gmail.com" target="_blank">shuxin.llvm@gmail.com</a>>
wrote:</div>
<br>
<blockquote type="cite">Hi, Dear All:<br>
<br>
I'm going implement FMA formation. On some
architectures, "FMA a, b, c" is more precise than<br>
"a * b + c". I'm wondering if FMA could be less
precise. In the former case, can we enable FMA<br>
formation despite restrictive FP mode?<br>
<br>
</blockquote>
<div><br>
</div>
</div>
<div>I believe that a pass to form fmuladd[1] intrinsic
calls would be very useful! The fmuladd intrinsic is
defined such that its formation should be isolated
from worries about strictness. It simply means "<span style="line-height:21px;text-align:left;font-size:14px;font-family:'Lucida
Grande','Lucida Sans
Unicode',Geneva,Verdana,sans-serif">a * b + c</span>"
and leaves the decision of whether or not to fuse up
to the code generator. Of course, one probably would
only run your pass if they wanted the code generator
to fuse it, but the pass itself should be valid. </div>
<div><br>
</div>
<div>Someone please correct me if I misunderstand this
intrinsic. </div>
<div><br>
</div>
<div>[1] <a moz-do-not-send="true" href="http://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic" target="_blank">http://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic</a></div>
<div class="im"><br>
<blockquote type="cite"> Thanks<br>
Shuxin<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote>
</div>
</div>
<br>
</div>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br></body></html>