summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
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
commitb11f05043465bceae4853a3bd2c01d7d664cc5e3 (patch)
tree14c7a887a8643618f21570b4a362cf5684b415d2 /lib/CodeGen/MachineInstr.cpp
parent86441169da23959c81d8648c3dfdc7a0bb8d2225 (diff)
downloadllvm-b11f05043465bceae4853a3bd2c01d7d664cc5e3.tar.gz
llvm-b11f05043465bceae4853a3bd2c01d7d664cc5e3.tar.bz2
llvm-b11f05043465bceae4853a3bd2c01d7d664cc5e3.tar.xz
Support headerless bundles in MachineInstr::hasProperty().
This function can still work without a BUNDLE header instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 92f6a7f769..cdf46b631f 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/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,