Skip to content

Commit

Permalink
GlobalISel: Use cloneVirtualRegister in localizer
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenm committed Jan 11, 2022
1 parent 0cf860e commit 5a434ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/CodeGen/GlobalISel/Localizer.cpp
Expand Up @@ -130,8 +130,7 @@ bool Localizer::localizeInterBlock(MachineFunction &MF,
LocalizedMI);

// Set a new register for the definition.
Register NewReg = MRI->createGenericVirtualRegister(MRI->getType(Reg));
MRI->setRegClassOrRegBank(NewReg, MRI->getRegClassOrRegBank(Reg));
Register NewReg = MRI->cloneVirtualRegister(Reg);
LocalizedMI->getOperand(0).setReg(NewReg);
NewVRegIt =
MBBWithLocalDef.insert(std::make_pair(MBBAndReg, NewReg)).first;
Expand Down

0 comments on commit 5a434ce

Please sign in to comment.