mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
Microoptimize getVRegDef. def_begin isn't free, don't compute it twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
84dfc32ff9
commit
1e8db1a4fa
@ -161,9 +161,8 @@ void MachineRegisterInfo::replaceRegWith(unsigned FromReg, unsigned ToReg) {
|
|||||||
/// form, so there should only be one definition.
|
/// form, so there should only be one definition.
|
||||||
MachineInstr *MachineRegisterInfo::getVRegDef(unsigned Reg) const {
|
MachineInstr *MachineRegisterInfo::getVRegDef(unsigned Reg) const {
|
||||||
// Since we are in SSA form, we can use the first definition.
|
// Since we are in SSA form, we can use the first definition.
|
||||||
if (!def_empty(Reg))
|
def_iterator I = def_begin(Reg);
|
||||||
return &*def_begin(Reg);
|
return !I.atEnd() ? &*I : 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MachineRegisterInfo::hasOneUse(unsigned RegNo) const {
|
bool MachineRegisterInfo::hasOneUse(unsigned RegNo) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user