[llvm] e7375e9 - [AIX] Remove whitelist checking for ExternalSymbolSDNodes
Xiangling Liao via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 26 07:10:43 PST 2020
Author: Xiangling Liao
Date: 2020-02-26T10:09:25-05:00
New Revision: e7375e993248ff39e664caeea9b8a0c8b0e489b5
URL: https://github.com/llvm/llvm-project/commit/e7375e993248ff39e664caeea9b8a0c8b0e489b5
DIFF: https://github.com/llvm/llvm-project/commit/e7375e993248ff39e664caeea9b8a0c8b0e489b5.diff
LOG: [AIX] Remove whitelist checking for ExternalSymbolSDNodes
Allow all ExternalSymbolSDNode on AIX, and rely on the linker error to find
symbols which we don't have definitions from any library/compiler-rt.
Differential Revision: https://reviews.llvm.org/D75075
Added:
Modified:
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/aix-external-sym-sdnode-lowering.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 9757c1f85c20..3615f0cf2b81 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -5072,14 +5072,6 @@ static unsigned getCallOpcode(PPCTargetLowering::CallFlags CFlags,
return PPCISD::CALL;
}
-static bool isValidAIXExternalSymSDNode(StringRef SymName) {
- return StringSwitch<bool>(SymName)
- .Cases("__divdi3", "__fixunsdfdi", "__floatundidf", "__floatundisf",
- "__moddi3", "__udivdi3", "__umoddi3", true)
- .Cases("ceil", "floor", "memcpy", "memmove", "memset", "round", true)
- .Default(false);
-}
-
static SDValue transformCallee(const SDValue &Callee, SelectionDAG &DAG,
const SDLoc &dl, const PPCSubtarget &Subtarget) {
if (!Subtarget.usesFunctionDescriptors() && !Subtarget.isELFv2ABI())
@@ -5163,12 +5155,7 @@ static SDValue transformCallee(const SDValue &Callee, SelectionDAG &DAG,
SC);
}
- // TODO: Remove this when the support for ExternalSymbolSDNode is complete.
- if (isValidAIXExternalSymSDNode(SymName)) {
- return getAIXFuncEntryPointSymbolSDNode(SymName, true, XCOFF::C_EXT);
- }
-
- report_fatal_error("Unexpected ExternalSymbolSDNode: " + Twine(SymName));
+ return getAIXFuncEntryPointSymbolSDNode(SymName, true, XCOFF::C_EXT);
}
// No transformation needed.
diff --git a/llvm/test/CodeGen/PowerPC/aix-external-sym-sdnode-lowering.ll b/llvm/test/CodeGen/PowerPC/aix-external-sym-sdnode-lowering.ll
index f5864df4ff95..a4957a514e09 100644
--- a/llvm/test/CodeGen/PowerPC/aix-external-sym-sdnode-lowering.ll
+++ b/llvm/test/CodeGen/PowerPC/aix-external-sym-sdnode-lowering.ll
@@ -6,61 +6,6 @@
; RUN: -stop-after=machine-cp < %s | FileCheck \
; RUN: --check-prefix=64BIT %s
-define i64 @call_divdi3(i64 %p, i64 %num) {
-entry:
- %div = sdiv i64 %p, %num
- ret i64 %div
-}
-
-; 32BIT: BL_NOP <mcsymbol .__divdi3>
-
-define i64 @call_fixunsdfdi(double %p) {
-entry:
- %conv = fptoui double %p to i64
- ret i64 %conv
-}
-
-; 32BIT: BL_NOP <mcsymbol .__fixunsdfdi>
-
-define double @call_floatundidf(i64 %p) {
-entry:
- %conv = uitofp i64 %p to double
- ret double %conv
-}
-
-; 32BIT: BL_NOP <mcsymbol .__floatundidf>
-
-define float @call_floatundisf(i64 %p) {
-entry:
- %conv = uitofp i64 %p to float
- ret float %conv
-}
-
-; 32BIT: BL_NOP <mcsymbol .__floatundisf>
-
-define i64 @call_moddi3(i64 %p, i64 %num) {
-entry:
- %rem = srem i64 %p, %num
- ret i64 %rem
-}
-
-; 32BIT: BL_NOP <mcsymbol .__moddi3>
-
-define i64 @call_udivdi3(i64 %p, i64 %q) {
- %1 = udiv i64 %p, %q
- ret i64 %1
-}
-
-; 32BIT: BL_NOP <mcsymbol .__udivdi3>
-
-define i64 @call_umoddi3(i64 %p, i64 %num) {
-entry:
- %rem = urem i64 %p, %num
- ret i64 %rem
-}
-
-; 32BIT: BL_NOP <mcsymbol .__umoddi3>
-
define double @call_ceil(double %n) {
entry:
%0 = call double @llvm.ceil.f64(double %n)
@@ -71,58 +16,3 @@ declare double @llvm.ceil.f64(double)
; 32BIT: BL_NOP <mcsymbol .ceil>
; 64BIT: BL8_NOP <mcsymbol .ceil>
-
-define double @call_floor(double %n) {
-entry:
- %0 = call double @llvm.floor.f64(double %n)
- ret double %0
-}
-
-declare double @llvm.floor.f64(double)
-
-; 32BIT: BL_NOP <mcsymbol .floor>
-; 64BIT: BL8_NOP <mcsymbol .floor>
-
-define void @call_memcpy(i8* %p, i8* %q, i32 %n) {
-entry:
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false)
- ret void
-}
-
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1)
-
-; 32BIT: BL_NOP <mcsymbol .memcpy>
-; 64BIT: BL8_NOP <mcsymbol .memcpy>
-
-define void @call_memmove(i8* %p, i8* %q, i32 %n) {
-entry:
- call void @llvm.memmove.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false)
- ret void
-}
-
-declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1)
-
-; 32BIT: BL_NOP <mcsymbol .memmove>
-; 64BIT: BL8_NOP <mcsymbol .memmove>
-
-define void @call_memset(i8* %p, i8 %q, i32 %n) #0 {
-entry:
- call void @llvm.memset.p0i8.i32(i8* %p, i8 %q, i32 %n, i1 false)
- ret void
-}
-
-declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i1)
-
-; 32BIT: BL_NOP <mcsymbol .memset>
-; 64BIT: BL8_NOP <mcsymbol .memset>
-
-define double @call_round(double %n) {
-entry:
- %0 = call double @llvm.round.f64(double %n)
- ret double %0
-}
-
-declare double @llvm.round.f64(double)
-
-; 32BIT: BL_NOP <mcsymbol .round>
-; 64BIT: BL8_NOP <mcsymbol .round>
More information about the llvm-commits
mailing list