mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
MachineVerifier: Check that SlotIndex MBBIndexList is sorted.
This introduces a check that the MBBIndexList is sorted as proposed in http://reviews.llvm.org/D12443 but split up into a separate commit. llvm-svn: 247166
This commit is contained in:
parent
bcf29c51fa
commit
364e6db7a4
@ -236,6 +236,8 @@ namespace {
|
|||||||
void verifyLiveRange(const LiveRange&, unsigned, unsigned LaneMask = 0);
|
void verifyLiveRange(const LiveRange&, unsigned, unsigned LaneMask = 0);
|
||||||
|
|
||||||
void verifyStackFrame();
|
void verifyStackFrame();
|
||||||
|
|
||||||
|
void verifySlotIndexes() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MachineVerifierPass : public MachineFunctionPass {
|
struct MachineVerifierPass : public MachineFunctionPass {
|
||||||
@ -273,6 +275,19 @@ void MachineFunction::verify(Pass *p, const char *Banner) const {
|
|||||||
.runOnMachineFunction(const_cast<MachineFunction&>(*this));
|
.runOnMachineFunction(const_cast<MachineFunction&>(*this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MachineVerifier::verifySlotIndexes() const {
|
||||||
|
if (Indexes == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Ensure the IdxMBB list is sorted by slot indexes.
|
||||||
|
SlotIndex Last;
|
||||||
|
for (SlotIndexes::MBBIndexIterator I = Indexes->MBBIndexBegin(),
|
||||||
|
E = Indexes->MBBIndexEnd(); I != E; ++I) {
|
||||||
|
assert(!Last.isValid() || I->first > Last);
|
||||||
|
Last = I->first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) {
|
bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) {
|
||||||
foundErrors = 0;
|
foundErrors = 0;
|
||||||
|
|
||||||
@ -295,6 +310,8 @@ bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
Indexes = PASS->getAnalysisIfAvailable<SlotIndexes>();
|
Indexes = PASS->getAnalysisIfAvailable<SlotIndexes>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verifySlotIndexes();
|
||||||
|
|
||||||
visitMachineFunctionBefore();
|
visitMachineFunctionBefore();
|
||||||
for (MachineFunction::const_iterator MFI = MF.begin(), MFE = MF.end();
|
for (MachineFunction::const_iterator MFI = MF.begin(), MFE = MF.end();
|
||||||
MFI!=MFE; ++MFI) {
|
MFI!=MFE; ++MFI) {
|
||||||
|
Loading…
Reference in New Issue
Block a user