Skip to content

RuntimeLibcalls: Avoid adding f80 calls to default set #147658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Jul 9, 2025

Starts adding a stub X86 configuration which doesn't attempt
the system specific pieces yet. This is mostly to have a point
to add back in the f80 calls so they can be removed from every
other target.

Copy link
Contributor Author

arsenm commented Jul 9, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2025

@llvm/pr-subscribers-llvm-ir
@llvm/pr-subscribers-llvm-selectiondag

@llvm/pr-subscribers-backend-hexagon

Author: Matt Arsenault (arsenm)

Changes

Starts adding a stub X86 configuration which doesn't attempt
the system specific pieces yet. This is mostly to have a point
to add back in the f80 calls so they can be removed from every
other target.


Full diff: https://github.com/llvm/llvm-project/pull/147658.diff

1 Files Affected:

  • (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+21)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index c9eda9110a9ef..c9058d3e38c04 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1012,6 +1012,10 @@ defvar CompilerRTOnlyInt128Libcalls = [
   __mulodi4
 ];
 
+defvar DefaultRuntimeLibcallImpls_f80 =
+    !filter(entry, AllDefaultRuntimeLibcallImpls,
+            !match(!cast<string>(entry.Provides), "F80"));
+
 defvar DefaultRuntimeLibcallImpls_ppcf128 =
     !filter(entry, AllDefaultRuntimeLibcallImpls,
             !match(!cast<string>(entry.Provides), "PPCF128"));
@@ -1021,10 +1025,12 @@ defvar DefaultRuntimeLibcallImpls_f128 =
             !match(!cast<string>(entry.Provides), "_F128"));
 
 defvar DefaultRuntimeLibcallImpls =
+!listremove(
   !listremove(
     !listremove(
         !listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls),
                     CompilerRTOnlyInt128Libcalls),
+                    DefaultRuntimeLibcallImpls_f80),
                     DefaultRuntimeLibcallImpls_ppcf128);
 
 defvar DefaultRuntimeLibcallImpls_atomic =
@@ -1929,6 +1935,21 @@ def _allrem : RuntimeLibcallImpl<SREM_I64>;
 def _aullrem : RuntimeLibcallImpl<UREM_I64>;
 def _allmul : RuntimeLibcallImpl<MUL_I64>;
 
+//===----------------------------------------------------------------------===//
+// X86 Runtime Libcalls
+//===----------------------------------------------------------------------===//
+
+def isX86_32 : RuntimeLibcallPredicate<"TT.getArch() == Triple::x86">;
+def isX86_64 : RuntimeLibcallPredicate<"TT.getArch() == Triple::x86_64">;
+
+def X86_32SystemLibrary
+    : SystemRuntimeLibrary<isX86_32,
+      (add DefaultLibcallImpls32, DefaultRuntimeLibcallImpls_f80)>;
+
+def X86_64SystemLibrary
+    : SystemRuntimeLibrary<isX86_64,
+      (add DefaultLibcallImpls64, DefaultRuntimeLibcallImpls_f80)>;
+
 //===----------------------------------------------------------------------===//
 // XCore Runtime Libcalls
 //===----------------------------------------------------------------------===//

@arsenm arsenm marked this pull request as ready for review July 9, 2025 06:15
@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/only-add-ppcf128-calls-ppc branch from 5b51c68 to e0d9420 Compare July 9, 2025 08:21
@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/remove-f80-from-default-set branch from 1391d1f to 5bb63ef Compare July 9, 2025 08:22
@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/only-add-ppcf128-calls-ppc branch from e0d9420 to 7f46a81 Compare July 10, 2025 10:42
@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/remove-f80-from-default-set branch from 5bb63ef to 4b3e950 Compare July 10, 2025 10:43
Copy link
Contributor Author

arsenm commented Jul 13, 2025

Merge activity

  • Jul 13, 1:37 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 13, 1:56 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 13, 1:58 AM UTC: @arsenm merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/only-add-ppcf128-calls-ppc branch from 7f46a81 to dc19ced Compare July 13, 2025 01:51
Base automatically changed from users/arsenm/runtime-libcalls/only-add-ppcf128-calls-ppc to main July 13, 2025 01:55
Starts adding a stub X86 configuration which doesn't attempt
the system specific pieces yet. This is mostly to have a point
to add back in the f80 calls so they can be removed from every
other target.
@arsenm arsenm force-pushed the users/arsenm/runtime-libcalls/remove-f80-from-default-set branch from 4b3e950 to 463145c Compare July 13, 2025 01:55
@arsenm arsenm merged commit 4d01418 into main Jul 13, 2025
7 of 9 checks passed
@arsenm arsenm deleted the users/arsenm/runtime-libcalls/remove-f80-from-default-set branch July 13, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants