aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/InlineSpiller.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-10 22:54:40 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-10 22:54:40 +0000
commit3bda29eb4f111015974d3f07675a26ec980e4a45 (patch)
tree76750632ef87cf4d9d28bdcf1a654d61b4854684 /lib/CodeGen/InlineSpiller.cpp
parentab7837c26980d260ac0e42d52d6f137e78c8231c (diff)
Rip out live range splitting support from the inline spiller.
The spiller should only spill. The register allocator will drive live range splitting, it has the needed information about register pressure and interferences. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InlineSpiller.cpp')
-rw-r--r--lib/CodeGen/InlineSpiller.cpp57
1 files changed, 1 insertions, 56 deletions
diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp
index 7e4fbadea4..f18c8ddef5 100644
--- a/lib/CodeGen/InlineSpiller.cpp
+++ b/lib/CodeGen/InlineSpiller.cpp
@@ -15,15 +15,12 @@
#define DEBUG_TYPE "regalloc"
#include "Spiller.h"
#include "LiveRangeEdit.h"
-#include "SplitKit.h"
#include "VirtRegMap.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveStackAnalysis.h"
-#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
@@ -36,18 +33,12 @@ using namespace llvm;
static cl::opt<bool>
VerifySpills("verify-spills", cl::desc("Verify after each spill/split"));
-static cl::opt<bool>
-ExtraSpillerSplits("extra-spiller-splits",
- cl::desc("Enable additional splitting during splitting"));
-
namespace {
class InlineSpiller : public Spiller {
MachineFunctionPass &pass_;
MachineFunction &mf_;
LiveIntervals &lis_;
LiveStacks &lss_;
- MachineDominatorTree &mdt_;
- MachineLoopInfo &loops_;
AliasAnalysis *aa_;
VirtRegMap &vrm_;
MachineFrameInfo &mfi_;
@@ -56,8 +47,6 @@ class InlineSpiller : public Spiller {
const TargetRegisterInfo &tri_;
const BitVector reserved_;
- SplitAnalysis splitAnalysis_;
-
// Variables that are valid during spill(), but used by multiple methods.
LiveRangeEdit *edit_;
const TargetRegisterClass *rc_;
@@ -76,16 +65,13 @@ public:
mf_(mf),
lis_(pass.getAnalysis<LiveIntervals>()),
lss_(pass.getAnalysis<LiveStacks>()),
- mdt_(pass.getAnalysis<MachineDominatorTree>()),
- loops_(pass.getAnalysis<MachineLoopInfo>()),
aa_(&pass.getAnalysis<AliasAnalysis>()),
vrm_(vrm),
mfi_(*mf.getFrameInfo()),
mri_(mf.getRegInfo()),
tii_(*mf.getTarget().getInstrInfo()),
tri_(*mf.getTarget().getRegisterInfo()),
- reserved_(tri_.getReservedRegs(mf_)),
- splitAnalysis_(mf, lis_, loops_) {}
+ reserved_(tri_.getReservedRegs(mf_)) {}
void spill(LiveInterval *li,
SmallVectorImpl<LiveInterval*> &newIntervals,
@@ -94,8 +80,6 @@ public:
void spill(LiveRangeEdit &);
private:
- bool split();
-
bool reMaterializeFor(MachineBasicBlock::iterator MI);
void reMaterializeAll();
@@ -117,42 +101,6 @@ Spiller *createInlineSpiller(MachineFunctionPass &pass,
}
}
-/// split - try splitting the current interval into pieces that may allocate
-/// separately. Return true if successful.
-bool InlineSpiller::split() {
- splitAnalysis_.analyze(&edit_->getParent());
-
- // Try splitting around loops.
- if (ExtraSpillerSplits) {
- const MachineLoop *loop = splitAnalysis_.getBestSplitLoop();
- if (loop) {
- SplitEditor(splitAnalysis_, lis_, vrm_, mdt_, *edit_)
- .splitAroundLoop(loop);
- return true;
- }
- }
-
- // Try splitting into single block intervals.
- SplitAnalysis::BlockPtrSet blocks;
- if (splitAnalysis_.getMultiUseBlocks(blocks)) {
- SplitEditor(splitAnalysis_, lis_, vrm_, mdt_, *edit_)
- .splitSingleBlocks(blocks);
- return true;
- }
-
- // Try splitting inside a basic block.
- if (ExtraSpillerSplits) {
- const MachineBasicBlock *MBB = splitAnalysis_.getBlockForInsideSplit();
- if (MBB){
- SplitEditor(splitAnalysis_, lis_, vrm_, mdt_, *edit_)
- .splitInsideBlock(MBB);
- return true;
- }
- }
-
- return false;
-}
-
/// reMaterializeFor - Attempt to rematerialize edit_->getReg() before MI instead of
/// reloading it.
bool InlineSpiller::reMaterializeFor(MachineBasicBlock::iterator MI) {
@@ -377,9 +325,6 @@ void InlineSpiller::spill(LiveRangeEdit &edit) {
assert(edit.getParent().isSpillable() &&
"Attempting to spill already spilled value.");
- if (split())
- return;
-
reMaterializeAll();
// Remat may handle everything.