summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-03-17 17:03:45 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-03-17 17:03:45 +0000
commit85f9cef27e6b2605e67e94afc949f5b5f5b90668 (patch)
tree5d43d05bfdef366710f8a2ebefe8eff9c7c55f89 /lib
parent70de1e442d30eceea6d71ef5403f06323eda7e55 (diff)
downloadllvm-85f9cef27e6b2605e67e94afc949f5b5f5b90668.tar.gz
llvm-85f9cef27e6b2605e67e94afc949f5b5f5b90668.tar.bz2
llvm-85f9cef27e6b2605e67e94afc949f5b5f5b90668.tar.xz
MachineInstr: Inline the fast path (non-bundle instruction) of hasProperty.
This is particularly helpful as both arguments tend to be constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineInstr.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index 0397ff5c94..43af1addca 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -751,15 +751,11 @@ void MachineInstr::addMemOperand(MachineFunction &MF,
NumMemRefs = NewNum;
}
-bool
-MachineInstr::hasProperty(unsigned MCFlag, QueryType Type) const {
- if (Type == IgnoreBundle || !isBundle())
- return getDesc().getFlags() & (1 << MCFlag);
-
+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()) {
- if (MII->getDesc().getFlags() & (1 << MCFlag)) {
+ if (MII->getDesc().getFlags() & Mask) {
if (Type == AnyInBundle)
return true;
} else {