diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-05 22:05:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-05 22:05:03 +0000 |
commit | 3c304a3ba18a040d3c3dbd15ab69da5543cdbd54 (patch) | |
tree | aca20e2ff4d3219b44cf073bce8b032293453a46 /lib/Target/PowerPC/PPCSubtarget.cpp | |
parent | 8c4a8735ecf12bc2447129810ec1d6079fc767f2 (diff) |
Consolidate the GPOpt stuff to all use the Subtarget, instead of still
depending on the command line option. Now the command line option just
sets the subtarget as appropriate. G5 opts will now default to on on
G5-enabled nightly testers among other machines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCSubtarget.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCSubtarget.cpp | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp index 3bfa7a6eef..686c11c669 100644 --- a/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/lib/Target/PowerPC/PPCSubtarget.cpp @@ -12,7 +12,23 @@ //===----------------------------------------------------------------------===// #include "PowerPCSubtarget.h" +#include "PowerPC.h" #include "llvm/Module.h" +#include "llvm/Support/CommandLine.h" +using namespace llvm; +PPCTargetEnum llvm::PPCTarget = TargetDefault; + +namespace llvm { + cl::opt<PPCTargetEnum, true> + PPCTargetArg(cl::desc("Force generation of code for a specific PPC target:"), + cl::values( + clEnumValN(TargetAIX, "aix", " Enable AIX codegen"), + clEnumValN(TargetDarwin,"darwin"," Enable Darwin codegen"), + clEnumValEnd), + cl::location(PPCTarget), cl::init(TargetDefault)); + cl::opt<bool> EnableGPOPT("enable-gpopt", cl::Hidden, + cl::desc("Enable optimizations for GP cpus")); +} #if defined(__APPLE__) #include <mach/mach.h> @@ -33,25 +49,26 @@ static boolean_t IsGP() { } #endif -using namespace llvm; - PPCSubtarget::PPCSubtarget(const Module &M) - : TargetSubtarget(), stackAlignment(16), isGigaProcessor(false), isAIX(false), - isDarwin(false) { - // Set the boolean corresponding to the current target triple, or the default + : StackAlignment(16), IsGigaProcessor(false), IsAIX(false), IsDarwin(false) { + + // Set the boolean corresponding to the current target triple, or the default // if one cannot be determined, to true. const std::string& TT = M.getTargetTriple(); if (TT.length() > 5) { - isDarwin = TT.find("darwin") != std::string::npos; + IsDarwin = TT.find("darwin") != std::string::npos; #if defined(__APPLE__) - isGigaProcessor = IsGP(); + IsGigaProcessor = IsGP(); #endif } else if (TT.empty()) { #if defined(_POWER) - isAIX = true; + IsAIX = true; #elif defined(__APPLE__) - isDarwin = true; - isGigaProcessor = IsGP(); + IsDarwin = true; + IsGigaProcessor = IsGP(); #endif } + + // If GP opts are forced on by the commandline, do so now. + if (EnableGPOPT) IsGigaProcessor = true; } |