Patch adds eight new GICombineRules for G_FMUL:
- G_FMUL(x, 0.0) -> 0.0
- G_FMUL(x, 1.0) -> x
- G_FMUL(x, -1.0) -> G_FSUB(0.0, x)
- G_FMUL(G_FNEG(x), G_FNEG(y)) -> G_FMUL(x, y)
- G_FMUL(G_FMUL(x, c0), c1) -> G_FMUL(x, c0 * c1) (unsafe fp math only)
- G_FMUL(G_FADD(x, x), c) -> G_FMUL(x, c * 2.0) (unsafe fp math only)
- G_FMUL(x, G_SELECT(G_FCMP(x > 0.0), -1.0, 1.0) -> G_FNEG(G_FABS(x))
- G_FMUL(x, G_SELECT(G_FCMP(x > 0.0), 1.0, -1.0)) -> G_FABS(x)
Patch additionally adds new combine tests for AArch64 target for these new rules, as well as updating AMDGPU GISel tests.
I think this should be "G_FSUB(-0.0, x)".