mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +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.
|
||||
MachineInstr *MachineRegisterInfo::getVRegDef(unsigned Reg) const {
|
||||
// Since we are in SSA form, we can use the first definition.
|
||||
if (!def_empty(Reg))
|
||||
return &*def_begin(Reg);
|
||||
return 0;
|
||||
def_iterator I = def_begin(Reg);
|
||||
return !I.atEnd() ? &*I : 0;
|
||||
}
|
||||
|
||||
bool MachineRegisterInfo::hasOneUse(unsigned RegNo) const {
|
||||
|
Loading…
Reference in New Issue
Block a user