[llvm] [AArch64] Transform add(x, abs(y)) -> saba(x, y, 0) (PR #156615)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 05:34:11 PDT 2025
davemgreen wrote:
We generate the instructions directly in some of the raddhn patterns
```
def : Pat<(v8i8 (trunc (AArch64vlshr (add (v8i16 V128:$Vn), VImm0080), (i32 8)))),
(RADDHNv8i16_v8i8 V128:$Vn, (v8i16 (MOVIv2d_ns (i32 0))))>;
```
Generating two instructions in a pattern has it's down sides, so they both have advantages and disadvantages, but it is likely a little better than a new AArch64ISD node that isn't otherwise optimized.
https://github.com/llvm/llvm-project/pull/156615
More information about the llvm-commits
mailing list