<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On May 15, 2015, at 9:58 AM, James Molloy <<a href="mailto:james@jamesmolloy.co.uk" class="">james@jamesmolloy.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Michael,<br class=""><br class=""><div class="">Primarily, I'm upgrading InstCombine to recognize patterns for min and max better. Part of that is adding matching for floating point min and max.</div><div class=""><br class=""></div><div class="">The fcmp/select pattern isn't exactly equivalent to a FMINNUM/FMAXNUM operation in several cases involving NaNs and signed zeroes. There is currently logic in the backends to match these late - I'm trying to move it all to one place.</div><div class=""><br class=""></div><div class="">I can query the function, but that's really lame.</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>Oh, of course. I was imagining querying each operand to the fcmp to see if it is e.g. known non-NaN (it itself is flagged nnan), but I can see having the flag directly on the fcmp being convenient. LGTM.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Cheers,</div><div class=""><br class=""></div><div class="">James</div></div><br class=""><div class="gmail_quote">On Fri, 15 May 2015 at 17:54 Michael Ilseman <<a href="mailto:milseman@apple.com" class="">milseman@apple.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What are you hoping to accomplish with the information from the flags? When I looked into this way back when, it wasn’t quite compelling, but I’m sure I missed a lot of the cases you’re seeing.<br class="">
<br class="">
> On May 15, 2015, at 6:58 AM, James Molloy <<a href="mailto:james.molloy@arm.com" target="_blank" class="">james.molloy@arm.com</a>> wrote:<br class="">
><br class="">
> Hi hfinkel, majnemer, chandlerc,<br class="">
><br class="">
> FCmp behaves a lot like a floating-point binary operator in many ways,<br class="">
> and can benefit from fast-math information. Flags such as nsz and nnan<br class="">
> can affect if this fcmp (in combination with a select) can be treated<br class="">
> as a fminnum/fmaxnum operation.<br class="">
><br class="">
> This adds backwards-compatible bitcode support, IR parsing and writing,<br class="">
> LangRef changes and IRBuilder changes. I'll need to audit InstSimplify<br class="">
> and InstCombine in a followup to find places where flags should be<br class="">
> copied.<br class="">
><br class="">
> REPOSITORY<br class="">
>  rL LLVM<br class="">
><br class="">
> <a href="http://reviews.llvm.org/D9793" target="_blank" class="">http://reviews.llvm.org/D9793</a><br class="">
><br class="">
> Files:<br class="">
>  docs/LangRef.rst<br class="">
>  include/llvm/IR/IRBuilder.h<br class="">
>  include/llvm/IR/Operator.h<br class="">
>  lib/AsmParser/LLParser.cpp<br class="">
>  lib/Bitcode/Reader/BitcodeReader.cpp<br class="">
>  lib/Bitcode/Writer/BitcodeWriter.cpp<br class="">
>  test/Bitcode/fcmp-fast.ll<br class="">
>  unittests/IR/IRBuilderTest.cpp<br class="">
><br class="">
> EMAIL PREFERENCES<br class="">
>  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank" class="">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br class="">
> <D9793.25866.patch>_______________________________________________<br class="">
> llvm-commits mailing list<br class="">
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="">llvm-commits@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>