[llvm] 0e337c6 - Replace copy with a reference. (#82485)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 23:51:47 PST 2024


Author: MalaySanghiIntel
Date: 2024-03-05T15:51:43+08:00
New Revision: 0e337c67c8b9b0e04fb47712faba204c8d999af7

URL: https://github.com/llvm/llvm-project/commit/0e337c67c8b9b0e04fb47712faba204c8d999af7
DIFF: https://github.com/llvm/llvm-project/commit/0e337c67c8b9b0e04fb47712faba204c8d999af7.diff

LOG: Replace copy with a reference. (#82485)

These are relatively larger structures and we don't update them so ref
should be fine

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachinePipeliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 1bda19b2e6e920..d8cb6816883394 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -1334,7 +1334,7 @@ class HighRegisterPressureDetector {
         Register Reg = getLoopPhiReg(*MI, OrigMBB);
         UpdateTargetRegs(Reg);
       } else {
-        for (auto Use : ROMap.find(MI)->getSecond().Uses)
+        for (auto &Use : ROMap.find(MI)->getSecond().Uses)
           UpdateTargetRegs(Use.RegUnit);
       }
     }
@@ -1438,7 +1438,7 @@ class HighRegisterPressureDetector {
 
         const unsigned Iter = I - Stage;
 
-        for (auto Def : ROMap.find(MI)->getSecond().Defs)
+        for (auto &Def : ROMap.find(MI)->getSecond().Defs)
           InsertReg(LiveRegSets[Iter], Def.RegUnit);
 
         for (auto LastUse : LastUses[MI]) {


        


More information about the llvm-commits mailing list