10 #define DEBUG_TYPE "spiller"
37 cl::desc(
"Spiller to use: (default: standard)"),
40 clEnumValN(inline_,
"inline",
"inline spiller"),
50 class SpillerBase :
public Spiller {
63 : pass(&pass), mf(&mf), vrm(&vrm)
78 DEBUG(
dbgs() <<
"Spilling everywhere " << *li <<
"\n");
81 "Attempting to spill already spilled value.");
84 "Trying to spill a stack slot.");
86 DEBUG(
dbgs() <<
"Trivial spill everywhere of reg" << li->
reg <<
"\n");
93 regItr = mri->reg_begin(li->
reg); regItr != mri->reg_end();) {
103 }
while (regItr != mri->reg_end() && (&*regItr == mi));
119 unsigned NewVReg = LRE.
create();
122 for (
unsigned i = 0; i < indices.
size(); ++i) {
123 unsigned mopIdx = indices[i];
130 assert(hasUse || hasDef);
137 tii->loadRegFromStackSlot(*mi->
getParent(), miItr, NewVReg, ss, trc,
139 lis->InsertMachineInstrRangeInMaps(MIS.begin(), miItr);
148 lis->InsertMachineInstrRangeInMaps(
llvm::next(miItr), MIS.end());
160 class TrivialSpiller :
public SpillerBase {
165 : SpillerBase(pass, mf, vrm) {}
169 trivialSpillEverywhere(LRE);
175 void Spiller::anchor() { }
181 case trivial:
return new TrivialSpiller(pass, mf, vrm);
void push_back(const T &Elt)
bool isRegTiedToDefOperand(unsigned UseOpIdx, unsigned *DefOpIdx=0) const
ValuesClass< DataType > END_WITH_NULL values(const char *Arg, DataType Val, const char *Desc,...)
#define llvm_unreachable(msg)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Abstract Stack Frame Information.
#define clEnumVal(ENUMVAL, DESC)
unsigned getNumOperands() const
static cl::opt< SpillerName > spillerOpt("spiller", cl::desc("Spiller to use: (default: standard)"), cl::Prefix, cl::values(clEnumVal(trivial,"trivial spiller"), clEnumValN(inline_,"inline","inline spiller"), clEnumValEnd), cl::init(trivial))
const MachineBasicBlock * getParent() const
bundle_iterator< MachineInstr, instr_iterator > iterator
initializer< Ty > init(const Ty &Val)
const MachineOperand & getOperand(unsigned i) const
Two Address instruction pass
ItTy next(ItTy it, Dist n)
LiveInterval & getParent() const
void setIsKill(bool Val=true)
static bool isStackSlot(unsigned Reg)
virtual const TargetInstrInfo * getInstrInfo() const
AnalysisType & getAnalysis() const
MachineFrameInfo * getFrameInfo()
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
Spiller * createSpiller(MachineFunctionPass &pass, MachineFunction &mf, VirtRegMap &vrm)
Create and return a spiller object, as specified on the command line.
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
Spiller * createInlineSpiller(MachineFunctionPass &pass, MachineFunction &mf, VirtRegMap &vrm)
MachineRegisterInfo & getRegInfo()
void setReg(unsigned Reg)
const TargetMachine & getTarget() const
virtual const TargetRegisterInfo * getRegisterInfo() const
unsigned getReg() const
getReg - Returns the register number.
int assignVirt2StackSlot(unsigned virtReg)
create a mapping for the specifed virtual register to the next available stack slot ...