1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

372 Commits

Author SHA1 Message Date
Daniel Dunbar
d04906b49e llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.

llvm-svn: 99563
2010-03-25 22:49:09 +00:00
Daniel Dunbar
21e9834bc1 MC: Stop restarting layout on every relaxation.
- Still O(N^2), just a faster form, and now its the MCAsmLayout's fault.

On the .s I am tuning against (combine.s from 403.gcc):
--
ddunbar@lordcrumb:MC$ diff stats-before.txt stats-after.txt
5,10c5,10
<    1728 assembler - Number of assembler layout and relaxation steps
<    7707 assembler - Number of emitted assembler fragments
<  120588 assembler - Number of emitted object file bytes
< 2233448 assembler - Number of evaluated fixups
<    1727 assembler - Number of relaxed instructions
< 6723845 mcexpr    - Number of MCExpr evaluations
---
>      3 assembler - Number of assembler layout and relaxation steps
>   7707 assembler - Number of emitted assembler fragments
> 120588 assembler - Number of emitted object file bytes
>  14796 assembler - Number of evaluated fixups
>   1727 assembler - Number of relaxed instructions
>  67889 mcexpr    - Number of MCExpr evaluations
--
Feel free to LOL at the -before numbers, if you like.

I am a little surprised we make more than 2 relaxation passes. It's pretty
trivial for us to do relaxation out-of-order if that would give a speedup.

llvm-svn: 99543
2010-03-25 19:35:56 +00:00
Daniel Dunbar
4935edfb58 MC: Simplify main section layout process by moving alignment into LayoutSection.
llvm-svn: 99529
2010-03-25 18:16:42 +00:00
Daniel Dunbar
8d2b718d91 MC: Sink Section address assignment into LayoutSection.
llvm-svn: 99528
2010-03-25 18:16:38 +00:00
Daniel Dunbar
f793969cd1 MC/Mach-O: Switch to MCSectionData::getOrdinal.
llvm-svn: 99504
2010-03-25 08:08:54 +00:00
Daniel Dunbar
de3fc7d4d8 MC: Explicity track section and fragment ordinals.
llvm-svn: 99500
2010-03-25 07:10:11 +00:00
Daniel Dunbar
276acc64a9 Fix -Asserts warning.
llvm-svn: 99499
2010-03-25 07:10:05 +00:00
Daniel Dunbar
797b44b26c MC: Route access to SectionData offset and file size through MCAsmLayout.
llvm-svn: 99474
2010-03-25 02:00:07 +00:00
Daniel Dunbar
4b6b2a1a1f MC: Route access to Fragment offset and effective size through MCAsmLayout.
llvm-svn: 99473
2010-03-25 02:00:02 +00:00
Daniel Dunbar
70fbcbc1cd MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.
llvm-svn: 99467
2010-03-25 01:03:24 +00:00
Daniel Dunbar
cfa1820a7e MC: Fix refacto in MCExpr evaluation, I mistakenly replaced a fragment address with a symbol address.
- This fixes the integrated-as nightly test regressions.

llvm-svn: 99466
2010-03-25 01:03:17 +00:00
Daniel Dunbar
3a79d30c6c MC: Direct all {fragment,section,symbol} address access through the MCAsmLayout object.
llvm-svn: 99380
2010-03-24 03:43:40 +00:00
Daniel Dunbar
0ce1e410cd MC: Sprinkle in some more interesting statistics.
llvm-svn: 99350
2010-03-23 23:47:14 +00:00
Daniel Dunbar
bd005bdfe9 llvm-mc: Fast path EvaluateAbsolute of constants.
llvm-svn: 99348
2010-03-23 23:47:07 +00:00
Daniel Dunbar
14c84e0c3b MC: Switch to using MCInst fragments to do relaxation.
Also, both MCMachOStreamer and MCAssembler are now target independent!

llvm-svn: 99256
2010-03-23 05:09:03 +00:00
Daniel Dunbar
47743ae59a MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
llvm-svn: 99249
2010-03-23 03:13:05 +00:00
Daniel Dunbar
b33d212057 MC: Add TargetAsmBackend::WriteNopData and use to eliminate some target dependencies in MCMachOStreamer and MCAssembler.
llvm-svn: 99248
2010-03-23 02:36:58 +00:00
Daniel Dunbar
ae8d914c58 MC: Tweak MCInstFragment to include the encoded data and fixups, so that we don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place.
llvm-svn: 99244
2010-03-23 01:39:05 +00:00
Jeffrey Yasskin
b9c181ea1a Put MCSectionCOFF::Name into the MCContext instead of leaking it.
llvm-svn: 99231
2010-03-22 23:26:12 +00:00
Daniel Dunbar
0f6983752f MC: Add MCInstFragment, not used yet.
llvm-svn: 99229
2010-03-22 23:16:48 +00:00
Daniel Dunbar
1836f73559 Add a FIXME.
llvm-svn: 99228
2010-03-22 23:16:43 +00:00
Daniel Dunbar
4b5c134c5b MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment would do, and sprinkle in some const.
llvm-svn: 99218
2010-03-22 21:49:41 +00:00
Daniel Dunbar
a8a7a9b5aa Simplify.
llvm-svn: 99217
2010-03-22 21:49:38 +00:00
Daniel Dunbar
38fd48e06b MCInst: Add ::dump_pretty.
llvm-svn: 99216
2010-03-22 21:49:34 +00:00
Daniel Dunbar
6a91d2767b MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead of a MCDataFragment). Object files should only need the generic MCFragment features.
llvm-svn: 99205
2010-03-22 20:35:50 +00:00
Daniel Dunbar
e7900757bd MC/Mach-O: Factor out getOrCreateDataFragment().
llvm-svn: 99204
2010-03-22 20:35:46 +00:00
Daniel Dunbar
264c33a099 MC: Eliminate MCFragment::getMaxFileSize.
llvm-svn: 99203
2010-03-22 20:35:43 +00:00
Daniel Dunbar
6ea8fe65e7 MC: Share the MCAsmLayout object, although its still not used for anything important.
llvm-svn: 99202
2010-03-22 20:35:35 +00:00
Daniel Dunbar
6b3e18d2c4 Better fix for r98994, MachObjectWriterImpl wasn't intended to be virtual.
llvm-svn: 99031
2010-03-20 01:58:40 +00:00
Rafael Espindola
5b074c72ee Fix -Wnon-virtual-dtor warning.
llvm-svn: 98994
2010-03-19 21:26:46 +00:00
Daniel Dunbar
3c66c7a3c1 MC/Mach-O/x86_64: Add relocation support.
- This is "extraordinarily" Darwin 'as' compatible. See the litany of FIXMEs littered about for more information.
 - There are a few cases which seem to clearly be 'as' bugs which I have left unsupported, and there is one cases where we diverge but should fix if it blocks diffing .o files (Darwin 'as' ends up widening a jump unnecessarily).
 - 403.gcc build, runs, and diffs equivalently to the 'as' built version now (using llvm-mc). However, it builds so slowly that I wouldn't recommend trying it quite yet. :)

