summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-14 19:54:47 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-08-14 19:54:47 +0000
commit81da0d45f857dfd10f87be5c60008afdf7f7d02e (patch)
tree5e99ffb00fe5d331ffd3122bdb707691740c340e /llvm/lib
parentf9273c81d60b6878dff479c5b5fae432525e202c (diff)
downloadbcm5719-llvm-81da0d45f857dfd10f87be5c60008afdf7f7d02e.tar.gz
bcm5719-llvm-81da0d45f857dfd10f87be5c60008afdf7f7d02e.zip
IPRA: Allow target to enable IPRA by default
llvm-svn: 310876
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/TargetPassConfig.cpp10
-rw-r--r--llvm/lib/Target/TargetMachine.cpp6
2 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp
index 75a565e898f..481baea2dff 100644
--- a/llvm/lib/CodeGen/TargetPassConfig.cpp
+++ b/llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -47,6 +47,9 @@
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."));
static cl::opt<bool> DisablePostRASched("disable-post-ra", cl::Hidden,
cl::desc("Disable Post Regalloc Scheduler"));
static cl::opt<bool> DisableBranchFold("disable-branch-fold", cl::Hidden,
@@ -362,6 +365,13 @@ TargetPassConfig::TargetPassConfig(LLVMTargetMachine &TM, PassManagerBase &pm)
if (StringRef(PrintMachineInstrs.getValue()).equals(""))
TM.Options.PrintMachineCode = true;
+ if (EnableIPRA.getNumOccurrences())
+ TM.Options.EnableIPRA = EnableIPRA;
+ else {
+ // If not explicitly specified, use target default.
+ TM.Options.EnableIPRA = TM.useIPRA();
+ }
+
if (TM.Options.EnableIPRA)
setRequiresCodeGenSCCOrder();
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index b2578fb7a02..3b16dee5a0f 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -31,10 +31,6 @@
#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
//
@@ -45,8 +41,6 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString,
: TheTarget(T), DL(DataLayoutString), TargetTriple(TT), TargetCPU(CPU),
TargetFS(FS), AsmInfo(nullptr), MRI(nullptr), MII(nullptr), STI(nullptr),
RequireStructuredCFG(false), DefaultOptions(Options), Options(Options) {
- if (EnableIPRA.getNumOccurrences())
- this->Options.EnableIPRA = EnableIPRA;
}
TargetMachine::~TargetMachine() {
OpenPOWER on IntegriCloud