mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Use getVNInfoBefore() when it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b5856c83ff
commit
194eb71a11
@ -810,7 +810,7 @@ void InlineSpiller::markValueUsed(LiveInterval *LI, VNInfo *VNI) {
|
|||||||
MachineBasicBlock *MBB = LIS.getMBBFromIndex(VNI->def);
|
MachineBasicBlock *MBB = LIS.getMBBFromIndex(VNI->def);
|
||||||
for (MachineBasicBlock::pred_iterator PI = MBB->pred_begin(),
|
for (MachineBasicBlock::pred_iterator PI = MBB->pred_begin(),
|
||||||
PE = MBB->pred_end(); PI != PE; ++PI) {
|
PE = MBB->pred_end(); PI != PE; ++PI) {
|
||||||
VNInfo *PVNI = LI->getVNInfoAt(LIS.getMBBEndIdx(*PI).getPrevSlot());
|
VNInfo *PVNI = LI->getVNInfoBefore(LIS.getMBBEndIdx(*PI));
|
||||||
if (PVNI)
|
if (PVNI)
|
||||||
WorkList.push_back(std::make_pair(LI, PVNI));
|
WorkList.push_back(std::make_pair(LI, PVNI));
|
||||||
}
|
}
|
||||||
|
@ -680,15 +680,14 @@ unsigned ConnectedVNInfoEqClasses::Classify(const LiveInterval *LI) {
|
|||||||
// Connect to values live out of predecessors.
|
// Connect to values live out of predecessors.
|
||||||
for (MachineBasicBlock::const_pred_iterator PI = MBB->pred_begin(),
|
for (MachineBasicBlock::const_pred_iterator PI = MBB->pred_begin(),
|
||||||
PE = MBB->pred_end(); PI != PE; ++PI)
|
PE = MBB->pred_end(); PI != PE; ++PI)
|
||||||
if (const VNInfo *PVNI =
|
if (const VNInfo *PVNI = LI->getVNInfoBefore(LIS.getMBBEndIdx(*PI)))
|
||||||
LI->getVNInfoAt(LIS.getMBBEndIdx(*PI).getPrevSlot()))
|
|
||||||
EqClass.join(VNI->id, PVNI->id);
|
EqClass.join(VNI->id, PVNI->id);
|
||||||
} else {
|
} else {
|
||||||
// Normal value defined by an instruction. Check for two-addr redef.
|
// Normal value defined by an instruction. Check for two-addr redef.
|
||||||
// FIXME: This could be coincidental. Should we really check for a tied
|
// FIXME: This could be coincidental. Should we really check for a tied
|
||||||
// operand constraint?
|
// operand constraint?
|
||||||
// Note that VNI->def may be a use slot for an early clobber def.
|
// Note that VNI->def may be a use slot for an early clobber def.
|
||||||
if (const VNInfo *UVNI = LI->getVNInfoAt(VNI->def.getPrevSlot()))
|
if (const VNInfo *UVNI = LI->getVNInfoBefore(VNI->def))
|
||||||
EqClass.join(VNI->id, UVNI->id);
|
EqClass.join(VNI->id, UVNI->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1193,8 +1193,8 @@ void MachineVerifier::verifyLiveIntervals() {
|
|||||||
// Check that VNI is live-out of all predecessors.
|
// Check that VNI is live-out of all predecessors.
|
||||||
for (MachineBasicBlock::const_pred_iterator PI = MFI->pred_begin(),
|
for (MachineBasicBlock::const_pred_iterator PI = MFI->pred_begin(),
|
||||||
PE = MFI->pred_end(); PI != PE; ++PI) {
|
PE = MFI->pred_end(); PI != PE; ++PI) {
|
||||||
SlotIndex PEnd = LiveInts->getMBBEndIdx(*PI).getPrevSlot();
|
SlotIndex PEnd = LiveInts->getMBBEndIdx(*PI);
|
||||||
const VNInfo *PVNI = LI.getVNInfoAt(PEnd);
|
const VNInfo *PVNI = LI.getVNInfoBefore(PEnd);
|
||||||
|
|
||||||
if (VNI->isPHIDef() && VNI->def == LiveInts->getMBBStartIdx(MFI))
|
if (VNI->isPHIDef() && VNI->def == LiveInts->getMBBStartIdx(MFI))
|
||||||
continue;
|
continue;
|
||||||
@ -1202,7 +1202,7 @@ void MachineVerifier::verifyLiveIntervals() {
|
|||||||
if (!PVNI) {
|
if (!PVNI) {
|
||||||
report("Register not marked live out of predecessor", *PI);
|
report("Register not marked live out of predecessor", *PI);
|
||||||
*OS << "Valno #" << VNI->id << " live into BB#" << MFI->getNumber()
|
*OS << "Valno #" << VNI->id << " live into BB#" << MFI->getNumber()
|
||||||
<< '@' << LiveInts->getMBBStartIdx(MFI) << ", not live at "
|
<< '@' << LiveInts->getMBBStartIdx(MFI) << ", not live before "
|
||||||
<< PEnd << " in " << LI << '\n';
|
<< PEnd << " in " << LI << '\n';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -586,7 +586,7 @@ SlotIndex SplitEditor::leaveIntvAtTop(MachineBasicBlock &MBB) {
|
|||||||
void SplitEditor::overlapIntv(SlotIndex Start, SlotIndex End) {
|
void SplitEditor::overlapIntv(SlotIndex Start, SlotIndex End) {
|
||||||
assert(OpenIdx && "openIntv not called before overlapIntv");
|
assert(OpenIdx && "openIntv not called before overlapIntv");
|
||||||
const VNInfo *ParentVNI = Edit->getParent().getVNInfoAt(Start);
|
const VNInfo *ParentVNI = Edit->getParent().getVNInfoAt(Start);
|
||||||
assert(ParentVNI == Edit->getParent().getVNInfoAt(End.getPrevSlot()) &&
|
assert(ParentVNI == Edit->getParent().getVNInfoBefore(End) &&
|
||||||
"Parent changes value in extended range");
|
"Parent changes value in extended range");
|
||||||
assert(LIS.getMBBFromIndex(Start) == LIS.getMBBFromIndex(End) &&
|
assert(LIS.getMBBFromIndex(Start) == LIS.getMBBFromIndex(End) &&
|
||||||
"Range cannot span basic blocks");
|
"Range cannot span basic blocks");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user