forked from OSchip/llvm-project
[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
This commit is contained in:
parent
41a6612ea8
commit
e7375e9932
|
@ -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.
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue