[all-commits] [llvm/llvm-project] fce545: [COFF] Avoid allocating temporary vectors during ICF

Reid Kleckner via All-commits all-commits at lists.llvm.org
Mon May 4 07:04:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fce5457a141901097d0a57986eb5d3a023528059
      https://github.com/llvm/llvm-project/commit/fce5457a141901097d0a57986eb5d3a023528059
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-05-04 (Mon, 04 May 2020)

  Changed paths:
    M lld/COFF/Chunks.h
    M lld/COFF/ICF.cpp

  Log Message:
  -----------
  [COFF] Avoid allocating temporary vectors during ICF

Heap profiling with ETW shows that LLD performs 4,053,721 heap
allocations over its lifetime, and ~800,000 of them come from
assocEquals. These vectors are created just to do a comparison, so fuse
the comparison into the loop and avoid the allocation.

ICF is overall a small portion of the time spent linking, and I did not
measure overall throughput improvements from this change above the noise
threshold. However, these show up in the heap profiler, and the work is
done, so we might as well land it if the code is clear enough.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D79297




More information about the All-commits mailing list