[PATCH] D78775: [MC] Fix quadratic behavior in addPendingLabel
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 24 10:37:16 PDT 2020
This review missed lists.
On Fri, Apr 24, 2020 at 8:18 PM Alexandre Ganea via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rGe98f73a62907: [MC] Fix quadratic behavior in addPendingLabel() (authored by aganea).
> Herald added a project: LLVM.
> Herald added a subscriber: llvm-commits.
>
> Repository:
> rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
> https://reviews.llvm.org/D78775/new/
>
> https://reviews.llvm.org/D78775
>
> Files:
> llvm/include/llvm/MC/MCObjectStreamer.h
> llvm/lib/MC/MCObjectStreamer.cpp
>
>
> Index: llvm/lib/MC/MCObjectStreamer.cpp
> ===================================================================
> --- llvm/lib/MC/MCObjectStreamer.cpp
> +++ llvm/lib/MC/MCObjectStreamer.cpp
> @@ -59,12 +59,8 @@
> CurSection->addPendingLabel(S, CurSubsectionIdx);
>
> // Add this Section to the list of PendingLabelSections.
> - auto SecIt = std::find(PendingLabelSections.begin(),
> - PendingLabelSections.end(), CurSection);
> - if (SecIt == PendingLabelSections.end())
> - PendingLabelSections.push_back(CurSection);
> - }
> - else
> + PendingLabelSections.insert(CurSection);
> + } else
> // There is no Section / Subsection for this label yet.
> PendingLabels.push_back(S);
> }
> Index: llvm/include/llvm/MC/MCObjectStreamer.h
> ===================================================================
> --- llvm/include/llvm/MC/MCObjectStreamer.h
> +++ llvm/include/llvm/MC/MCObjectStreamer.h
> @@ -38,7 +38,7 @@
> bool EmitEHFrame;
> bool EmitDebugFrame;
> SmallVector<MCSymbol *, 2> PendingLabels;
> - SmallVector<MCSection*, 2> PendingLabelSections;
> + SmallPtrSet<MCSection *, 4> PendingLabelSections;
> unsigned CurSubsectionIdx;
> struct PendingMCFixup {
> const MCSymbol *Sym;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list