summaryrefslogtreecommitdiff
path: root/lib/CodeGen/Spiller.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-04-21 22:46:52 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-04-21 22:46:52 +0000
commit5b69ebac857104770b1a751bf7a463fda4330a62 (patch)
tree4f04dd784d95779528ce075c994f65335631067c /lib/CodeGen/Spiller.h
parent578ccf81e5b94965e3ce8b4eadb6834e39f5f41d (diff)
downloadllvm-5b69ebac857104770b1a751bf7a463fda4330a62.tar.gz
llvm-5b69ebac857104770b1a751bf7a463fda4330a62.tar.bz2
llvm-5b69ebac857104770b1a751bf7a463fda4330a62.tar.xz
It has finally happened. Spiller is now using live interval info.
This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Spiller.h')
-rw-r--r--lib/CodeGen/Spiller.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/Spiller.h b/lib/CodeGen/Spiller.h
index c0d0837960..f00831f7e8 100644
--- a/lib/CodeGen/Spiller.h
+++ b/lib/CodeGen/Spiller.h
@@ -17,6 +17,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Streams.h"
#include "llvm/Function.h"
+#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -37,8 +38,8 @@ namespace llvm {
/// virtual registers to stack slots, rewriting the code.
struct Spiller {
virtual ~Spiller();
- virtual bool runOnMachineFunction(MachineFunction &MF,
- VirtRegMap &VRM) = 0;
+ virtual bool runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM,
+ LiveIntervals* LIs) = 0;
};
/// createSpiller - Create an return a spiller object, as specified on the
@@ -49,7 +50,8 @@ namespace llvm {
// Simple Spiller Implementation
struct VISIBILITY_HIDDEN SimpleSpiller : public Spiller {
- bool runOnMachineFunction(MachineFunction& mf, VirtRegMap &VRM);
+ bool runOnMachineFunction(MachineFunction& mf, VirtRegMap &VRM,
+ LiveIntervals* LIs);
};
// ************************************************************************ //
@@ -287,7 +289,8 @@ namespace llvm {
BitVector AllocatableRegs;
DenseMap<MachineInstr*, unsigned> DistanceMap;
public:
- bool runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM);
+ bool runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM,
+ LiveIntervals* LI);
private:
void TransferDeadness(MachineBasicBlock *MBB, unsigned CurDist,
unsigned Reg, BitVector &RegKills,
@@ -329,7 +332,7 @@ namespace llvm {
VirtRegMap &VRM);
void RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM,
- AvailableSpills &Spills,
+ LiveIntervals *LIs, AvailableSpills &Spills,
BitVector &RegKills, std::vector<MachineOperand*> &KillOps);
};
}