llvm-project
c22364a4 - [AArch64] Eliminate Common SUBS by Reassociating Non-Constants (#123344)

Commit
1 year ago
[AArch64] Eliminate Common SUBS by Reassociating Non-Constants (#123344) Commit 1eed46960c217f9480865702f06fb730c7521e61 added logic to reassociate a (add (add x y) -c) operand to a CSEL instruction with a comparison involving x and c (or a similar constant) in order to obtain a common (SUBS x c) instruction. This commit extends this logic to non-constants. In this way, we also reassociate a (sub (add x y) z) operand of a CSEL instruction to (add (sub x z) y) if the CSEL compares x and z, for example. Alive proof: https://alive2.llvm.org/ce/z/SEVpR
Author
Parents
Loading