[ELF] OrderPass : Order atoms only by ordinals.
authorShankar Easwaran <shankare@codeaurora.org>
Fri, 20 Mar 2015 23:47:03 +0000 (23:47 +0000)
committerShankar Easwaran <shankare@codeaurora.org>
Fri, 20 Mar 2015 23:47:03 +0000 (23:47 +0000)
commit07f6ce0b83ac97879e2d1010c329158ee6db17b8
tree1ec21b9ea0188fe9cc9c6785f25d8911f5589606
parent33c979d685e35ac8ac813543c0ccc70a7ec392f8
[ELF] OrderPass : Order atoms only by ordinals.

Move the init array/fini array sorting to the Output ELF writer.

AFAIK, this is only needed by the X86_64/ARM ABI.

This shaves time taken to self host lld by 0.2 seconds.

Before patch
----------------
4791.062059 task-clock                #    1.634 CPUs utilized            ( +-  0.28% )
     61,107 context-switches          #    0.013 M/sec                    ( +-  0.56% )
2.932902671 seconds time elapsed                                          ( +-  0.84% )

After patch
-------------
4608.417248 task-clock                #    1.669 CPUs utilized            ( +-  0.30% )
     61,616 context-switches          #    0.013 M/sec                    ( +-  0.63% )
2.761012703 seconds time elapsed                                          ( +-  0.63% )

llvm-svn: 232866
lld/lib/ReaderWriter/ELF/DefaultLayout.h
lld/lib/ReaderWriter/ELF/OrderPass.h
lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h
lld/test/elf/init_array-order.test