diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-12-09 06:41:08 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-12-09 06:41:08 +0000 |
commit | 32f9763017f4329a0da75648655d63c9d7b91130 (patch) | |
tree | f185982bb79d90ec97053f0c4ee3a5ec7a73c31f /lib/CodeGen/TargetInstrInfoImpl.cpp | |
parent | 85abb2700d7791bcfa022fe8765df72929256d20 (diff) |
Move isUnpredicatedTerminator() default implementation to TargetInstrInfoImpl to break Target's dependency on CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetInstrInfoImpl.cpp')
-rw-r--r-- | lib/CodeGen/TargetInstrInfoImpl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/TargetInstrInfoImpl.cpp b/lib/CodeGen/TargetInstrInfoImpl.cpp index 5115d5bd07..ccbda9870e 100644 --- a/lib/CodeGen/TargetInstrInfoImpl.cpp +++ b/lib/CodeGen/TargetInstrInfoImpl.cpp @@ -139,6 +139,19 @@ bool TargetInstrInfoImpl::findCommutedOpIndices(MachineInstr *MI, } +bool +TargetInstrInfoImpl::isUnpredicatedTerminator(const MachineInstr *MI) const { + if (!MI->isTerminator()) return false; + + // Conditional branch is a special case. + if (MI->isBranch() && !MI->isBarrier()) + return true; + if (!MI->isPredicable()) + return true; + return !isPredicated(MI); +} + + bool TargetInstrInfoImpl::PredicateInstruction(MachineInstr *MI, const SmallVectorImpl<MachineOperand> &Pred) const { bool MadeChange = false; |