mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Don't require BUNDLE headers in MachineInstr::getBundleSize().
It is possible to build MI bundles that don't begin with a BUNDLE header. Add support for such bundles, counting all instructions inside the bundle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -982,18 +982,13 @@ MachineInstr::getRegClassConstraint(unsigned OpIdx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/// getBundleSize - Return the number of instructions inside the MI bundle.
|
||||
/// Return the number of instructions inside the MI bundle, not counting the
|
||||
/// header instruction.
|
||||
unsigned MachineInstr::getBundleSize() const {
|
||||
assert(isBundle() && "Expecting a bundle");
|
||||
|
||||
const MachineBasicBlock *MBB = getParent();
|
||||
MachineBasicBlock::const_instr_iterator I = *this, E = MBB->instr_end();
|
||||
MachineBasicBlock::const_instr_iterator I = this;
|
||||
unsigned Size = 0;
|
||||
while ((++I != E) && I->isInsideBundle()) {
|
||||
++Size;
|
||||
}
|
||||
assert(Size > 1 && "Malformed bundle");
|
||||
|
||||
while (I->isBundledWithSucc())
|
||||
++Size, ++I;
|
||||
return Size;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user