[PATCH] D140319: [RISCV] Match neg (and x, 1) to two shifts to improve codesize

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 10:27:12 PST 2022


reames added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1244
+// is never compressible since rs1 and rd can't be the same register.
+let Predicates = [IsRV64, HasStdExtC] in {
+def : Pat<(XLenVT (sub 0x0, (and_oneuse GPR:$rs, 0x1))),
----------------
This shouldn't be specific to RV64, but my attempts to write a pattern which used ImmSubFromVLen kept failing type inference.  Any suggestions on how to write such a pattern?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140319



More information about the llvm-commits mailing list