[PATCH] D78775: [MC] Fix quadratic behavior in addPendingLabel

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 11:19:47 PDT 2020


Sorry about that, I think I forgot to set 'LLVM Github Monorepo' (which adds llvm-commits) when I've uploaded the patch to Phabricator.
Shouldn't that be the default now?

-----Message d'origine-----
De : Roman Lebedev <lebedev.ri at gmail.com> 
Envoyé : April 24, 2020 1:37 PM
À : reviews+D78775+public+d1a29f794af48bf3 at reviews.llvm.org; Alexandre Ganea via Phabricator <reviews at reviews.llvm.org>
Cc : Alexandre Ganea <alexandre.ganea at ubisoft.com>; Fangrui Song <maskray at google.com>; shengchen.kan at intel.com; mtrent at apple.com; john.reagan at vmssoftware.com; bcain at codeaurora.org; 88888yl at gmail.com; llvm-commits at lists.llvm.org
Objet : Re: [PATCH] D78775: [MC] Fix quadratic behavior in addPendingLabel

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