mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-20 13:04:00 +00:00
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
This commit is contained in:
parent
85abb2700d
commit
32f9763017
@ -535,7 +535,7 @@ public:
|
|||||||
|
|
||||||
/// isUnpredicatedTerminator - Returns true if the instruction is a
|
/// isUnpredicatedTerminator - Returns true if the instruction is a
|
||||||
/// terminator instruction that has not been predicated.
|
/// terminator instruction that has not been predicated.
|
||||||
virtual bool isUnpredicatedTerminator(const MachineInstr *MI) const;
|
virtual bool isUnpredicatedTerminator(const MachineInstr *MI) const = 0;
|
||||||
|
|
||||||
/// PredicateInstruction - Convert the instruction into a predicated
|
/// PredicateInstruction - Convert the instruction into a predicated
|
||||||
/// instruction. It returns true if the operation was successful.
|
/// instruction. It returns true if the operation was successful.
|
||||||
@ -814,6 +814,7 @@ public:
|
|||||||
virtual bool hasStoreToStackSlot(const MachineInstr *MI,
|
virtual bool hasStoreToStackSlot(const MachineInstr *MI,
|
||||||
const MachineMemOperand *&MMO,
|
const MachineMemOperand *&MMO,
|
||||||
int &FrameIndex) const;
|
int &FrameIndex) const;
|
||||||
|
virtual bool isUnpredicatedTerminator(const MachineInstr *MI) const;
|
||||||
virtual bool PredicateInstruction(MachineInstr *MI,
|
virtual bool PredicateInstruction(MachineInstr *MI,
|
||||||
const SmallVectorImpl<MachineOperand> &Pred) const;
|
const SmallVectorImpl<MachineOperand> &Pred) const;
|
||||||
virtual void reMaterialize(MachineBasicBlock &MBB,
|
virtual void reMaterialize(MachineBasicBlock &MBB,
|
||||||
|
@ -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,
|
bool TargetInstrInfoImpl::PredicateInstruction(MachineInstr *MI,
|
||||||
const SmallVectorImpl<MachineOperand> &Pred) const {
|
const SmallVectorImpl<MachineOperand> &Pred) const {
|
||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
|
@ -129,18 +129,6 @@ void TargetInstrInfo::insertNoop(MachineBasicBlock &MBB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TargetInstrInfo::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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Measure the specified inline asm to determine an approximation of its
|
/// Measure the specified inline asm to determine an approximation of its
|
||||||
/// length.
|
/// length.
|
||||||
/// Comments (which run till the next SeparatorString or newline) do not
|
/// Comments (which run till the next SeparatorString or newline) do not
|
||||||
|
Loading…
x
Reference in New Issue
Block a user