<div dir="auto"><div>Hi Kevin,<div dir="auto">Do you have any updates on this?</div><div dir="auto">Have you proposed a patch on Phabricator perhaps?</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri., Apr. 24, 2020, 12:47 p.m. Kevin Neal, <<a href="mailto:Kevin.Neal@sas.com">Kevin.Neal@sas.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-2820193981342031721WordSection1">
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">Oh, I can see that. We’ve got an intern that’s been testing as well.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">I wouldn’t oppose you adding that option. I don’t know what anyone else thinks, though.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">Right now my problem is I know very little about clang’s driver. So that’s where I’m working at the moment.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#44546a">--</span><span style="color:#44546a">
<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#44546a">Kevin P. Neal</span><span style="color:#44546a"><br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#44546a">SAS/C and SAS/C++ Compiler<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#44546a">Compute Services<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#44546a">SAS Institute, Inc.</span><span style="color:#44546a"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Nemanja Ivanovic <<a href="mailto:nemanja.i.ibm@gmail.com" target="_blank" rel="noreferrer">nemanja.i.ibm@gmail.com</a>> <br>
<b>Sent:</b> Friday, April 24, 2020 6:38 AM<br>
<b>To:</b> Kevin Neal <<a href="mailto:Kevin.Neal@sas.com" target="_blank" rel="noreferrer">Kevin.Neal@sas.com</a>><br>
<b>Cc:</b> <a href="mailto:cameron.mcinally@nyu.edu" target="_blank" rel="noreferrer">cameron.mcinally@nyu.edu</a>; Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [cfe-dev] Warning for partially implemented options/pragmas?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p><b><i><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">EXTERNAL</span></i></b><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">
</span><u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">The reason I suggested developer options was so that back end developers can build large applications using the option to get the intrinsics emitted and then chase what falls out (without changing the front end).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">For example, on PPC, I could specify the option, build the application that we know causes crashes in the back end for us and continue the work to implement full support.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But as you mentioned, the changes in the front end to flip the flag to say PPC supports this and continue my testing would be trivial.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Apr 23, 2020 at 1:53 PM Kevin Neal <<a href="mailto:Kevin.Neal@sas.com" target="_blank" rel="noreferrer">Kevin.Neal@sas.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">I’m already working on support for target-specific handling.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">I like the idea of target-specific disabling of the relevant options. I do think a warning is appropriate since this is a _<i>correctness</i>_
 issue, and also because the options can be triggered indirectly like Cameron showed.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a">The target-specific parts in clang itself that need to be done are very small, and as far as I know are confined to CGBuiltins.cpp.
 So I don’t think that any new options need to be added for developer use. Testing is an issue, but X86 and SystemZ are in such good shape that clang tests for anything else besides builtins can test on one of those two targets.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546a"> </span><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:currentcolor currentcolor">
<p class="MsoNormal"><b>From:</b> Nemanja Ivanovic <<a href="mailto:nemanja.i.ibm@gmail.com" target="_blank" rel="noreferrer">nemanja.i.ibm@gmail.com</a>>
<br>
<b>Sent:</b> Thursday, April 23, 2020 10:01 AM<br>
<b>To:</b> <a href="mailto:cameron.mcinally@nyu.edu" target="_blank" rel="noreferrer">cameron.mcinally@nyu.edu</a><br>
<b>Cc:</b> Kevin Neal <<a href="mailto:Kevin.Neal@sas.com" target="_blank" rel="noreferrer">Kevin.Neal@sas.com</a>>; Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [cfe-dev] Warning for partially implemented options/pragmas?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p><b><i><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">EXTERNAL</span></i></b><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">
</span><u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">I think it would be quite useful to add this in the front end. The way I envision this working is that targets would specify whether they support constrained FP intrinsics. If this
 flag is unset, it would cause the front end to do two things:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">1. Warn the user that the mode is not supported for the target<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">2. Ignore the option and not generate the constrained FP intrinsics<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">This should additionally be coupled with a temporary option for developers to use to aid in developing support for the intrinsics.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Something like:
<span style="font-family:"Courier New"">-ftrapping-math-on-unsupported-target </span>
and <span style="font-family:"Courier New"">-frounding-math-on-unsupported-target</span>.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Apr 16, 2020 at 4:19 PM Cameron McInally via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid windowtext 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<p class="MsoNormal">On Thu, Apr 16, 2020 at 4:01 PM Kevin Neal via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Bug 45329 “segfault with frounding-math” “<a href="https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.llvm.org%2Fshow_bug.cgi%3Fid%3D45329&data=02%7C01%7CKevin.Neal%40sas.com%7Cab254f4e50d7424ca62108d7e83b91d0%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637233214861132931&sdata=pcIeJcNeRtL0yyslM63lwyzf5Gfz%2B1oP8Lnytqv10G4%3D&reserved=0" target="_blank" rel="noreferrer">https://bugs.llvm.org/show_bug.cgi?id=45329</a>”
 highlights that we are silently allowing people to use options that are unimplemented or only partially implemented.<br>
><br>
> If use the -frounding-math option on a compile I expect it to work. I do not expect it to trigger an ICE, a crash, or much worse silently not work and produce wrong results.<br>
><br>
> I propose a warning be printed so that we can avoid issues like bug 45329 in the future. And it needs to be per-target since some targets are closer to supporting this feature than others.<br>
><br>
> Thoughts?<br>
<br>
Thanks for bringing this up, Kevin.<br>
<br>
We have a customer code that has been using<br>
`-fno-unsafe-math-optimizations` for some time. That option implies<br>
`-ftrapping-math`, which was a no-op until a few months ago. Now,<br>
`-ftrapping-math` enables the constrained FP intrinsics, which aren't<br>
fully supported on all targets. That behavior change looked like a<br>
regression to the customer.<br>
<br>
A warning would be a good short-term solution.<br>
<br>
-Cameron<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a><br>
<a href="https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fcfe-dev&data=02%7C01%7CKevin.Neal%40sas.com%7Cab254f4e50d7424ca62108d7e83b91d0%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637233214861142923&sdata=kiBmCzsmtQmiw%2BlqezNJrXV6BWfi1JaUN9eA3%2FcPkG8%3D&reserved=0" target="_blank" rel="noreferrer">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>

</blockquote></div></div></div>