Skip to content

Commit cbf2553

Browse files
committed
Move common sets of libcalls
1 parent 7a1f7b4 commit cbf2553

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -891,40 +891,6 @@ def calloc : RuntimeLibcallImpl<CALLOC>;
891891
} // End let IsDefault = true
892892
} // End defset AllDefaultRuntimeLibcallImpls
893893

894-
895-
// FIXME: Should move to explicit opt-in to different sets of libcalls
896-
// instead of trying to remove from a default set. We have
897-
// unreasonable defaults like reporting f80 calls on most targets when
898-
// they are relevant to only one.
899-
900-
defvar AllDefaultLibCalls =
901-
!foreach(entry, AllDefaultRuntimeLibcallImpls, entry.Provides);
902-
903-
// These libcalls are only available in compiler-rt, not libgcc for
904-
// 32-bit arch. They are available on both for 64-bit.
905-
defvar LibCallsCompilerRT64OrLibGCC = [
906-
__ashlti3, __lshrti3, __ashrti3, __multi3, __mulodi4
907-
];
908-
909-
defvar DefaultRuntimeLibcallImpls =
910-
!listremove(AllDefaultRuntimeLibcallImpls,
911-
LibCallsCompilerRT64OrLibGCC);
912-
913-
defvar DefaultRuntimeLibcallImpls_f128 =
914-
!filter(entry, DefaultRuntimeLibcallImpls,
915-
!match(!cast<string>(entry.Provides), "_F128"));
916-
917-
defvar DefaultRuntimeLibcallImpls_atomic =
918-
!filter(entry, DefaultRuntimeLibcallImpls,
919-
!match(!cast<string>(entry.Provides), "ATOMIC"));
920-
921-
/// Default set of libcall impls for 32-bit architectures.
922-
defvar DefaultLibcallImpls32 = DefaultRuntimeLibcallImpls;
923-
924-
/// Default set of libcall impls for 64-bit architectures.
925-
defvar DefaultLibcallImpls64 = !listconcat(DefaultRuntimeLibcallImpls,
926-
LibCallsCompilerRT64OrLibGCC);
927-
928894
//--------------------------------------------------------------------
929895
// Define implementation other libcalls
930896
//--------------------------------------------------------------------
@@ -1005,6 +971,43 @@ defset list<RuntimeLibcallImpl> LibmF128FiniteLibcalls = {
1005971
def __powf128_finite : RuntimeLibcallImpl<POW_FINITE_F128>;
1006972
}
1007973

974+
//===----------------------------------------------------------------------===//
975+
// Common Libcall Sets
976+
//===----------------------------------------------------------------------===//
977+
978+
// FIXME: Should move to explicit opt-in to different sets of libcalls
979+
// instead of trying to remove from a default set. We have
980+
// unreasonable defaults like reporting f80 calls on most targets when
981+
// they are relevant to only one.
982+
983+
defvar AllDefaultLibCalls =
984+
!foreach(entry, AllDefaultRuntimeLibcallImpls, entry.Provides);
985+
986+
// These libcalls are only available in compiler-rt, not libgcc for
987+
// 32-bit arch. They are available on both for 64-bit.
988+
defvar LibCallsCompilerRT64OrLibGCC = [
989+
__ashlti3, __lshrti3, __ashrti3, __multi3, __mulodi4
990+
];
991+
992+
defvar DefaultRuntimeLibcallImpls =
993+
!listremove(AllDefaultRuntimeLibcallImpls,
994+
LibCallsCompilerRT64OrLibGCC);
995+
996+
defvar DefaultRuntimeLibcallImpls_f128 =
997+
!filter(entry, DefaultRuntimeLibcallImpls,
998+
!match(!cast<string>(entry.Provides), "_F128"));
999+
1000+
defvar DefaultRuntimeLibcallImpls_atomic =
1001+
!filter(entry, DefaultRuntimeLibcallImpls,
1002+
!match(!cast<string>(entry.Provides), "ATOMIC"));
1003+
1004+
/// Default set of libcall impls for 32-bit architectures.
1005+
defvar DefaultLibcallImpls32 = DefaultRuntimeLibcallImpls;
1006+
1007+
/// Default set of libcall impls for 64-bit architectures.
1008+
defvar DefaultLibcallImpls64 = !listconcat(DefaultRuntimeLibcallImpls,
1009+
LibCallsCompilerRT64OrLibGCC);
1010+
10081011
//===----------------------------------------------------------------------===//
10091012
// AArch64 Runtime Libcalls
10101013
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)