diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-12-18 23:21:49 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-12-18 23:21:49 +0000 |
commit | 2e4b639790a166e55a0bf14fac54ca6ce583e459 (patch) | |
tree | 62896234e32dba62a5c3c214eca673a8cc519fb4 /include/llvm/CodeGen/MachineInstr.h | |
parent | 1a3150098c137181576dc3e0960f8cd4abe9da1f (diff) |
Use bidirectional bundle flags to simplify important functions.
The bundle_iterator::operator++ function now doesn't need to dig out the
basic block and check against end(). It can use the isBundledWithSucc()
flag to find the last bundled instruction safely.
Similarly, MachineInstr::isBundled() no longer needs to look at
iterators etc. It only has to look at flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170473 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index c7b8360471..2313e4404b 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -211,7 +211,9 @@ public: /// isBundled - Return true if this instruction part of a bundle. This is true /// if either itself or its following instruction is marked "InsideBundle". - bool isBundled() const; + bool isBundled() const { + return isBundledWithPred() || isBundledWithSucc(); + } /// Return true if this instruction is part of a bundle, and it is not the /// first instruction in the bundle. |