[PATCH] D27484: LowerTypeTests: Improve performance by optimising type metadata queries.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 13:55:44 PST 2016


pcc created this revision.
pcc added a reviewer: eugenis.
pcc added subscribers: krasin, llvm-commits.

Requesting metadata for a global is a relatively expensive operation as it
involves a map lookup, but it's one that we need to do relatively frequently in
this pass to collect the list of type metadata nodes associated with a global.
This change improves the performance of type metadata queries by prebuilding
data structures that keep the global together with its list of type metadata,
and changing the pass to use that data structure wherever we were previously
passing global references around.

This change also eliminates some O(N^2) behavior by collecting the list of
globals associated with each type identifier during the first pass over the
list of globals rather than visiting each global to compute that list every
time we add a new type identifier.

Reduces pass runtime on a module containing Chrome's vtables from over 60s
to 0.9s.


https://reviews.llvm.org/D27484

Files:
  llvm/lib/Transforms/IPO/LowerTypeTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27484.80478.patch
Type: text/x-patch
Size: 22050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161206/ab4dd990/attachment.bin>


More information about the llvm-commits mailing list