diff options
author | Sanjay Patel <spatel@rotateright.com> | 2021-06-23 10:11:13 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2021-06-23 10:41:39 -0400 |
commit | 1e9b6b89a7b5c49612018b120c2c142106056f82 (patch) | |
tree | 156bc969a326a8345affd126693b9624f0759226 /llvm/lib/Demangle/RustDemangle.cpp | |
parent | 5dfdc1812d9b9c043204d39318f6446424d8f2d7 (diff) | |
download | llvm-1e9b6b89a7b5c49612018b120c2c142106056f82.zip llvm-1e9b6b89a7b5c49612018b120c2c142106056f82.tar.gz llvm-1e9b6b89a7b5c49612018b120c2c142106056f82.tar.bz2 |
[InstCombine] convert FP min/max with negated op to fabs
This is part of improving floating-point patterns seen in:
https://llvm.org/PR39480
We don't require any FMF because the 2 potential corner cases
(-0.0 and NaN) are correctly handled without FMF:
1. -0.0 is treated as strictly less than +0.0 with
maximum/minimum, so fabs/fneg work as expected.
2. +/- 0.0 with maxnum/minnum is indeterminate, so
transforming to fabs/fneg is more defined.
3. The sign of a NaN may be altered by this transform,
but that is allowed in the default FP environment.
If there are FMF, they are propagated from the min/max call to
one or both new operands which seems to agree with Alive2:
https://alive2.llvm.org/ce/z/bem_xC
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
0 files changed, 0 insertions, 0 deletions