Skip to content

RuntimeLibcalls: Avoid adding ppcf128 calls to non-ppc targets #147656

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

Open
wants to merge 1 commit into
base: users/arsenm/riscv/start-moving-runtime-libcalls-tablegen
Choose a base branch
from

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Jul 9, 2025

Filter out PPCF128 calls from the default set, and only add them
back to PPC.

@arsenm arsenm marked this pull request as ready for review July 9, 2025 05:46
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2025

@llvm/pr-subscribers-backend-hexagon

@llvm/pr-subscribers-llvm-selectiondag

Author: Matt Arsenault (arsenm)

Changes

Filter out PPCF128 calls from the default set, and only add them
back to PPC.


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

1 Files Affected:

  • (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+12-5)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index fabfaf89b5aa0..c9eda9110a9ef 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1012,15 +1012,21 @@ defvar CompilerRTOnlyInt128Libcalls = [
   __mulodi4
 ];
 
-defvar DefaultRuntimeLibcallImpls =
-  !listremove(!listremove(AllDefaultRuntimeLibcallImpls,
-                          Int128RTLibcalls),
-                          CompilerRTOnlyInt128Libcalls);
+defvar DefaultRuntimeLibcallImpls_ppcf128 =
+    !filter(entry, AllDefaultRuntimeLibcallImpls,
+            !match(!cast<string>(entry.Provides), "PPCF128"));
 
 defvar DefaultRuntimeLibcallImpls_f128 =
-    !filter(entry, DefaultRuntimeLibcallImpls,
+    !filter(entry, AllDefaultRuntimeLibcallImpls,
             !match(!cast<string>(entry.Provides), "_F128"));
 
+defvar DefaultRuntimeLibcallImpls =
+  !listremove(
+    !listremove(
+        !listremove(AllDefaultRuntimeLibcallImpls, Int128RTLibcalls),
+                    CompilerRTOnlyInt128Libcalls),
+                    DefaultRuntimeLibcallImpls_ppcf128);
+
 defvar DefaultRuntimeLibcallImpls_atomic =
     !filter(entry, DefaultRuntimeLibcallImpls,
             !match(!cast<string>(entry.Provides), "ATOMIC"));
@@ -1843,6 +1849,7 @@ def PPCSystemLibrary
            (sub DefaultRuntimeLibcallImpls, memcpy,
                 DefaultRuntimeLibcallImpls_f128),
            __extendkftf2, __trunctfkf2,
+           DefaultRuntimeLibcallImpls_ppcf128,
            LibmF128Libcalls, AIX32Calls, AIX64Calls,
            AvailableIf<memcpy, isNotAIX>,
            LibcallImpls<(add Int128RTLibcalls), isPPC64>)>;

Copy link
Contributor Author

arsenm commented Jul 9, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@arsenm arsenm force-pushed the users/arsenm/riscv/start-moving-runtime-libcalls-tablegen branch from 7f81f86 to ba16f00 Compare July 9, 2025 08:21
Filter out PPCF128 calls from the default set, and only add them
back to PPC.
@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
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