[PATCH] D129980: [RISCV] Optimize (seteq (i64 (and X, 0xffffffff)), C1)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 20:20:49 PDT 2022


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, reames.
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, shiva0217, kito-cheng, 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.

(and X, 0xffffffff) requires 2 shifts in the base ISA. Since we
know the result is being used by a compare, we can use a sext_inreg
instead of an AND if we also modify C1 <https://reviews.llvm.org/C1> to have 33 sign bits instead
of 32 leading zeros.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129980

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/i64-icmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129980.445380.patch
Type: text/x-patch
Size: 4714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220718/a114a435/attachment.bin>


More information about the llvm-commits mailing list