llvm-svn: 98974
2010-03-19 18:07:55 +00:00
Daniel Dunbar
c687bf7cb4 MC: Add TargetAsmBackend::createObjectWriter.
- MCAssembler is now object-file independent, although we will surely need more work to fully support ELF/COFF.

llvm-svn: 98955
2010-03-19 10:43:26 +00:00
Daniel Dunbar
7252b48af1 MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
llvm-svn: 98954
2010-03-19 10:43:23 +00:00
Daniel Dunbar
c47468760e MC: Sink code emitter into MCAssembler.
llvm-svn: 98953
2010-03-19 10:43:18 +00:00
Daniel Dunbar
74330a6389 MC/Mach-O: Move to MachObjectWriter.{h,cpp}.
llvm-svn: 98952
2010-03-19 10:43:15 +00:00
Daniel Dunbar
287ff291e3 MC: Add TargetAsmBackend::isVirtualSection hook.
llvm-svn: 98950
2010-03-19 09:29:03 +00:00
Daniel Dunbar
c9bcbc86a8 MC: Split MCObjectWriter out of MCAssembler.cpp.
llvm-svn: 98949
2010-03-19 09:28:59 +00:00
Daniel Dunbar
1053342967 MCAssembler: Pull out MCObjectWriter class.
llvm-svn: 98948
2010-03-19 09:28:55 +00:00
Daniel Dunbar
3444d755d2 MCAssembler: Move ApplyFixup to the TargetAsmBackend, this is a target specific not object writer specific task.
llvm-svn: 98947
2010-03-19 09:28:12 +00:00
Daniel Dunbar
b2aafb5fe9 MC/Mach-O: Lift the fixup evaluation and application up (to the same place), and eliminate MCAsmFixup::FixedValue.
llvm-svn: 98944
2010-03-19 07:09:47 +00:00
Daniel Dunbar
01aca21857 MC/Mach-O: Factor out ExecutePostLayoutBinding, to separate the post-layout changes the object writer may need to make to the assembler from the actual .o writing.
llvm-svn: 98943
2010-03-19 07:09:33 +00:00
Daniel Dunbar
9fac4ed7f7 MC/Mach-O: Lift relocation emission logic a bit higher to separate evaluation / relocation handling from the actual .o writing.
llvm-svn: 98942
2010-03-19 07:09:18 +00:00
Chris Lattner
32452cf12f fix an MCInstPrinter leak that jyasskin pointed out:
createAsmStreamer now takes ownership of the instprinter.

llvm-svn: 98939
2010-03-19 05:48:53 +00:00
Daniel Dunbar
d2393ccdad MC/Mach-O: Add isScatteredFixupFullyResolved, which implements the correct algorithm (used on x86_64) for determining whether an evaluated fixup is fully resolved (doesn't need relocation).
- Test cases will follow, once we have x86_64 relocation support.

llvm-svn: 98926
2010-03-19 03:18:18 +00:00
Daniel Dunbar
0a3b893a3e MC/Mach-O/x86_64: Add getAtom[ForAddress].
- These find the defining symbol which identifies the containing atom for a symbol or address. They are currently very slow, but will be eliminated eventually.

llvm-svn: 98925
2010-03-19 03:18:15 +00:00
Daniel Dunbar
f8e4be91ff MC/Mach-O: Factor out isScatteredFixupFullyResolvedSimple predicate, and fix some corner cases.
llvm-svn: 98924
2010-03-19 03:18:12 +00:00
Daniel Dunbar
377fb36813 MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a made up term to refer to non-temporary labels + temporary labels in sections-which-require symbols. For Darwin, it corresponds to symbols which effectively define an atom.
llvm-svn: 98923
2010-03-19 03:18:09 +00:00
Daniel Dunbar
8b149ce7fd MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will need this for accessing to symbol modifiers.
llvm-svn: 98791
2010-03-18 00:59:10 +00:00
Daniel Dunbar
26cbc4b1a3 MC/Darwin: Add a new target hook for whether the target uses "reliable" symbol differences, basically whether the assembler should attempt to understand atoms when using scattered symbols.
Also, avoid some virtual call overhead.

llvm-svn: 98789
2010-03-18 00:58:53 +00:00
Chris Lattner
962d3d700b fix GetOrCreateTemporarySymbol to require a name, clients
should use CreateTempSymbol() if they don't care about the
name.

llvm-svn: 98712
2010-03-17 05:41:18 +00:00