mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 18:04:59 +00:00
Add new TargetInstrDesc::hasImplicitUseOfPhysReg and
hasImplicitDefOfPhysReg methods. Use them to remove a look in X86 fast isel. llvm-svn: 68886
This commit is contained in:
parent
f03202e76d
commit
da05d37aa1
@ -199,6 +199,24 @@ public:
|
||||
const unsigned *getImplicitDefs() const {
|
||||
return ImplicitDefs;
|
||||
}
|
||||
|
||||
/// hasImplicitUseOfPhysReg - Return true if this instruction implicitly
|
||||
/// uses the specified physical register.
|
||||
bool hasImplicitUseOfPhysReg(unsigned Reg) const {
|
||||
if (const unsigned *ImpUses = ImplicitUses)
|
||||
for (; *ImpUses; ++ImpUses)
|
||||
if (*ImpUses == Reg) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// hasImplicitDefOfPhysReg - Return true if this instruction implicitly
|
||||
/// defines the specified physical register.
|
||||
bool hasImplicitDefOfPhysReg(unsigned Reg) const {
|
||||
if (const unsigned *ImpDefs = ImplicitDefs)
|
||||
for (; *ImpDefs; ++ImpDefs)
|
||||
if (*ImpDefs == Reg) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// getRegClassBarriers - Return a list of register classes that are
|
||||
/// completely clobbered by this machine instruction. For example, on X86
|
||||
|
@ -808,21 +808,9 @@ bool X86FastISel::X86SelectBranch(Instruction *I) {
|
||||
}
|
||||
|
||||
const TargetInstrDesc &TID = MI.getDesc();
|
||||
const unsigned *ImpDefs = TID.getImplicitDefs();
|
||||
|
||||
if (TID.hasUnmodeledSideEffects()) break;
|
||||
|
||||
bool ModifiesEFlags = false;
|
||||
|
||||
if (ImpDefs) {
|
||||
for (unsigned u = 0; ImpDefs[u]; ++u)
|
||||
if (ImpDefs[u] == X86::EFLAGS) {
|
||||
ModifiesEFlags = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ModifiesEFlags) break;
|
||||
if (TID.hasUnmodeledSideEffects() ||
|
||||
TID.hasImplicitDefOfPhysReg(X86::EFLAGS))
|
||||
break;
|
||||
}
|
||||
|
||||
if (SetMI) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user