Replace copy with a reference. (#87975)

This commit is contained in:
Malay Sanghi
2024-04-08 20:31:51 +08:00
committed by GitHub
parent fc9a5076c3
commit 38f996bb2b

View File

@@ -1247,7 +1247,7 @@ private:
for (auto &MI : *OrigMBB) {
if (MI.isDebugInstr())
continue;
for (auto Use : ROMap[&MI].Uses) {
for (auto &Use : ROMap[&MI].Uses) {
auto Reg = Use.RegUnit;
// Ignore the variable that appears only on one side of phi instruction
// because it's used only at the first iteration.
@@ -1345,7 +1345,7 @@ private:
DenseMap<Register, MachineInstr *> LastUseMI;
for (MachineInstr *MI : llvm::reverse(OrderedInsts)) {
for (auto Use : ROMap.find(MI)->getSecond().Uses) {
for (auto &Use : ROMap.find(MI)->getSecond().Uses) {
auto Reg = Use.RegUnit;
if (!TargetRegs.contains(Reg))
continue;