mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Avoid adding duplicate function live-in's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -398,8 +398,14 @@ void MachineFunction::viewCFGOnly() const
|
||||
unsigned MachineFunction::addLiveIn(unsigned PReg,
|
||||
const TargetRegisterClass *RC) {
|
||||
assert(RC->contains(PReg) && "Not the correct regclass!");
|
||||
unsigned VReg = getRegInfo().createVirtualRegister(RC);
|
||||
getRegInfo().addLiveIn(PReg, VReg);
|
||||
MachineRegisterInfo &MRI = getRegInfo();
|
||||
unsigned VReg = MRI.getLiveInVirtReg(PReg);
|
||||
if (VReg) {
|
||||
assert(MRI.getRegClass(VReg) == RC && "Register class mismatch!");
|
||||
return VReg;
|
||||
}
|
||||
VReg = MRI.createVirtualRegister(RC);
|
||||
MRI.addLiveIn(PReg, VReg);
|
||||
return VReg;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user