Similar to what we do for add/sub/mul.
This can help remove some sext.w. There are some regressions on
some bswap tests, but I have an idea how to fix that for a follow up.
A new PACKW pattern is added to handle the new sext_inreg placement.
Paths
| Differential D108663
[RISCV] Insert a sext_inreg when type legalizing i32 shl by constant on RV64. ClosedPublic Authored by craig.topper on Aug 24 2021, 2:17 PM.
Details Summary Similar to what we do for add/sub/mul. This can help remove some sext.w. There are some regressions on A new PACKW pattern is added to handle the new sext_inreg placement.
Diff Detail
Event TimelineHerald added subscribers: StephenFan, vkmr, apazos and 21 others. · View Herald TranscriptAug 24 2021, 2:17 PM
Comment Actions I've posted D108738 to make bitreverse expansion more efficient out of the box. That should prevent the regressions here. This revision is now accepted and ready to land.Aug 26 2021, 9:57 AM This revision was landed with ongoing or failed builds.Aug 26 2021, 10:20 AM Closed by commit rG1b9417454eda: [RISCV] Insert a sext_inreg when type legalizing i32 shl by constant on RV64. (authored by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 368923 llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/alu32.ll
llvm/test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll
llvm/test/CodeGen/RISCV/copysign-casts.ll
llvm/test/CodeGen/RISCV/mul.ll
llvm/test/CodeGen/RISCV/rv64i-exhaustive-w-insts.ll
llvm/test/CodeGen/RISCV/rv64zbb-zbp.ll
llvm/test/CodeGen/RISCV/rv64zbb.ll
llvm/test/CodeGen/RISCV/rv64zbp.ll
|
Does this pattern still get generated? If so it's a shame one isn't canonicalised to the other :(