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 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 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 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 href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a 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 href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a 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>