[PATCH] D50913: [FPEnv] Don't need copysign/fabs/fneg constrained intrinsics

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 09:15:31 PDT 2018


cameron.mcinally added a comment.

> If the fsub that led to the FNEG node was not constrained in the first place then this seems like a valid transform.

Bah, sorry. My comment was ambiguous...

I meant that the FNEG->FSUB xform is "bad" in the context Ulrich proposed. For example:

The user writes a unary minus, -x, which is a bitwise operation and will never trap. The frontend would then convert -x to an *unconstrained* -0-x. InstCombine catches this pattern and canonicalizes the -0-x to a FNEG. But, if the target expands the FNEG, it will be converted back into an FSUB, which is arithmetic and could trap. We don't want to introduce traps where none were originally intended.


Repository:
  rL LLVM

https://reviews.llvm.org/D50913





More information about the llvm-commits mailing list