Commit 529e110
committed
Enable FDiv(x, x) = 1.0 for float redundant division
Uncomment the FDiv x/x rule that was disabled due to NaN/zero concerns.
The Rust optimizer already assumes fast-math for all float rules (FSub(x,x)=0
fires unconditionally), making this consistent with existing behavior.
Combined with the FNeg distribution rules (FDiv(FNeg(a),b) → FNeg(FDiv(a,b))
and FDiv(a,FNeg(b)) → FNeg(FDiv(a,b))), this also handles -x/x → -1.0 and
x/(-x) → -1.0, matching the C++ FoldRedundantDiv behavior.1 parent 725c6b1 commit 529e110
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
0 commit comments