diff --git a/llvm/tools/llvm-exegesis/lib/Clustering.cpp b/llvm/tools/llvm-exegesis/lib/Clustering.cpp index 7fb500e8399db..95d5cfb798ad0 100644 --- a/llvm/tools/llvm-exegesis/lib/Clustering.cpp +++ b/llvm/tools/llvm-exegesis/lib/Clustering.cpp @@ -252,7 +252,7 @@ void InstructionBenchmarkClustering::stabilize(unsigned NumOpcodes) { std::map> OpcodeConfigToClusterIDs; // Populate OpcodeConfigToClusterIDs and UnstableOpcodes data structures. assert(ClusterIdForPoint_.size() == Points_.size() && "size mismatch"); - for (const auto &Point : zip(Points_, ClusterIdForPoint_)) { + for (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 @@ void SchedClassClusterCentroid::addPoint(ArrayRef Point) { assert(Representative.size() == Point.size() && "All points should have identical dimensions."); - for (const auto &I : zip(Representative, Point)) + for (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 (auto I : zip(ClusterCenterPoint, Representative)) std::get<0>(I).PerInstructionValue = std::get<1>(I).avg(); return ClusterCenterPoint; } diff --git a/llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp b/llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp index d0a56983a25f5..e19f8d8d4128a 100644 --- a/llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp +++ b/llvm/tools/llvm-exegesis/lib/SchedClassResolution.cpp @@ -275,7 +275,7 @@ std::vector ResolvedSchedClass::getAsPoint( std::max(LatencyMeasure.PerInstructionValue, WLE->Cycles); } } else if (Mode == InstructionBenchmark::Uops) { - for (const auto &I : zip(SchedClassPoint, Representative)) { + for (auto I : zip(SchedClassPoint, Representative)) { BenchmarkMeasure &Measure = std::get<0>(I); const PerInstructionStats &Stats = std::get<1>(I); diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp index 45929fee5f760..a02d9997f762c 100644 --- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp +++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp @@ -194,7 +194,7 @@ static std::vector getOpcodesOrDie(const MCInstrInfo &MCInstrInfo) { 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 diff --git a/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp b/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp index 557b8ba17b17f..a1c0cf208d355 100644 --- a/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/DispatchStatistics.cpp @@ -37,7 +37,8 @@ void DispatchStatistics::printDispatchHistogram(raw_ostream &OS) const { 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) diff --git a/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp b/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp index cb4fbae78039b..61c115b27be13 100644 --- a/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/RetireControlUnitStatistics.cpp @@ -59,7 +59,7 @@ void RetireControlUnitStatistics::printView(raw_ostream &OS) const { << "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 << ", "; diff --git a/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp b/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp index bd0ba350ab684..7a341d4c2079a 100644 --- a/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp +++ b/llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp @@ -107,7 +107,7 @@ void SchedulerStatistics::printSchedulerStats(raw_ostream &OS) const { 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); diff --git a/llvm/tools/llvm-mca/Views/SummaryView.cpp b/llvm/tools/llvm-mca/Views/SummaryView.cpp index ef5550048f4c3..f0e75f7b13ae7 100644 --- a/llvm/tools/llvm-mca/Views/SummaryView.cpp +++ b/llvm/tools/llvm-mca/Views/SummaryView.cpp @@ -54,7 +54,7 @@ void SummaryView::onEvent(const HWInstructionEvent &Event) { 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(); diff --git a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp index e5892448033a0..a0cfd9a5ff868 100644 --- a/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp +++ b/llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp @@ -175,7 +175,7 @@ findBuildID(const CopyConfig &Config, const object::ELFFile &In) { if (Phdr.p_type != PT_NOTE) continue; Error Err = Error::success(); - for (const auto &Note : In.notes(Phdr, Err)) + for (auto Note : In.notes(Phdr, Err)) if (Note.getType() == NT_GNU_BUILD_ID && Note.getName() == ELF_NOTE_GNU) return Note.getDesc(); if (Err) diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp index 4d82e0fd9174c..bf725ad8d6066 100644 --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -1407,7 +1407,7 @@ Error DumpOutputStyle::dumpTypesFromObjectFile() { P.formatLine("Local / Global hashes:"); TypeIndex TI(TypeIndex::FirstNonSimpleIndex); - for (const auto &H : zip(LocalHashes, GlobalHashes)) { + for (auto H : zip(LocalHashes, GlobalHashes)) { AutoIndent Indent2(P); LocallyHashedType &L = std::get<0>(H); GloballyHashedType &G = std::get<1>(H); diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index bc3f41989f8a3..53f04094bb69b 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -5024,7 +5024,7 @@ void GNUStyle::printNotes(const ELFFile *Obj) { continue; PrintHeader(S.sh_offset, S.sh_size); Error Err = Error::success(); - for (const auto &Note : Obj->notes(S, Err)) + for (auto Note : Obj->notes(S, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); @@ -5036,7 +5036,7 @@ void GNUStyle::printNotes(const ELFFile *Obj) { continue; PrintHeader(P.p_offset, P.p_filesz); Error Err = Error::success(); - for (const auto &Note : Obj->notes(P, Err)) + for (auto Note : Obj->notes(P, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); @@ -6238,7 +6238,7 @@ void LLVMStyle::printNotes(const ELFFile *Obj) { DictScope D(W, "NoteSection"); PrintHeader(S.sh_offset, S.sh_size); Error Err = Error::success(); - for (const auto &Note : Obj->notes(S, Err)) + for (auto Note : Obj->notes(S, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); @@ -6251,7 +6251,7 @@ void LLVMStyle::printNotes(const ELFFile *Obj) { DictScope D(W, "NoteSection"); PrintHeader(P.p_offset, P.p_filesz); Error Err = Error::success(); - for (const auto &Note : Obj->notes(P, Err)) + for (auto Note : Obj->notes(P, Err)) ProcessNote(Note); if (Err) reportError(std::move(Err), this->FileName); diff --git a/llvm/tools/llvm-readobj/ObjDumper.cpp b/llvm/tools/llvm-readobj/ObjDumper.cpp index 9e5ebd99ac379..6229b52693d87 100644 --- a/llvm/tools/llvm-readobj/ObjDumper.cpp +++ b/llvm/tools/llvm-readobj/ObjDumper.cpp @@ -65,7 +65,7 @@ getSectionRefsByNameOrIndex(const object::ObjectFile *Obj, 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()),