aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-03 22:12:54 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-03 22:12:54 +0000
commitdcc4436cddc9b5d155040ed3ed38e9070ec4e3b8 (patch)
tree85937449f1a4b758f9a12b40f938b1ba6b8650c1 /lib
parente744ac49f4cf878e2b34dba26964f04fb0415fa3 (diff)
downloadexternal_llvm-dcc4436cddc9b5d155040ed3ed38e9070ec4e3b8.zip
external_llvm-dcc4436cddc9b5d155040ed3ed38e9070ec4e3b8.tar.gz
external_llvm-dcc4436cddc9b5d155040ed3ed38e9070ec4e3b8.tar.bz2
Add an experimental -early-live-intervals option.
This option runs LiveIntervals before TwoAddressInstructionPass which will eventually learn to exploit and update the analysis. Eventually, LiveIntervals will run before PHIElimination, and we can get rid of LiveVariables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp1
-rw-r--r--lib/CodeGen/Passes.cpp9
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index b488e8f..d0f8ae1 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -45,6 +45,7 @@ NewLiveIntervals("new-live-intervals", cl::Hidden,
cl::desc("Use new algorithm forcomputing live intervals"));
char LiveIntervals::ID = 0;
+char &llvm::LiveIntervalsID = LiveIntervals::ID;
INITIALIZE_PASS_BEGIN(LiveIntervals, "liveintervals",
"Live Interval Analysis", false, false)
INITIALIZE_AG_DEPENDENCY(AliasAnalysis)
diff --git a/lib/CodeGen/Passes.cpp b/lib/CodeGen/Passes.cpp
index 69d6d00..cfa3eec 100644
--- a/lib/CodeGen/Passes.cpp
+++ b/lib/CodeGen/Passes.cpp
@@ -88,6 +88,10 @@ PrintMachineInstrs("print-machineinstrs", cl::ValueOptional,
cl::desc("Print machine instrs"),
cl::value_desc("pass-name"), cl::init("option-unspecified"));
+// Experimental option to run live inteerval analysis early.
+static cl::opt<bool> EarlyLiveIntervals("early-live-intervals", cl::Hidden,
+ cl::desc("Run live interval analysis earlier in the pipeline"));
+
/// Allow standard passes to be disabled by command line options. This supports
/// simple binary flags that either suppress the pass or do nothing.
/// i.e. -disable-mypass=false has no effect.
@@ -648,6 +652,11 @@ void TargetPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) {
addPass(&MachineLoopInfoID);
addPass(&PHIEliminationID);
}
+
+ // Eventually, we want to run LiveIntervals before PHI elimination.
+ if (EarlyLiveIntervals)
+ addPass(&LiveIntervalsID);
+
addPass(&TwoAddressInstructionPassID);
if (EnableStrongPHIElim)