llvm
33ca7a46 - [LICM] Reassociate add/sub expressions to hoist invariant computations (#183082)

Commit
1 day ago
[LICM] Reassociate add/sub expressions to hoist invariant computations (#183082) While `sub` is not associative, we can still reassociate `add` and `sub`. ## Alive2 proofs | Case | Transform | Proof | |------|-----------|-------| | 1 | `(x + c1) - c2` => `x + (c1 - c2)` | [proof](https://alive2.llvm.org/ce/z/iofzYy) | | 2 | `(x - c1) - c2` => `x - (c1 + c2)` | [proof](https://alive2.llvm.org/ce/z/U4K_tE) | | 3 | `(x - c1) + c2` => `x + (c2 - c1)` | [proof](https://alive2.llvm.org/ce/z/moiJVw) |
Parents
Loading