[PATCH] D119171: [SelectionDAG][RISCV][ARM][PowerPC][X86][WebAssembly] Change default abs expansion to use sra (X, size(X)-1); sub (xor (X, Y), Y).

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 09:48:52 PST 2022


craig.topper added a comment.

I looked into improving ARM's abs matching. If I make ISD::ABS legal, then we change tests for nabs patterns. Those currently get expanded to "sra (X, size(X)-1); sub (Y, xor (X, Y))" through a generic DAG combine. If abs is legal that doesn't happen. Instead we'll have "(neg (abs X))". That will get expanded to the ABS or t2ABS pseudo instruction followed by a negation. Perhaps it would be better to have a NABS pseudo that expands to a different branch condition than the ABS pseudo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119171



More information about the llvm-commits mailing list