Add debug output for rematerializable instructions.

llvm-svn: 129883
This commit is contained in:
Jakob Stoklund Olesen 2011-04-20 22:14:20 +00:00
parent 90d79bdcd2
commit 86e53ced08
3 changed files with 10 additions and 6 deletions

View File

@ -420,8 +420,10 @@ void InlineSpiller::analyzeSiblingValues() {
}
if (!DefMI && !VNI->isPHIDef())
DefMI = LIS.getInstructionFromIndex(VNI->def);
if (DefMI)
Edit->checkRematerializable(VNI, DefMI, TII, AA);
if (DefMI && Edit->checkRematerializable(VNI, DefMI, TII, AA)) {
DEBUG(dbgs() << "Value " << PrintReg(Reg) << ':' << VNI->id << '@'
<< VNI->def << " may remat from " << *DefMI);
}
}
}
}

View File

@ -36,14 +36,16 @@ LiveInterval &LiveRangeEdit::createFrom(unsigned OldReg,
return LI;
}
void LiveRangeEdit::checkRematerializable(VNInfo *VNI,
bool LiveRangeEdit::checkRematerializable(VNInfo *VNI,
const MachineInstr *DefMI,
const TargetInstrInfo &tii,
AliasAnalysis *aa) {
assert(DefMI && "Missing instruction");
if (tii.isTriviallyReMaterializable(DefMI, aa))
remattable_.insert(VNI);
scannedRemattable_ = true;
if (!tii.isTriviallyReMaterializable(DefMI, aa))
return false;
remattable_.insert(VNI);
return true;
}
void LiveRangeEdit::scanRemattable(LiveIntervals &lis,

View File

@ -137,7 +137,7 @@ public:
/// checkRematerializable - Manually add VNI to the list of rematerializable
/// values if DefMI may be rematerializable.
void checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI,
bool checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI,
const TargetInstrInfo&, AliasAnalysis*);
/// Remat - Information needed to rematerialize at a specific location.