[llvm] [RISCV] Add CompressPat for all cases in isCopyInstrImpl (PR #136875)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 23 13:46:13 PDT 2025
preames wrote:
I'm mildly of the opinion that we should canonicalize the copy instead. Not a strongly held opinion or anything.
Maybe instead of a specific canonicalizeCopyInst, we could introduce a generic optimizeInstruction which is called after mutation? It could canonicalize the copy, but could also e.g. fold a sh2add x2, x1, x0 to slli x2, x1, 2.
Alternatively, if we wanted something localized, we could extend the late optimization pass we just added for branches to handle non-branch instructions.
https://github.com/llvm/llvm-project/pull/136875
More information about the llvm-commits
mailing list