[PATCH] D116720: [RISCV] Use shift for zext.h when Zbb and Zbp are not enabled

Haocong Lu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 19:42:01 PST 2022


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

Now AND is used for zero extension when Zbb and Zbp are both not enabled.
It's better to use shift operation if mask exceeds simm12.

This  patch optimzes LUI + ADDI + AND to SLLI + SRLI when mask is 0xffff.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116720

Files:
  llvm/lib/Target/RISCV/RISCV.td
  llvm/lib/Target/RISCV/RISCVInstrInfo.td
  llvm/test/CodeGen/RISCV/alu16.ll
  llvm/test/CodeGen/RISCV/atomic-rmw.ll
  llvm/test/CodeGen/RISCV/atomic-signext.ll
  llvm/test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll
  llvm/test/CodeGen/RISCV/calling-conv-half.ll
  llvm/test/CodeGen/RISCV/calling-conv-ilp32-ilp32f-ilp32d-common.ll
  llvm/test/CodeGen/RISCV/calling-conv-lp64-lp64f-lp64d-common.ll
  llvm/test/CodeGen/RISCV/div.ll
  llvm/test/CodeGen/RISCV/half-arith.ll
  llvm/test/CodeGen/RISCV/half-convert-strict.ll
  llvm/test/CodeGen/RISCV/half-convert.ll
  llvm/test/CodeGen/RISCV/half-intrinsics.ll
  llvm/test/CodeGen/RISCV/rem.ll
  llvm/test/CodeGen/RISCV/rv32zbb.ll
  llvm/test/CodeGen/RISCV/rv32zbp.ll
  llvm/test/CodeGen/RISCV/rv64zbb.ll
  llvm/test/CodeGen/RISCV/rv64zbp.ll
  llvm/test/CodeGen/RISCV/rv64zfh-half-convert.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vreductions-int-vp.ll
  llvm/test/CodeGen/RISCV/sext-zext-trunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116720.397771.patch
Type: text/x-patch
Size: 69737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220106/620f841f/attachment.bin>


More information about the llvm-commits mailing list