projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch a number of loops in lib/CodeGen over to range-based for-loops, now that
[oota-llvm.git]
/
lib
/
CodeGen
/
LiveRangeEdit.cpp
diff --git
a/lib/CodeGen/LiveRangeEdit.cpp
b/lib/CodeGen/LiveRangeEdit.cpp
index 86271116f4e07799ed8903001f7b79e9631959e3..891eaab1a597ff7d5334f6b9b02b5d4763364da8 100644
(file)
--- a/
lib/CodeGen/LiveRangeEdit.cpp
+++ b/
lib/CodeGen/LiveRangeEdit.cpp
@@
-167,9
+167,7
@@
bool LiveRangeEdit::foldAsLoad(LiveInterval *LI,
MachineInstr *DefMI = 0, *UseMI = 0;
// Check that there is a single def and a single use.
MachineInstr *DefMI = 0, *UseMI = 0;
// Check that there is a single def and a single use.
- for (MachineRegisterInfo::reg_nodbg_iterator I = MRI.reg_nodbg_begin(LI->reg),
- E = MRI.reg_nodbg_end(); I != E; ++I) {
- MachineOperand &MO = I.getOperand();
+ for (MachineOperand &MO : MRI.reg_nodbg_operands(LI->reg)) {
MachineInstr *MI = MO.getParent();
if (MO.isDef()) {
if (DefMI && DefMI != MI)
MachineInstr *MI = MO.getParent();
if (MO.isDef()) {
if (DefMI && DefMI != MI)
@@
-262,9
+260,9
@@
void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
else if (MOI->isDef()) {
for (MCRegUnitIterator Units(Reg, MRI.getTargetRegisterInfo());
Units.isValid(); ++Units) {
else if (MOI->isDef()) {
for (MCRegUnitIterator Units(Reg, MRI.getTargetRegisterInfo());
Units.isValid(); ++Units) {
- if (Live
Interval *LI
= LIS.getCachedRegUnit(*Units)) {
- if (VNInfo *VNI = L
I
->getVNInfoAt(Idx))
- L
I
->removeValNo(VNI);
+ if (Live
Range *LR
= LIS.getCachedRegUnit(*Units)) {
+ if (VNInfo *VNI = L
R
->getVNInfoAt(Idx))
+ L
R
->removeValNo(VNI);
}
}
}
}
}
}
@@
-278,7
+276,7
@@
void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
// Always shrink COPY uses that probably come from live range splitting.
if (MI->readsVirtualRegister(Reg) &&
(MI->isCopy() || MOI->isDef() || MRI.hasOneNonDBGUse(Reg) ||
// Always shrink COPY uses that probably come from live range splitting.
if (MI->readsVirtualRegister(Reg) &&
(MI->isCopy() || MOI->isDef() || MRI.hasOneNonDBGUse(Reg) ||
- LI.
isKilledAtInstr(Idx
)))
+ LI.
Query(Idx).isKill(
)))
ToShrink.insert(&LI);
// Remove defined value.
ToShrink.insert(&LI);
// Remove defined value.
@@
-414,6
+412,6
@@
LiveRangeEdit::calculateRegClassAndHint(MachineFunction &MF,
if (MRI.recomputeRegClass(LI.reg, MF.getTarget()))
DEBUG(dbgs() << "Inflated " << PrintReg(LI.reg) << " to "
<< MRI.getRegClass(LI.reg)->getName() << '\n');
if (MRI.recomputeRegClass(LI.reg, MF.getTarget()))
DEBUG(dbgs() << "Inflated " << PrintReg(LI.reg) << " to "
<< MRI.getRegClass(LI.reg)->getName() << '\n');
- VRAI.
Calculate
WeightAndHint(LI);
+ VRAI.
calculateSpill
WeightAndHint(LI);
}
}
}
}