Improve wrapTicks performance with lots of redundant source notes
authorPeter Wortmann <Peter.Wortmann@googlemail.com>
Sat, 4 Feb 2017 20:14:31 +0000 (15:14 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 4 Feb 2017 21:16:50 +0000 (16:16 -0500)
commit29122312cc7b8f9890eb53f92d76ecdd8ded24ee
tree241b7a2dfb8e65e4c1ce7c07a377d2208e38f44a
parent157a46fb17a28e0923a3498ce8609f24ed554a1a
Improve wrapTicks performance with lots of redundant source notes

The old version had O(n^3) performance for n non-overlapping source
notes and let floats each, which is exactly what happens with -g if we
compile a list literal of length n.

The idea here is simply to establish early which source notes will
actually survive (e.g. use a left fold). The new code should be O(n) for
list literals.

Reviewers: austin, dfeuer, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3037

GHC Trac Issues: #11095
compiler/coreSyn/CorePrep.hs