Skip to content
Commit 970cb99e authored by Jessica Paquette's avatar Jessica Paquette
Browse files

[GlobalISel] Combine `(x + y) - y -> x` and friends

This adds a combine that handles

```
(x + y) - y -> x
(x + y) - x -> y
x - (y + x) -> 0 - y
x - (x + z) -> 0 - z
```

On AArch64, we get added benefit for `0 - y` because it can be selected to a
`neg` instruction.

Differential Revision: https://reviews.llvm.org/D135010
parent a2efc29e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment