Skip to content

Commit 446dd8e

Browse files
committed
inline isAEABIFunctionImpl
1 parent 86fdd93 commit 446dd8e

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,6 @@ bool ARMSelectionDAGInfo::isTargetMemoryOpcode(unsigned Opcode) const {
3535
Opcode <= ARMISD::LAST_MEMORY_OPCODE;
3636
}
3737

38-
static bool isAEABIFunctionImpl(const TargetLowering &TLI, RTLIB::Libcall LC) {
39-
switch (LC) {
40-
case RTLIB::MEMCPY:
41-
return TLI.getLibcallImpl(LC) == RTLIB::impl___aeabi_memcpy;
42-
case RTLIB::MEMMOVE:
43-
return TLI.getLibcallImpl(LC) == RTLIB::impl___aeabi_memmove;
44-
case RTLIB::MEMSET:
45-
return TLI.getLibcallImpl(LC) == RTLIB::impl___aeabi_memset;
46-
default:
47-
return false;
48-
}
49-
}
50-
5138
// Emit, if possible, a specialized version of the given Libcall. Typically this
5239
// means selecting the appropriately aligned version, but we also convert memset
5340
// of 0 into memclr.
@@ -60,9 +47,7 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall(
6047

6148
// Only use a specialized AEABI function if the default version of this
6249
// Libcall is an AEABI function.
63-
if (!isAEABIFunctionImpl(*TLI, LC))
64-
return SDValue();
65-
50+
//
6651
// Translate RTLIB::Libcall to AEABILibcall. We only do this in order to be
6752
// able to translate memset to memclr and use the value to index the function
6853
// name array.
@@ -74,12 +59,21 @@ SDValue ARMSelectionDAGInfo::EmitSpecializedLibcall(
7459
} AEABILibcall;
7560
switch (LC) {
7661
case RTLIB::MEMCPY:
62+
if (TLI->getLibcallImpl(LC) != RTLIB::impl___aeabi_memcpy)
63+
return SDValue();
64+
7765
AEABILibcall = AEABI_MEMCPY;
7866
break;
7967
case RTLIB::MEMMOVE:
68+
if (TLI->getLibcallImpl(LC) != RTLIB::impl___aeabi_memmove)
69+
return SDValue();
70+
8071
AEABILibcall = AEABI_MEMMOVE;
8172
break;
8273
case RTLIB::MEMSET:
74+
if (TLI->getLibcallImpl(LC) != RTLIB::impl___aeabi_memset)
75+
return SDValue();
76+
8377
AEABILibcall = AEABI_MEMSET;
8478
if (isNullConstant(Src))
8579
AEABILibcall = AEABI_MEMCLR;

0 commit comments

Comments
 (0)