[PATCH] Add support for fast-math flags to the FCmp instruction.

James Molloy james at jamesmolloy.co.uk
Sat May 16 05:55:15 PDT 2015


Hi David,

Good point. But I'm not sure how that's different for fcmp than for all the
other fast-math operations. For example:

  %1 = fdiv double 1.0, %a
  %2 = fdiv arcp double 1.0, %1

Is this allowed to be converted to %a?

I think I'd say that yes, those are allowed. I'm struggling to come up with
a formal statement of why. I suppose the problem is where you have a more
relaxed operation using a less relaxed one, do you allow that relaxation to
"infect" the arguments?

Cheers,

James

On Fri, 15 May 2015 at 21:55 David Majnemer <david.majnemer at gmail.com>
wrote:

> REPOSITORY
>   rL LLVM
>
> ================
> Comment at: docs/LangRef.rst:6945-6948
> @@ -6944,2 +6944,6 @@
>
> +The ``fcmp`` instruction can also optionally take any number of
> +:ref:`fast-math flags <fastmath>`, which are optimization hints to enable
> +otherwise unsafe floating point optimizations.
> +
>  Example:
> ----------------
> We really need to say more here about the semantics of fast math flags in
> this position.
>
> For example, does `arcp` on an fcmp imply that i can take:
>   %div = fdiv double 1.000000e+00, %a
>   %div1 = fdiv double 1.000000e+00, %b
>   %cmp = fcmp arcp olt double %div, %div1
>
> and replace it with:
>   %cmp = fcmp ogt double %a, %b
>
> ?
>
> http://reviews.llvm.org/D9793
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150516/f4f323d6/attachment.html>


More information about the llvm-commits mailing list