[PATCH] D124096: [RISCV] Use default promotion for (i32 (shl 1, X)) on RV64 when Zbs is enabled.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 08:54:58 PDT 2022


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

This improves opportunities to use bset/bclr/binv. Unfortunately,
there are no W versions of these instrcutions so this isn't always
a clear win. If we use SLLW we get free sign extend and shift masking,
but need to put a 1 in a register and can't remove an or/xor. If
we use bset/bclr/binv we remove the immediate materializationg and
logic op, but might need a mask on the shift amount and sext.w.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124096

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rv64zbs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124096.423927.patch
Type: text/x-patch
Size: 4405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220420/d816dfed/attachment.bin>


More information about the llvm-commits mailing list