aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-08-16 07:24:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-08-16 07:24:22 +0000
commitbc165e436beb02443abea9736c1b77e2dd7828b6 (patch)
treebd72e179c6165f117c3f2e208c86be9390e2631d /lib/CodeGen/LiveIntervalAnalysis.cpp
parentaf11dc00a0c70fde950f70bd13a43e7cbb98ef72 (diff)
downloadexternal_llvm-bc165e436beb02443abea9736c1b77e2dd7828b6.zip
external_llvm-bc165e436beb02443abea9736c1b77e2dd7828b6.tar.gz
external_llvm-bc165e436beb02443abea9736c1b77e2dd7828b6.tar.bz2
Fix some kill info update bugs; add hidden option -disable-rematerialization to turn off remat for debugging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index bd81377..b2121c9 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -36,6 +36,12 @@
#include <cmath>
using namespace llvm;
+namespace {
+ // Hidden options for help debugging.
+ cl::opt<bool> DisableReMat("disable-rematerialization",
+ cl::init(false), cl::Hidden);
+}
+
STATISTIC(numIntervals, "Number of original intervals");
STATISTIC(numIntervalsAfter, "Number of intervals after coalescing");
STATISTIC(numFolded , "Number of loads/stores folded into instructions");
@@ -201,6 +207,9 @@ static bool isReDefinedByTwoAddr(MachineInstr *MI, unsigned Reg,
/// val# of the specified interval is re-materializable.
bool LiveIntervals::isReMaterializable(const LiveInterval &li, unsigned ValNum,
MachineInstr *MI) {
+ if (DisableReMat)
+ return false;
+
if (tii_->isTriviallyReMaterializable(MI))
return true;
@@ -610,7 +619,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
DOUT << " Removing [" << Start << "," << End << "] from: ";
interval.print(DOUT, mri_); DOUT << "\n";
interval.removeRange(Start, End);
- interval.addKillForValNum(0, Start-1); // odd # means phi node
+ interval.addKillForValNum(0, Start+1); // odd # means phi node
DOUT << " RESULT: "; interval.print(DOUT, mri_);
// Replace the interval with one of a NEW value number. Note that this