[llvm] db23f27 - [X86] X86PreTileConfig - Use const-ref iterator in for-range loop. NFCI.
    Simon Pilgrim via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Sep 17 06:09:55 PDT 2021
    
    
  
Author: Simon Pilgrim
Date: 2021-09-17T14:04:53+01:00
New Revision: db23f27786d9cea6f3d947d877b6b3a301e795ea
URL: https://github.com/llvm/llvm-project/commit/db23f27786d9cea6f3d947d877b6b3a301e795ea
DIFF: https://github.com/llvm/llvm-project/commit/db23f27786d9cea6f3d947d877b6b3a301e795ea.diff
LOG: [X86] X86PreTileConfig - Use const-ref iterator in for-range loop. NFCI.
Avoid unnecessary copies, reported by MSVC static analyzer.
Added: 
    
Modified: 
    llvm/lib/Target/X86/X86PreTileConfig.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/Target/X86/X86PreTileConfig.cpp b/llvm/lib/Target/X86/X86PreTileConfig.cpp
index b85a0b61d6f6..53aa8f99ff1e 100644
--- a/llvm/lib/Target/X86/X86PreTileConfig.cpp
+++ b/llvm/lib/Target/X86/X86PreTileConfig.cpp
@@ -323,7 +323,7 @@ bool X86PreTileConfig::runOnMachineFunction(MachineFunction &MF) {
       ST.getTileConfigSize(), ST.getTileConfigAlignment(), false);
 
   // Try to insert for the tile config live in points.
-  for (auto I : CfgNeedInsert) {
+  for (const auto &I : CfgNeedInsert) {
     SmallSet<MIRef, 8> InsertPoints;
     SmallVector<MIRef, 8> WorkList({I});
     while (!WorkList.empty()) {
        
    
    
More information about the llvm-commits
mailing list