[X86] X86PreTileConfig - Use const-ref iterator in for-range loop. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 17 Sep 2021 12:35:59 +0000 (13:35 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 17 Sep 2021 13:04:53 +0000 (14:04 +0100)
Avoid unnecessary copies, reported by MSVC static analyzer.

llvm/lib/Target/X86/X86PreTileConfig.cpp

index b85a0b6..53aa8f9 100644 (file)
@@ -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()) {