mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Update MachineVerifier to check the new physreg live-in rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150496 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
342c64c904
commit
03698deb25
@ -75,6 +75,7 @@ namespace {
|
|||||||
const MachineInstr *FirstTerminator;
|
const MachineInstr *FirstTerminator;
|
||||||
|
|
||||||
BitVector regsReserved;
|
BitVector regsReserved;
|
||||||
|
BitVector regsAllocatable;
|
||||||
RegSet regsLive;
|
RegSet regsLive;
|
||||||
RegVector regsDefined, regsDead, regsKilled;
|
RegVector regsDefined, regsDead, regsKilled;
|
||||||
RegSet regsLiveInButUnused;
|
RegSet regsLiveInButUnused;
|
||||||
@ -175,6 +176,10 @@ namespace {
|
|||||||
return Reg < regsReserved.size() && regsReserved.test(Reg);
|
return Reg < regsReserved.size() && regsReserved.test(Reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isAllocatable(unsigned Reg) {
|
||||||
|
return Reg < regsAllocatable.size() && regsAllocatable.test(Reg);
|
||||||
|
}
|
||||||
|
|
||||||
// Analysis information if available
|
// Analysis information if available
|
||||||
LiveVariables *LiveVars;
|
LiveVariables *LiveVars;
|
||||||
LiveIntervals *LiveInts;
|
LiveIntervals *LiveInts;
|
||||||
@ -380,6 +385,9 @@ void MachineVerifier::visitMachineFunctionBefore() {
|
|||||||
regsReserved.set(*Sub);
|
regsReserved.set(*Sub);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
regsAllocatable = TRI->getAllocatableSet(*MF);
|
||||||
|
|
||||||
markReachable(&MF->front());
|
markReachable(&MF->front());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,6 +405,20 @@ void
|
|||||||
MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
|
MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
|
||||||
FirstTerminator = 0;
|
FirstTerminator = 0;
|
||||||
|
|
||||||
|
if (MRI->isSSA()) {
|
||||||
|
// If this block has allocatable physical registers live-in, check that
|
||||||
|
// it is an entry block or landing pad.
|
||||||
|
for (MachineBasicBlock::livein_iterator LI = MBB->livein_begin(),
|
||||||
|
LE = MBB->livein_end();
|
||||||
|
LI != LE; ++LI) {
|
||||||
|
unsigned reg = *LI;
|
||||||
|
if (isAllocatable(reg) && !MBB->isLandingPad() &&
|
||||||
|
MBB != MBB->getParent()->begin()) {
|
||||||
|
report("MBB has allocable live-in, but isn't entry or landing-pad.", MBB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Count the number of landing pad successors.
|
// Count the number of landing pad successors.
|
||||||
SmallPtrSet<MachineBasicBlock*, 4> LandingPadSuccs;
|
SmallPtrSet<MachineBasicBlock*, 4> LandingPadSuccs;
|
||||||
for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(),
|
for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user