llvm-project
8cc0cd82 - [SLP] Support FAdd/FSub as interchangeable instructions

Commit
20 hours ago
[SLP] Support FAdd/FSub as interchangeable instructions fadd(x, c) and fsub(x, c) are interchangeable via fadd(x, -c), so treat them like the existing Add/Sub/Mul/Shl/AShr/And/Or/Xor interchange in BinOpSameOpcodeHelper. This lets a mixed fadd/fsub bundle vectorize as a single op instead of needing an alt-shuffle/split node. Restrict the interchange to a constant RHS. A constant LHS (e.g. "0.0 - x") cannot be moved to the other opcode without also swapping the variable operand, which would misalign it against lanes that keep their native opcode and produce a node too expensive to vectorize. Reviewers: hiraditya, bababuck, RKSimon Pull Request: https://github.com/llvm/llvm-project/pull/208002
Author
Parents
Loading