summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-06-21 18:33:23 +0000
committerAndrew Trick <atrick@apple.com>2013-06-21 18:33:23 +0000
commitc6bae79adb6a58be629804d058abb5613e561b5a (patch)
tree9b79e59e6b1647a7b76c050447bbfab1281c7365 /lib
parent03dca5e4b6c41e1e7fa4edad3d7ff8d5f6de7008 (diff)
downloadllvm-c6bae79adb6a58be629804d058abb5613e561b5a.tar.gz
llvm-c6bae79adb6a58be629804d058abb5613e561b5a.tar.bz2
llvm-c6bae79adb6a58be629804d058abb5613e561b5a.tar.xz
Added -precompute-phys-liveness for testing LiveIntervals updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 18eac4c7f9..368094396b 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -52,6 +52,14 @@ INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
INITIALIZE_PASS_END(LiveIntervals, "liveintervals",
"Live Interval Analysis", false, false)
+#ifndef NDEBUG
+static cl::opt<bool> EnablePrecomputePhysRegs(
+ "precompute-phys-liveness", cl::Hidden,
+ cl::desc("Eagerly compute live intervals for all physreg units."));
+#else
+static bool EnablePrecomputePhysRegs = false;
+#endif // NDEBUG
+
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
AU.addRequired<AliasAnalysis>();
@@ -116,6 +124,12 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
computeRegMasks();
computeLiveInRegUnits();
+ if (EnablePrecomputePhysRegs) {
+ // For stress testing, precompute live ranges of all physical register
+ // units, including reserved registers.
+ for (unsigned i = 0, e = TRI->getNumRegUnits(); i != e; ++i)
+ getRegUnit(i);
+ }
DEBUG(dump());
return true;
}