[llvm] [LoongArch] Disable mulodi4 and muloti4 libcalls (PR #73199)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 19:00:28 PST 2023


https://github.com/heiher created https://github.com/llvm/llvm-project/pull/73199

This library function only exists in compiler-rt not libgcc. So this would fail to link unless we were linking with compiler-rt.

Fixes https://github.com/ClangBuiltLinux/linux/issues/1958

>From 7b94e7efbca9a961af12ea3ea1f2842067e85b47 Mon Sep 17 00:00:00 2001
From: WANG Rui <wangrui at loongson.cn>
Date: Thu, 23 Nov 2023 10:40:53 +0800
Subject: [PATCH] [LoongArch] Disable mulodi4 and muloti4 libcalls

This library function only exists in compiler-rt not libgcc. So
this would fail to link unless we were linking with compiler-rt.

Fixes https://github.com/ClangBuiltLinux/linux/issues/1958
---
 llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
index f3f72e74ef085a2..ac78789c2c331df 100644
--- a/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+++ b/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
@@ -152,8 +152,13 @@ LoongArchTargetLowering::LoongArchTargetLowering(const TargetMachine &TM,
 
     // Set libcalls.
     setLibcallName(RTLIB::MUL_I128, nullptr);
+    // The MULO libcall is not part of libgcc, only compiler-rt.
+    setLibcallName(RTLIB::MULO_I64, nullptr);
   }
 
+  // The MULO libcall is not part of libgcc, only compiler-rt.
+  setLibcallName(RTLIB::MULO_I128, nullptr);
+
   setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Custom);
 
   static const ISD::CondCode FPCCToExpand[] = {



More information about the llvm-commits mailing list