Index: llvm/tools/llvm-exegesis/lib/Clustering.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/Clustering.cpp +++ llvm/tools/llvm-exegesis/lib/Clustering.cpp @@ -252,7 +252,7 @@ std::map> OpcodeConfigToClusterIDs; // Populate OpcodeConfigToClusterIDs and UnstableOpcodes data structures. assert(ClusterIdForPoint_.size() == Points_.size() && "size mismatch"); - for (const auto &Point : zip(Points_, ClusterIdForPoint_)) { + for (const auto Point : zip(Points_, ClusterIdForPoint_)) { const ClusterId &ClusterIdOfPoint = std::get<1>(Point); if (!ClusterIdOfPoint.isValid()) continue; // Only process fully valid clusters. @@ -347,13 +347,13 @@ assert(Representative.size() == Point.size() && "All points should have identical dimensions."); - for (const auto &I : zip(Representative, Point)) + for (const auto I : zip(Representative, Point)) std::get<0>(I).push(std::get<1>(I)); } std::vector SchedClassClusterCentroid::getAsPoint() const { std::vector ClusterCenterPoint(Representative.size()); - for (const auto &I : zip(ClusterCenterPoint, Representative)) + for (const auto I : zip(ClusterCenterPoint, Representative)) std::get<0>(I).PerInstructionValue = std::get<1>(I).avg(); return ClusterCenterPoint; } Index: llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp =================================================================== --- llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp +++ llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp @@ -275,7 +275,7 @@ std::max(LatencyMeasure.PerInstructionValue, WLE->Cycles); } } else if (Mode == InstructionBenchmark::Uops) { - for (const auto &I : zip(SchedClassPoint, Representative)) { + for (const auto I : zip(SchedClassPoint, Representative)) { BenchmarkMeasure &Measure = std::get<0>(I); const PerInstructionStats &Stats = std::get<1>(I); Index: llvm/tools/llvm-exegesis/llvm-exegesis.cpp =================================================================== --- llvm/tools/llvm-exegesis/llvm-exegesis.cpp +++ llvm/tools/llvm-exegesis/llvm-exegesis.cpp @@ -194,7 +194,7 @@ StringRef(OpcodeNames.getValue()) .split(Pieces, ",", /* MaxSplit */ -1, /* KeepEmpty */ false); std::vector Result; - for (const StringRef OpcodeName : Pieces) { + for (const StringRef &OpcodeName : Pieces) { if (unsigned Opcode = ResolveName(OpcodeName)) Result.push_back(Opcode); else Index: llvm/tools/llvm-mca/Views/DispatchStatistics.cpp =================================================================== --- llvm/tools/llvm-mca/Views/DispatchStatistics.cpp +++ llvm/tools/llvm-mca/Views/DispatchStatistics.cpp @@ -37,7 +37,8 @@ TempStream << "\n\nDispatch Logic - " << "number of cycles where we saw N micro opcodes dispatched:\n"; TempStream << "[# dispatched], [# cycles]\n"; - for (const std::pair &Entry : DispatchGroupSizePerCycle) { + for (const std::pair &Entry : + DispatchGroupSizePerCycle) { double Percentage = ((double)Entry.second / NumCycles) * 100.0; TempStream << " " << Entry.first << ", " << Entry.second << " (" << format("%.1f", floor((Percentage * 10) + 0.5) / 10) Index: llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp =================================================================== --- llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp +++ llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp @@ -59,7 +59,7 @@ << "number of cycles where we saw N instructions retired:\n"; TempStream << "[# retired], [# cycles]\n"; - for (const std::pair &Entry : RetiredPerCycle) { + for (const std::pair &Entry : RetiredPerCycle) { TempStream << " " << Entry.first; if (Entry.first < 10) TempStream << ", "; Index: llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp =================================================================== --- llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp +++ llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp @@ -107,7 +107,7 @@ bool HasColors = OS.has_colors(); const auto It = std::max_element(IssueWidthPerCycle.begin(), IssueWidthPerCycle.end()); - for (const std::pair &Entry : IssueWidthPerCycle) { + for (const std::pair &Entry : IssueWidthPerCycle) { unsigned NumIssued = Entry.first; if (NumIssued == It->first && HasColors) OS.changeColor(raw_ostream::SAVEDCOLOR, true, false); Index: llvm/tools/llvm-mca/Views/SummaryView.cpp =================================================================== --- llvm/tools/llvm-mca/Views/SummaryView.cpp +++ llvm/tools/llvm-mca/Views/SummaryView.cpp @@ -54,7 +54,7 @@ const Instruction &Inst = *Event.IR.getInstruction(); const InstrDesc &Desc = Inst.getDesc(); NumMicroOps += Desc.NumMicroOps; - for (const std::pair &RU : Desc.Resources) { + for (const std::pair &RU : Desc.Resources) { if (RU.second.size()) { unsigned ProcResID = ResIdx2ProcResID[getResourceStateIndex(RU.first)]; ProcResourceUsage[ProcResID] += RU.second.size(); Index: llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp =================================================================== --- llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -175,7 +175,7 @@ if (Phdr.p_type != PT_NOTE) continue; Error Err = Error::success(); - for (const auto &Note : In.notes(Phdr, Err)) + for (const auto Note : In.notes(Phdr, Err)) if (Note.getType() == NT_GNU_BUILD_ID && Note.getName() == ELF_NOTE_GNU) return Note.getDesc(); if (Err) Index: llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp =================================================================== --- llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -1407,7 +1407,7 @@ P.formatLine("Local / Global hashes:"); TypeIndex TI(TypeIndex::FirstNonSimpleIndex); - for (const auto &H : zip(LocalHashes, GlobalHashes)) { + for (const auto H : zip(LocalHashes, GlobalHashes)) { AutoIndent Indent2(P); LocallyHashedType &L = std::get<0>(H); GloballyHashedType &G = std::get<1>(H); Index: llvm/tools/llvm-readobj/ELFDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/ELFDumper.cpp +++ llvm/tools/llvm-readobj/ELFDumper.cpp @@ -5024,7 +5024,7 @@ continue; PrintHeader(S.sh_offset, S.sh_size); Error Err = Error::success(); - for (const auto &Note : Obj->notes(S, Err)) + for (const auto Note : Obj->notes(S, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); @@ -5036,7 +5036,7 @@ continue; PrintHeader(P.p_offset, P.p_filesz); Error Err = Error::success(); - for (const auto &Note : Obj->notes(P, Err)) + for (const auto Note : Obj->notes(P, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); @@ -6238,7 +6238,7 @@ DictScope D(W, "NoteSection"); PrintHeader(S.sh_offset, S.sh_size); Error Err = Error::success(); - for (const auto &Note : Obj->notes(S, Err)) + for (const auto Note : Obj->notes(S, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); @@ -6251,7 +6251,7 @@ DictScope D(W, "NoteSection"); PrintHeader(P.p_offset, P.p_filesz); Error Err = Error::success(); - for (const auto &Note : Obj->notes(P, Err)) + for (const auto Note : Obj->notes(P, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); Index: llvm/tools/llvm-readobj/ObjDumper.cpp =================================================================== --- llvm/tools/llvm-readobj/ObjDumper.cpp +++ llvm/tools/llvm-readobj/ObjDumper.cpp @@ -65,7 +65,7 @@ SecIndex++; } - for (const std::pair &S : SecNames) + for (const std::pair &S : SecNames) if (!S.second) reportWarning( createError(formatv("could not find section '{0}'", S.first).str()),