Skip to content

Commit aac603c

Browse files
authored
ARM: Avoid repeating hardcoded windows division libcall names (#143834)
This is properly set in the runtime libcall info, so query the name.
1 parent 633375a commit aac603c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9998,13 +9998,13 @@ SDValue ARMTargetLowering::LowerWindowsDIVLibCall(SDValue Op, SelectionDAG &DAG,
99989998
SDLoc dl(Op);
99999999

1000010000
const auto &DL = DAG.getDataLayout();
10001-
10002-
const char *Name = nullptr;
10001+
RTLIB::Libcall LC;
1000310002
if (Signed)
10004-
Name = (VT == MVT::i32) ? "__rt_sdiv" : "__rt_sdiv64";
10003+
LC = VT == MVT::i32 ? RTLIB::SDIVREM_I32 : RTLIB::SDIVREM_I64;
1000510004
else
10006-
Name = (VT == MVT::i32) ? "__rt_udiv" : "__rt_udiv64";
10005+
LC = VT == MVT::i32 ? RTLIB::UDIVREM_I32 : RTLIB::UDIVREM_I64;
1000710006

10007+
const char *Name = getLibcallName(LC);
1000810008
SDValue ES = DAG.getExternalSymbol(Name, getPointerTy(DL));
1000910009

1001010010
ARMTargetLowering::ArgListTy Args;

0 commit comments

Comments
 (0)