1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Support headerless bundles in MachineInstr::hasProperty().

This function can still work without a BUNDLE header instruction.

llvm-svn: 172029
This commit is contained in:
Jakob Stoklund Olesen 2013-01-10 01:29:42 +00:00
parent 99a9fe9415
commit 8eaee5a93c
2 changed files with 6 additions and 8 deletions

View File

@ -314,7 +314,7 @@ public:
/// instruction bundles.
bool hasProperty(unsigned MCFlag, QueryType Type = AnyInBundle) const {
// Inline the fast path.
if (Type == IgnoreBundle || !isBundle())
if (Type == IgnoreBundle || !isBundled())
return getDesc().getFlags() & (1 << MCFlag);
// If we have a bundle, take the slow path.

View File

@ -752,20 +752,18 @@ void MachineInstr::addMemOperand(MachineFunction &MF,
}
bool MachineInstr::hasPropertyInBundle(unsigned Mask, QueryType Type) const {
const MachineBasicBlock *MBB = getParent();
MachineBasicBlock::const_instr_iterator MII = *this; ++MII;
while (MII != MBB->end() && MII->isInsideBundle()) {
for (MachineBasicBlock::const_instr_iterator MII = this;; ++MII) {
if (MII->getDesc().getFlags() & Mask) {
if (Type == AnyInBundle)
return true;
} else {
if (Type == AllInBundle)
if (Type == AllInBundle && !MII->isBundle())
return false;
}
++MII;
// This was the last instruction in the bundle.
if (!MII->isBundledWithSucc())
return Type == AllInBundle;
}
return Type == AllInBundle;
}
bool MachineInstr::isIdenticalTo(const MachineInstr *Other,