[PATCH] D46322: [SelectionDAG] propagate 'afn' and 'reassoc' from IR fast-math-flags

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 06:34:51 PDT 2018


spatel abandoned this revision.
spatel added a comment.

In https://reviews.llvm.org/D46322#1086104, @wristow wrote:

> In practice, with the Clang front-end, this flag does mean more than just the 'reassoc' flag.  In particular with Clang, '-enable-unsafe-fp-math' is specified on the cc1 command-line when the following user-level switches are specified:
>
>   -fno-math-errno -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math
>   
>
> 'reassoc' in IR can be true when (for example) allow-reciprocal ('arcp') is false.  So (again, with the Clang front-end), the following command (which does not pass '-enable-unsafe-fp-math'):
>
>   -fno-math-errno -fassociative-math -fno-signed-zeros -fno-trapping-math
>   
>
> will set 'reassoc'.


Good point. I see this as even more reason to break up the steps of propagating/using the flags in the DAG and MI as much as possible and add tests along the way, so we have a better understanding of exactly what FMF semantics are in play. IOW, reduce the risk that we'll introduce mistakes as we update the plumbing.


https://reviews.llvm.org/D46322





More information about the llvm-commits mailing list