[PATCH] D118160: [RISCV] Implement a basic version of AArch64RedundantCopyElimination pass.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 4 09:44:14 PST 2022


craig.topper added a comment.

In D118160#3292913 <https://reviews.llvm.org/D118160#3292913>, @asb wrote:

> LGTM. It feels like this could perhaps be made target-independent with some additional hooks - a companion to or modification to isConstantPhysReg that indicates what the constant value is, and using analyzeBranchPredicate. Though extending it in some of the ways suggested in the TODOs would be more difficult, and as the pass itself as quite simple, the code added in terms of target hooks / interface modifications could quickly become larger than the pass itself.

I might look at this in the future. I started with the simpler version AArch64 started with so I didn't look as much at its current version which handles multiple branches, and constants. As noted in the TODOs, constants for RISCV will be harder. If the constant doesn't fit in an ADDI we might get luck and they'll be CSEd together. Then we would just need to check for register equality/inequality.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118160



More information about the llvm-commits mailing list