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

Merged

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

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
@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/riscv/start-moving-runtime-libcalls-tablegen branch from ba16f00 to f4304a2 Compare July 10, 2025 10:42
@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
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:52 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 13, 1:55 AM UTC: @arsenm merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/riscv/start-moving-runtime-libcalls-tablegen branch from f4304a2 to c9c599f Compare July 13, 2025 01:48
Base automatically changed from users/arsenm/riscv/start-moving-runtime-libcalls-tablegen to main July 13, 2025 01:51
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 7f46a81 to dc19ced Compare July 13, 2025 01:51
@arsenm arsenm merged commit 0537f17 into main Jul 13, 2025
7 of 9 checks passed
@arsenm arsenm deleted the users/arsenm/runtime-libcalls/only-add-ppcf128-calls-ppc branch July 13, 2025 01:55
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