[PATCH] D134621: [RISCV][WIP] Teach SExtWRemoval to recognize sign extended values that come from arguments.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 09:28:35 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVSExtWRemoval.cpp:9
 //
 // This pass removes unneeded sext.w instructions at the MI level.
 //
----------------
craig.topper wrote:
> arsenm wrote:
> > It feels wrong to me that you would need to optimize these after selection but I guess I don't know why you are seeing these
> Some of them are from SelectionDAG's depth limit in simplifyDemandedBits/computeKnownBits/computeNumSignBits. Some of them are because this handles phi loops and SelectionDAG doesn't. Not sure if there are other reasons.
This pass also converts some instructions to their W forms if it would remove a sext.w later. SelectionDAG doesn't do that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134621



More information about the llvm-commits mailing list