[PATCH] D108939: [RISCVISelLowering] avoid emitting libcalls to __mulodi4() and __multi3()

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 12:53:34 PDT 2021


nickdesaulniers created this revision.
nickdesaulniers added reviewers: craig.topper, rengolin.
Herald added subscribers: vkmr, frasercrmck, evandro, luismarques, 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, asb, hiraditya.
nickdesaulniers requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Similar to D108842 <https://reviews.llvm.org/D108842>, D108844 <https://reviews.llvm.org/D108844>, D108926 <https://reviews.llvm.org/D108926>, D108928 <https://reviews.llvm.org/D108928>, and D108936 <https://reviews.llvm.org/D108936>.

__has_builtin(builtin_mul_overflow) returns true for 32b RISCV targets,
but Clang is deferring to compiler RT when encountering long long types.

If the semantics of __has_builtin mean "the compiler resolves these,
always" then we shouldn't conditionally emit a libcall.

Link: https://bugs.llvm.org/show_bug.cgi?id=28629


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108939

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/mul.ll
  llvm/test/CodeGen/RISCV/overflow-intrinsic-optimizations.ll
  llvm/test/CodeGen/RISCV/umulo-128-legalisation-lowering.ll
  llvm/test/CodeGen/RISCV/xaluo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108939.369525.patch
Type: text/x-patch
Size: 53357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210830/85bc45d4/attachment.bin>


More information about the llvm-commits mailing list