llvm-6502/lib/MC
Rafael Espindola b4b0b34181 Write relocation sections contiguously.
Linkers normally read all the relocations upfront to compute the references
between sections. Putting them together is a bit more cache friendly.

I benchmarked linking a Release+Asserts clang with gold on a vm. I tried all
4 combinations of --gc-sections/no --gc-section hot and cold cache.

I cleared the cache with

echo 3 > /proc/sys/vm/drop_caches

and warmed it up by running the link once before timing the subsequent ones.

With cold cache and --gc-sections the time goes from

1.86130781665 +- 0.01713126697463843 seconds
to
1.82370735105 +- 0.014127522318814516 seconds

With cold cache and no --gc-sections the time goes from

1.6087245435500002 +- 0.012999066825178644 seconds
to
1.5687122041500001 +- 0.013145850126026619 seconds

With hot cache and no --gc-sections the time goes from

0.926200939 ( +-  0.33% ) seconds
to
0.907200079 ( +-  0.31% ) seconds

With hot cache and gc sections the time goes from

1.183038049 ( +-  0.34% ) seconds
to
1.147355862 ( +-  0.39% ) seconds

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-17 08:11:38 +00:00
..
MCDisassembler Replace the MCSubtargetInfo parameter with a Triple when creating 2015-03-31 00:10:04 +00:00
MCParser Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
CMakeLists.txt
ConstantPools.cpp
ELFObjectWriter.cpp Write relocation sections contiguously. 2015-04-17 08:11:38 +00:00
LLVMBuild.txt
MachObjectWriter.cpp Use raw_pwrite_stream in the object writer/streamer. 2015-04-14 22:14:34 +00:00
Makefile
MCAsmBackend.cpp
MCAsmInfo.cpp [NVPTXAsmPrinter] do not print .align on function headers 2015-03-12 01:50:30 +00:00
MCAsmInfoCOFF.cpp
MCAsmInfoDarwin.cpp Remove MCStreamer include which isn't used here. NFC 2015-03-04 01:24:26 +00:00
MCAsmInfoELF.cpp
MCAsmStreamer.cpp Simplify use of formatted_raw_ostream. 2015-04-09 21:06:08 +00:00
MCAssembler.cpp [MC] Write padding into fragments when -mc-relax-all flag is used 2015-04-12 23:42:25 +00:00
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp Store the sh_link of ARM_EXIDX directly in MCSectionELF. 2015-04-06 04:25:18 +00:00
MCDwarf.cpp Change range-based for-loops to be -Wrange-loop-analysis clean. 2015-04-15 01:21:15 +00:00
MCELF.cpp
MCELFObjectTargetWriter.cpp Re-enable target-specific relocation table sorting and use it for Mips 2015-04-14 13:23:34 +00:00
MCELFStreamer.cpp Use raw_pwrite_stream in the object writer/streamer. 2015-04-14 22:14:34 +00:00
MCExpr.cpp MC: For variable symbols, maintain MCSymbol::Section as a cache. 2015-04-03 01:46:11 +00:00
MCInst.cpp
MCInstPrinter.cpp
MCInstrAnalysis.cpp
MCLabel.cpp
MCLinkerOptimizationHint.cpp This file should always have included MCAssembler and not MCStreamer. NFC 2015-03-04 01:24:24 +00:00
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp Use raw_pwrite_stream in the object writer/streamer. 2015-04-14 22:14:34 +00:00
MCNullStreamer.cpp
MCObjectFileInfo.cpp Don't print labels that on ELF are never used. 2015-03-11 04:20:31 +00:00
MCObjectStreamer.cpp Use raw_pwrite_stream in the object writer/streamer. 2015-04-14 22:14:34 +00:00
MCObjectWriter.cpp Remove unnecessary uses of AliasedSymbol. 2015-04-06 16:10:05 +00:00
MCRegisterInfo.cpp
MCSection.cpp Refactor how passes get a symbol at the end of a section. 2015-03-23 21:22:04 +00:00
MCSectionCOFF.cpp
MCSectionELF.cpp Use a comma after the unique keyword. 2015-04-06 16:34:41 +00:00
MCSectionMachO.cpp Implement unique sections with an unique ID. 2015-04-04 18:02:01 +00:00
MCStreamer.cpp Implement unique sections with an unique ID. 2015-04-04 18:02:01 +00:00
MCSubtargetInfo.cpp Don't print an error message when looking up the scheduling model if user specified -mcpu=help. 2015-04-02 04:27:50 +00:00
MCSymbol.cpp MC: For variable symbols, maintain MCSymbol::Section as a cache. 2015-04-03 01:46:11 +00:00
MCSymbolizer.cpp
MCTargetOptions.cpp
MCValue.cpp
MCWin64EH.cpp
MCWinEH.cpp Remove MCStreamer.h include from MCContext.h and explictly include it where necessary. NFC 2015-03-04 01:24:11 +00:00
StringTableBuilder.cpp
SubtargetFeature.cpp Make llc use getHostCPUFeatures when 'native' is specified for cpu. 2015-03-31 05:52:57 +00:00
WinCOFFObjectWriter.cpp Use raw_pwrite_stream in the object writer/streamer. 2015-04-14 22:14:34 +00:00
WinCOFFStreamer.cpp Use raw_pwrite_stream in the object writer/streamer. 2015-04-14 22:14:34 +00:00
YAML.cpp