[llvm] [CSKY] Don't emit `__multi3` on 32-bit CSKY (PR #69732)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 07:59:55 PDT 2023


https://github.com/Dirreke created https://github.com/llvm/llvm-project/pull/69732

Fix #68971
According to #21245 , disable `__multi3` and other buitin functions which are not available in 32-bit target.

>From c2f3e3a0305fa45e2e8b8d1572ab6c5bc910374d Mon Sep 17 00:00:00 2001
From: Dirreck <mingyang_ge at 163.com>
Date: Fri, 20 Oct 2023 22:58:13 +0800
Subject: [PATCH] disable `_multi3` for 32-bit target

---
 llvm/lib/Target/CSKY/CSKYISelLowering.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
index e3b4a2dc048ab20..9cb7bd7058f9749 100644
--- a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
+++ b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
@@ -109,6 +109,14 @@ CSKYTargetLowering::CSKYTargetLowering(const TargetMachine &TM,
 
   setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Expand);
 
+  // These libcalls are not available in 32-bit.
+  setLibcallName(RTLIB::SHL_I128, nullptr);
+  setLibcallName(RTLIB::SRL_I128, nullptr);
+  setLibcallName(RTLIB::SRA_I128, nullptr);
+  setLibcallName(RTLIB::MUL_I128, nullptr);
+  setLibcallName(RTLIB::MULO_I64, nullptr);
+  setLibcallName(RTLIB::MULO_I128, nullptr);
+      
   // Float
 
   ISD::CondCode FPCCToExtend[] = {



More information about the llvm-commits mailing list