[PATCH] D99029: [RISCV] Don't form MULW for (sext_inreg (mul X, Y), i32)) if the mul has another use.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 20 18:11:15 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: asb, jrtc27, luismarques.
Herald added subscribers: StephenFan, vkmr, frasercrmck, evandro, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, 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.

If this pattern doesn't fully remove the mul we'll end up with
a MUL and MULW with the same inputs.

On the assumption that multipliers are a limited resource and have
higher latency than an add, it is likely better to use a single MUL
and a sext.w instruction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99029

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoM.td
  llvm/test/CodeGen/RISCV/xaluo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99029.332138.patch
Type: text/x-patch
Size: 6398 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210321/6e834091/attachment.bin>


More information about the llvm-commits mailing list