-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Lanai: Use TableGen to set libcall calling conventions #146080
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jun 27, 2025
This was referenced Jun 27, 2025
@llvm/pr-subscribers-tablegen @llvm/pr-subscribers-llvm-ir Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/146080.diff 2 Files Affected:
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 59e9481201de4..396dc45240412 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1360,6 +1360,18 @@ def __hexagon_fast2_sqrtdf2 : RuntimeLibcallImpl<SQRT_F64>;
def __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes
: RuntimeLibcallImpl<HEXAGON_MEMCPY_LIKELY_ALIGNED_MIN32BYTES_MULT8BYTES>;
+//===----------------------------------------------------------------------===//
+// Lanai Runtime Libcalls
+//===----------------------------------------------------------------------===//
+
+def isLanai : RuntimeLibcallPredicate<"TT.getArch() == Triple::lanai">;
+
+// Use fast calling convention for library functions.
+def LanaiSystemLibrary
+ : SystemRuntimeLibrary<isLanai, (add DefaultRuntimeLibcallImpls)> {
+ let DefaultLibcallCallingConv = FASTCC;
+}
+
//===----------------------------------------------------------------------===//
// Mips16 Runtime Libcalls
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
index ec668ebaeab0d..272c7bc1a8db6 100644
--- a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
+++ b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp
@@ -150,10 +150,6 @@ LanaiTargetLowering::LanaiTargetLowering(const TargetMachine &TM,
// statements. Re-evaluate this on new benchmarks.
setMinimumJumpTableEntries(100);
- // Use fast calling convention for library functions.
- for (RTLIB::LibcallImpl LC : RTLIB::libcall_impls())
- setLibcallImplCallingConv(LC, CallingConv::Fast);
-
MaxStoresPerMemset = 16; // For @llvm.memset -> sequence of stores
MaxStoresPerMemsetOptSize = 8;
MaxStoresPerMemcpy = 16; // For @llvm.memcpy -> sequence of stores
|
RKSimon
approved these changes
Jun 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9cbb4db
to
c7f71df
Compare
370182a
to
deb69b2
Compare
c7f71df
to
9978b68
Compare
deb69b2
to
d988e2c
Compare
9978b68
to
2bbe9b3
Compare
d988e2c
to
ef8535c
Compare
91ac52f
to
a492a7e
Compare
414f451
to
32364e6
Compare
1f131e1
to
74a0108
Compare
32364e6
to
b21bcf5
Compare
b21bcf5
to
2309255
Compare
Base automatically changed from
users/arsenm/tablegen/add-calling-conv-libcall-impl-sets
to
main
July 8, 2025 08:12
74a0108
to
953f970
Compare
This was referenced Jul 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.