diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-07-13 23:39:46 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-07-13 23:39:46 +0000 |
commit | cfed2564f74c2a6b6340030cd12d5c0708acd25c (patch) | |
tree | eca81edfd2a541d154f08eb5600dd7ff6b90d764 /llvm/lib/Target/TargetMachine.cpp | |
parent | 4beea6623250516c2f8fe72a1d1f91970510f31c (diff) | |
download | bcm5719-llvm-cfed2564f74c2a6b6340030cd12d5c0708acd25c.tar.gz bcm5719-llvm-cfed2564f74c2a6b6340030cd12d5c0708acd25c.zip |
Add EnableIPRA to TargetOptions, and move the cl::opt -enable-ipra to TargetMachine.cpp
Avoid exposing a cl::opt in a public header and instead promote this
option in the API.
Alternatively, we could land the cl::opt in CommandFlags.h so that
it is available to every tool, but we would still have to find an
option for clang.
llvm-svn: 275348
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/TargetMachine.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index ed2f4fef0f0..82c68505c4e 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -31,6 +31,10 @@ #include "llvm/Target/TargetSubtargetInfo.h" using namespace llvm; +cl::opt<bool> EnableIPRA("enable-ipra", cl::init(false), cl::Hidden, + cl::desc("Enable interprocedural register allocation " + "to reduce load/store at procedure calls.")); + //--------------------------------------------------------------------------- // TargetMachine Class // @@ -40,7 +44,10 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString, const TargetOptions &Options) : TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU), TargetFS(FS), AsmInfo(nullptr), MRI(nullptr), MII(nullptr), STI(nullptr), - RequireStructuredCFG(false), Options(Options) {} + RequireStructuredCFG(false), Options(Options) { + if (EnableIPRA.getNumOccurrences()) + this->Options.EnableIPRA = EnableIPRA; +} TargetMachine::~TargetMachine() { delete AsmInfo; |