[llvm] [InstCombine] Fold `fcmp (fmul X, C1), C2` to `fcmp X, C2/C1` (PR #205003)
Nikita Terentev via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 01:45:37 PDT 2026
Seraphimt wrote:
Hi @VachanVY ! When I tryed to impl this transformation, I consider table possible cases for C1, C2, x, op and with it's help try to check limits of validity the transformation. Example:
```
C1 * x op C2 => x op C3
For C1 = 0, x != inf, x!=Nan, C2 = 0 and op = ordEq :
0 * x ordEq 0 == true
But x ordEq 0 / 0 == false
```
Implies, if we know that x maybe (not inf, not Nan) value and C1, C2 = +-0 then transform invalid.
I intended to enable this transform for correct cases only but I overwhelmed by number of cases and postponed due to lack of time.
I hope this helps you in some way.
https://github.com/llvm/llvm-project/pull/205003
More information about the llvm-commits
mailing list