mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-06 01:24:35 +00:00
Simplify a few more uses of reg_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -110,11 +110,9 @@ void MachineRegisterInfo::replaceRegWith(unsigned FromReg, unsigned ToReg) {
|
||||
MachineInstr *MachineRegisterInfo::getVRegDef(unsigned Reg) const {
|
||||
assert(Reg-TargetRegisterInfo::FirstVirtualRegister < VRegInfo.size() &&
|
||||
"Invalid vreg!");
|
||||
for (reg_iterator I = reg_begin(Reg), E = reg_end(); I != E; ++I) {
|
||||
// Since we are in SSA form, we can stop at the first definition.
|
||||
if (I.getOperand().isDef())
|
||||
return &*I;
|
||||
}
|
||||
// Since we are in SSA form, we can use the first definition.
|
||||
if (!def_empty(Reg))
|
||||
return &*def_begin(Reg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user