isUnpredicatedTerminator should treat conditional branches as unpredicated terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-07-06 23:22:03 +00:00
parent 49ce02e408
commit 14c4655403
2 changed files with 13 additions and 3 deletions

View File

@ -88,9 +88,12 @@ bool TargetInstrInfo::PredicateInstruction(MachineInstr *MI,
bool TargetInstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {
const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
if (TID->Flags & M_TERMINATOR_FLAG) {
// Conditional branch is a special case.
if ((TID->Flags & M_BRANCH_FLAG) != 0 && (TID->Flags & M_BARRIER_FLAG) == 0)
return true;
if ((TID->Flags & M_PREDICABLE) == 0)
return true;
return !isPredicated(MI);
}
}
return false;
}

View File

@ -404,11 +404,18 @@ X86::CondCode X86::GetOppositeBranchCondition(X86::CondCode CC) {
// For purposes of branch analysis do not count FP_REG_KILL as a terminator.
bool X86InstrInfo::isUnpredicatedTerminator(const MachineInstr *MI) const {
const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
if (MI->getOpcode() == X86::FP_REG_KILL)
return false;
if (TID->Flags & M_TERMINATOR_FLAG)
const TargetInstrDescriptor *TID = MI->getInstrDescriptor();
if (TID->Flags & M_TERMINATOR_FLAG) {
// Conditional branch is a special case.
if ((TID->Flags & M_BRANCH_FLAG) != 0 && (TID->Flags & M_BARRIER_FLAG) == 0)
return true;
if ((TID->Flags & M_PREDICABLE) == 0)
return true;
return !isPredicated(MI);
}
return false;
}