Change MRegisterInfo::foldMemoryOperand to return the folded

instruction to make the API more flexible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12386 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos
2004-03-14 07:19:51 +00:00
parent 97836fad2c
commit 39354c99a1
5 changed files with 188 additions and 191 deletions

View File

@ -209,13 +209,15 @@ void LiveIntervals::updateSpilledInterval(Interval& li,
for (unsigned i = 0; i < mi->getNumOperands(); ++i) {
MachineOperand& mop = mi->getOperand(i);
if (mop.isRegister() && mop.getReg() == li.reg) {
MachineInstr* old = mi;
if (mri_->foldMemoryOperand(mi, i, slot)) {
lv_->instructionChanged(old, mi);
vrm.virtFolded(li.reg, old, mi);
mi2iMap_.erase(old);
i2miMap_[index/InstrSlots::NUM] = mi;
mi2iMap_[mi] = index;
if (MachineInstr* fmi =
mri_->foldMemoryOperand(mi, i, slot)) {
lv_->instructionChanged(mi, fmi);
vrm.virtFolded(li.reg, mi, fmi);
mi2iMap_.erase(mi);
i2miMap_[index/InstrSlots::NUM] = fmi;
mi2iMap_[fmi] = index;
MachineBasicBlock& mbb = *mi->getParent();
mi = mbb.insert(mbb.erase(mi), fmi);
++numFolded;
goto for_operand;
}