[PATCH] D99317: [RISCV] Add RISCVISD opcodes for CLZW and CTZW.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 22:46:51 PDT 2021


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

Our CLZW isel pattern is quite easily broken by surrounding code
preventing it from matching sometimes. This usually results in
failing to remove the and X, 0xffffffff inserted by type
legalization. The add with -32 that type legalization also inserts
often get combined into other add/sub nodes so that doesn't
usually result in extra code when we don't use clzw.

CTTZ is seems to less fragile, but I wanted to keep it consistent
with CTLZ.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99317

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/lib/Target/RISCV/RISCVInstrInfoB.td
  llvm/test/CodeGen/RISCV/rv64zbb.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99317.333211.patch
Type: text/x-patch
Size: 8669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210325/98d67144/attachment.bin>


More information about the llvm-commits mailing list