As we have discussed previously (e.g. in D63992 / D64090 / [[ https://bugs.llvm.org/show_bug.cgi?id=42457 | PR42457 ]]), `sub` instruction
can almost be considered non-canonical. While we do convert `sub %x, C` -> `add %x, -C`,
we sparsely do that for non-constants. But we should.
Here, i propose to interpret `sub %x, %y` as `add (sub 0, %y), %x` IFF the negation can be sinked into the `%y`
My main motivation here is the `@t7`, which is from [[ https://bugs.llvm.org/show_bug.cgi?id=42412 | PR42412 ]] / [[ https://bugs.llvm.org/show_bug.cgi?id=42389 | PR42389 ]].
We know that `neg` is free if:
* We are negating an integral constant - https://rise4fun.com/Alive/6ploz
* The instruction in question has no users other than the negation itself. The rest of reasoning is recursive.
* It's a `select` - both hands must be negatible - https://rise4fun.com/Alive/MYge
* It's a `shl` - first operand must be negatible - https://rise4fun.com/Alive/7kA
* It's a `sub` - just swap the operands - https://rise4fun.com/Alive/eyI
* It's a `add` - both operands must be negatible - https://rise4fun.com/Alive/ou7
* It's a `mul` - either one of operands must be negatible - https://rise4fun.com/Alive/4tR
* (FIXME: there are likely more cases?)