[llvm-commits] PATCH: Fix quadratic behavior in PR12652

Chandler Carruth chandlerc at gmail.com
Fri Jul 6 01:28:38 PDT 2012


Hello,

This patch adds what seems to me to be a very efficient merge operation for
LiveInterval to address the quadratic behavior seen in PR12652 when merging
extremely large, extremely distant disjoint intervals created by ASan's
strange code layout.

There is one other user of addRangeFrom left (join) and I think I can
refactor this code a bit and share the merge logic for that routine as
well. But I didn't want to do that in this patch.

With this patch, the previously dominant entry on the profile
(extendIntervalEndTo) disappears *completely* from the test case in the PR.
I dunno how far down it is, but it's no longer significant. None of the
merge logic appears to be significant. Instead overlaysFrom and
findLocalKills start to dominate the profile.

The performance which was previously quadratic is now roughly linear, but
it's a rather unfortunate linear: 2x. Every doubling of the input size
quadruples the compile time. Not sure how much time its worth driving this
down versus teaching ASan to emit its basic blocks in a natural CFG order.

Comments welcome on the patch. One awkward aspect is that its interface is
very ad-hoc. It happens to accept the parameterization required by the
various merge-like behaviors in LiveInterval. This will get slightly worse
if I add support for join as well.

-Chandler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/e424df7c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr12652.patch
Type: application/octet-stream
Size: 5328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120706/e424df7c/attachment.obj>


More information about the llvm-commits mailing list