[llvm-commits] [PATCH] MCAssembler Performance: Lazy invalidation

David Meyer pdox at google.com
Tue Dec 14 21:25:53 PST 2010


>
> Looks like this just makes PR8467 a bit more likely, no? That can/should
> probably be fixed differently, so I don't think it it is a big problem.
>
>
The output of the example in PR8467 is the same. This patch makes it more
likely that we'll relax when we don't have to, but only in the edge case
where there's an align that shrinks and a relocation very near the 1-byte
boundary.


> I have it too. Would you mind including the update to
> test/MC/MachO/relax-recompute-align.s in this patch?
>
>
Attached is a new patch which includes the altered test. However, I'm not
sure the test is serving any purpose anymore... it was meant to test the
align recompute behavior, which is no longer happening.


*) Can you try your patch in the .s testcase in PR8711?
>

There is no statistically significant effect on assemble time of this
example. The output is also identical.


>
> *) If this patch gives you a nice speed up in the attached test and doesn't
> slow down the one in 8711, commit it.
>

It doesn't affect 8711. My tests show this is more of an issue on X86-32.
Have you tried to assemble contrived.s?

With the current invalidation method, the algorithm is O(n^2) in the number
of fragments. If you have only a few hundred fragments, you won't notice a
problem. But if you start having thousands or tens of thousands of
fragments, things get slow fast.

(It was taking 3 minutes to assemble spec2k-gcc-nacl with llvm-mc vs. 2.5
seconds for nacl-gcc, until I made this change. See
http://build.chromium.org/f/client/perf/nacl-lucid64-spec-x86/spec2k/report.html?history=150&rev=-1&graph=compiletime_gcc,
the rise is switching to llvm-mc, and the fall is applying this patch)

Thanks,
- David Meyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101214/87195454/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invalidate-3.patch
Type: application/octet-stream
Size: 1811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101214/87195454/attachment.obj>


More information about the llvm-commits mailing list