summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-01-10 01:29:42 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-01-10 01:29:42 +0000
commit55a7be237e605f6a5e6be587e9cf0c4b20e47047 (patch)
tree6a5777b529a28bbde669a875d511caa89cdc56c8 /llvm/lib
parentad5f00ea2dbb281565b13a5a303a7d1103e12fd5 (diff)
downloadbcm5719-llvm-55a7be237e605f6a5e6be587e9cf0c4b20e47047.tar.gz
bcm5719-llvm-55a7be237e605f6a5e6be587e9cf0c4b20e47047.zip
Support headerless bundles in MachineInstr::hasProperty().
This function can still work without a BUNDLE header instruction. llvm-svn: 172029
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 92f6a7f7699..cdf46b631f9 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -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,
OpenPOWER on IntegriCloud