[PATCH] D115739: [SVE][DAGCombiner] Enable ISD::ABDS and ISD::ABDU for SVE.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 05:40:07 PST 2022


dmgreen added a comment.

The, lets say, "standard" pattern for a uabd is `trunc(abs(sub(zext(a), zext(b))))`. We start the transform at the `abs` though, as it allows for more folding, and convert the whole thing to `trunc(zext(abd(a, b)))`, which is folded to plain `abd(a, b)`. Starting at the abd helps us fold more patterns, like those where (say) `vecreduce(abs(sub(zext(a), zext(b))))` can be folded to `vecreduce(zext(abd(a, b)))`, which becomes a `udot(abd(a, b))` on aarch64 (for example, with the right types).

I would suspect that you could include the `trunc` in the SVE tests, which would remove the need for the target independent parts of this patch, and it could test the legal types. (The existing ones might be good to keep around too if they would show inefficient codegen). And if you wanted to continue with the target indepedent part it could be done in a separate patch? Where it is probably worth adding some NEON AArch64 tests too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115739/new/

https://reviews.llvm.org/D115739



More information about the llvm-commits mailing list