[llvm] 9ea9e93 - [MachinePipeliner] Fix elements being added while the list is iterated (#80805)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 16:17:14 PST 2024


Author: Yuta Mukai
Date: 2024-02-22T09:17:10+09:00
New Revision: 9ea9e93f4a74b363887b773397bcb134062270d9

URL: https://github.com/llvm/llvm-project/commit/9ea9e93f4a74b363887b773397bcb134062270d9
DIFF: https://github.com/llvm/llvm-project/commit/9ea9e93f4a74b363887b773397bcb134062270d9.diff

LOG: [MachinePipeliner] Fix elements being added while the list is iterated (#80805)

There is no need to add the elements of Objs twice, so the addition is
removed.

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachinePipeliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 697e0da0944221..1bda19b2e6e920 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -768,7 +768,6 @@ static void getUnderlyingObjects(const MachineInstr *MI,
       Objs.clear();
       return;
     }
-    Objs.push_back(V);
   }
 }
 


        


More information about the llvm-commits mailing list