[llvm] 38f996b - Replace copy with a reference. (#87975)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 05:31:55 PDT 2024


Author: Malay Sanghi
Date: 2024-04-08T20:31:51+08:00
New Revision: 38f996bb2bc4f922c7b441d730ab3a3ad2fa1506

URL: https://github.com/llvm/llvm-project/commit/38f996bb2bc4f922c7b441d730ab3a3ad2fa1506
DIFF: https://github.com/llvm/llvm-project/commit/38f996bb2bc4f922c7b441d730ab3a3ad2fa1506.diff

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachinePipeliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index b9c6765be445a0..93050406783240 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -1247,7 +1247,7 @@ class HighRegisterPressureDetector {
     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 @@ class HighRegisterPressureDetector {
 
     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;


        


More information about the llvm-commits mailing list