diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 10:09:50 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-25 10:09:50 +0000 |
commit | d6fd377f3333922c4e928019cdfa124ff7f4dd2e (patch) | |
tree | da15e380d88d8a3072e1d8cf434f424880b0a2ce /lib/Target/X86/TargetInfo | |
parent | e0d12d5f7b0a6369df128c8b0cc43e6e08a804a0 (diff) | |
download | external_llvm-d6fd377f3333922c4e928019cdfa124ff7f4dd2e.zip external_llvm-d6fd377f3333922c4e928019cdfa124ff7f4dd2e.tar.gz external_llvm-d6fd377f3333922c4e928019cdfa124ff7f4dd2e.tar.bz2 |
Simplify JIT target selection.
- Instead of requiring targets to define a JIT quality match function, we just
have them specify if they support a JIT.
- Target selection for the JIT just gets the host triple and looks for the best
target which matches the triple and has a JIT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/TargetInfo')
-rw-r--r-- | lib/Target/X86/TargetInfo/X86TargetInfo.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/Target/X86/TargetInfo/X86TargetInfo.cpp b/lib/Target/X86/TargetInfo/X86TargetInfo.cpp index a130e4e..6201002 100644 --- a/lib/Target/X86/TargetInfo/X86TargetInfo.cpp +++ b/lib/Target/X86/TargetInfo/X86TargetInfo.cpp @@ -14,13 +14,6 @@ using namespace llvm; Target llvm::TheX86_32Target; -static unsigned X86_32_JITMatchQuality() { -#if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86) - return 10; -#endif - return 0; -} - static unsigned X86_32_TripleMatchQuality(const std::string &TT) { // We strongly match "i[3-9]86-*". if (TT.size() >= 5 && TT[0] == 'i' && TT[2] == '8' && TT[3] == '6' && @@ -45,18 +38,11 @@ static unsigned X86_32_ModuleMatchQuality(const Module &M) { M.getPointerSize() != Module::AnyPointerSize) return 0; // Match for some other target - return X86_32_JITMatchQuality()/2; + return 0; } Target llvm::TheX86_64Target; -static unsigned X86_64_JITMatchQuality() { -#if defined(__x86_64__) || defined(_M_AMD64) - return 10; -#endif - return 0; -} - static unsigned X86_64_TripleMatchQuality(const std::string &TT) { // We strongly match "x86_64-*". if (TT.size() >= 7 && TT[0] == 'x' && TT[1] == '8' && TT[2] == '6' && @@ -81,7 +67,7 @@ static unsigned X86_64_ModuleMatchQuality(const Module &M) { M.getPointerSize() != Module::AnyPointerSize) return 0; // Match for some other target - return X86_64_JITMatchQuality()/2; + return 0; } extern "C" void LLVMInitializeX86TargetInfo() { @@ -89,11 +75,11 @@ extern "C" void LLVMInitializeX86TargetInfo() { "32-bit X86: Pentium-Pro and above", &X86_32_TripleMatchQuality, &X86_32_ModuleMatchQuality, - &X86_32_JITMatchQuality); + /*HasJIT=*/true); TargetRegistry::RegisterTarget(TheX86_64Target, "x86-64", "64-bit X86: EM64T and AMD64", &X86_64_TripleMatchQuality, &X86_64_ModuleMatchQuality, - &X86_64_JITMatchQuality); + /*HasJIT=*/true); } |