forked from OSchip/llvm-project
Move an assertion so it doesn't dereference end().
The R600 target has test cases that exercises this code. llvm-svn: 171538
This commit is contained in:
parent
874f01e956
commit
7f92b7ad0a
|
@ -224,14 +224,13 @@ bool llvm::finalizeBundles(MachineFunction &MF) {
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
|
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
|
||||||
MachineBasicBlock &MBB = *I;
|
MachineBasicBlock &MBB = *I;
|
||||||
|
|
||||||
MachineBasicBlock::instr_iterator MII = MBB.instr_begin();
|
MachineBasicBlock::instr_iterator MII = MBB.instr_begin();
|
||||||
assert(!MII->isInsideBundle() &&
|
|
||||||
"First instr cannot be inside bundle before finalization!");
|
|
||||||
|
|
||||||
MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
|
MachineBasicBlock::instr_iterator MIE = MBB.instr_end();
|
||||||
if (MII == MIE)
|
if (MII == MIE)
|
||||||
continue;
|
continue;
|
||||||
|
assert(!MII->isInsideBundle() &&
|
||||||
|
"First instr cannot be inside bundle before finalization!");
|
||||||
|
|
||||||
for (++MII; MII != MIE; ) {
|
for (++MII; MII != MIE; ) {
|
||||||
if (!MII->isInsideBundle())
|
if (!MII->isInsideBundle())
|
||||||
++MII;
|
++MII;
|
||||||
|
|
Loading…
Reference in New Issue