[PATCH] D12537: [MergeFuncs] Efficiently defer functions on merge

Jason Koenig via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 11:56:12 PDT 2015


jrkoenig created this revision.
jrkoenig added reviewers: jfb, dschuff.
jrkoenig added subscribers: nlewycky, llvm-commits.

This patch introduces a side table in Merge Functions to
efficiently remove functions from the function set when functions
they refer to are merged. Previously these functions would need to
be compared lg(N) times to find the appropriate FunctionNode in the
tree to defer. With the recent determinism changes, this comparison
is more expensive. In addition, the removal function would not always
actually remove the function from the set (i.e. after remove(F),
there would sometimes still be a node in the tree which contains F).

With these changes, these functions are properly deferred, and so more
functions can be merged. In addition, when there are many merged
functions (and thus more deferred functions), there is a speedup:

chromium: 48678 merged -> 49380 merged; 6.58s -> 5.49s
libxul.so: 41004 merged -> 41030 merged; 8.02s -> 6.94s
mysqld: 1607 merged -> 1607 merged (same); 0.215s -> 0.212s (probably noise)

http://reviews.llvm.org/D12537

Files:
  lib/Transforms/IPO/MergeFunctions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12537.33718.patch
Type: text/x-patch
Size: 3900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150901/88a550b2/attachment.bin>


More information about the llvm-commits mailing list