Commit 485c176
committed
[DAGCombiner] Relax nsz constraint for more FP optimizations
Some floating-point optimization don't trigger because they can produce
incorrect results around signed zeros, and rely on the existence of the
nsz flag which commonly appears when fast-math is enabled.
However, this flag is not a hard requirement when all of the users of
the combined value are either guranteed to overwrite the sign-bit or
simply ignore it (comparisons, etc.).
The optimizations affected:
- fadd x, -0.0 -> x
- fsub x, 0.0 -> x
- fsub -0.0, x -> fneg x
- fdiv x, sqrt(x) -> sqrt(x)
- frem lowering with power-of-2 divisors1 parent 7f65dea commit 485c176
File tree
3 files changed
+86
-9
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen
- AArch64
- AMDGPU
3 files changed
+86
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17781 | 17781 | | |
17782 | 17782 | | |
17783 | 17783 | | |
17784 | | - | |
| 17784 | + | |
| 17785 | + | |
17785 | 17786 | | |
17786 | 17787 | | |
17787 | 17788 | | |
| |||
17993 | 17994 | | |
17994 | 17995 | | |
17995 | 17996 | | |
17996 | | - | |
| 17997 | + | |
| 17998 | + | |
17997 | 17999 | | |
17998 | 18000 | | |
17999 | 18001 | | |
| |||
18006 | 18008 | | |
18007 | 18009 | | |
18008 | 18010 | | |
18009 | | - | |
| 18011 | + | |
| 18012 | + | |
18010 | 18013 | | |
18011 | 18014 | | |
18012 | 18015 | | |
| |||
18654 | 18657 | | |
18655 | 18658 | | |
18656 | 18659 | | |
18657 | | - | |
| 18660 | + | |
| 18661 | + | |
| 18662 | + | |
18658 | 18663 | | |
18659 | 18664 | | |
18660 | 18665 | | |
| |||
18705 | 18710 | | |
18706 | 18711 | | |
18707 | 18712 | | |
18708 | | - | |
18709 | | - | |
| 18713 | + | |
| 18714 | + | |
| 18715 | + | |
18710 | 18716 | | |
18711 | 18717 | | |
18712 | 18718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| 36 | + | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
0 commit comments