[PATCH] [MachO] Implement -order_file as a separate ordering pass.

Rui Ueyama ruiu at google.com
Tue Jan 27 16:39:58 PST 2015

I feel that discussing performance on the two-pass solution at this point
could lead to a premature optimization> Maybe we should run a benchmark to
see if it's going to be a real issue. Second sort can be faster than first
sort because second sort sorts a mostly-sorted array. But sure, sort is
O(log n). Run that stuff twice is not optimal. We may want to avoid that if

I carefully read the code for ELF and found that the functionality that the
LayoutPass provides is overkill for that architecture. We don't need that
amount of code.

Currently the LayoutPass is applied unconditionally to all architectures.
Maybe we should stop doing that and let each arch to define its own layout
pass. The current LayoutPass can be simplified to <10 lines of code, so it
wouldn't worth abstracting.

On Tue, Jan 27, 2015 at 4:21 PM, kledzik at apple.com <kledzik at apple.com>

> Sure two passes is conceptually clean, but if it turns out that running
> sort() twice for mach-o makes linking slower for mach-o than it currently
> is, then that is not ideal.
> The other way would be to have one layout pass that uses a base class for
> the comparator which the ELF layout pass uses as-is, but there is a (non
> virtual) way for mach-o to supply a more complex comparator (today's
> comparator).
> http://reviews.llvm.org/D7212
>   http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150127/2c9b20f7/attachment.html>

More information about the llvm-commits mailing list