[llvm] ARM: Avoid repeating hardcoded windows division libcall names (PR #143834)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 05:18:10 PDT 2025
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/143834
>From cd4ef8ace02f9338c58e87ee2ea98b20a9daeb65 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Thu, 12 Jun 2025 14:06:38 +0900
Subject: [PATCH] ARM: Avoid repeating hardcoded windows division libcall names
This is properly set in the runtime libcall info, so query
the name.
---
llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index f17eb72bb2e26..5b3664c4e961f 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -9998,13 +9998,13 @@ SDValue ARMTargetLowering::LowerWindowsDIVLibCall(SDValue Op, SelectionDAG &DAG,
SDLoc dl(Op);
const auto &DL = DAG.getDataLayout();
-
- const char *Name = nullptr;
+ RTLIB::Libcall LC;
if (Signed)
- Name = (VT == MVT::i32) ? "__rt_sdiv" : "__rt_sdiv64";
+ LC = VT == MVT::i32 ? RTLIB::SDIVREM_I32 : RTLIB::SDIVREM_I64;
else
- Name = (VT == MVT::i32) ? "__rt_udiv" : "__rt_udiv64";
+ LC = VT == MVT::i32 ? RTLIB::UDIVREM_I32 : RTLIB::UDIVREM_I64;
+ const char *Name = getLibcallName(LC);
SDValue ES = DAG.getExternalSymbol(Name, getPointerTy(DL));
ARMTargetLowering::ArgListTy Args;
More information about the llvm-commits
mailing list