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

139 Commits

Author SHA1 Message Date
Daniel Dunbar
55c1bf55fe MC: Use accessors for access to MCAsmFixup.
llvm-svn: 104697
2010-05-26 15:18:31 +00:00
Daniel Dunbar
a06aa279f4 MC: Eliminate MCFragment vtable, which was unnecessary.
llvm-svn: 104689
2010-05-26 06:50:57 +00:00
Daniel Dunbar
7fee3c7b28 MC: Switch to completely lazy layout.
- The eliminates the last major algorithmic problem with MC.

llvm-svn: 103754
2010-05-14 00:51:14 +00:00
Daniel Dunbar
66c2ccec2d MC: Extend MCAsmLayout to explicitly track which fragments have been layed out, and enforce several invariants to LayoutFragment to ensure we only do layout in a sensible order.
llvm-svn: 103753
2010-05-14 00:37:21 +00:00
Daniel Dunbar
bfc0b2083d MC: Implicitly assign section addresses when the previous fragment is layed out.
llvm-svn: 103752
2010-05-14 00:37:17 +00:00
Daniel Dunbar
11467b2eaa MC: Switch MCFragment to storing the layout order index, not its index in the file.
llvm-svn: 103751
2010-05-14 00:37:14 +00:00
Daniel Dunbar
b2a98e0a16 MC: Change LayoutSection() to only do the section initializiation.
Also, elimminate MCAsmLayout::set*, which are no longer needed.

llvm-svn: 103750
2010-05-14 00:37:11 +00:00
Daniel Dunbar
86825a9719 MC: Move Layout{Fragment,Section} into MCAsmLayout, and add LayoutFile().
llvm-svn: 103738
2010-05-13 20:40:12 +00:00
Daniel Dunbar
b142c00db4 MC: Factor out MCAssembler::ComputeFragmentSize.
llvm-svn: 103724
2010-05-13 18:35:06 +00:00
Daniel Dunbar
5a601f9e09 MC: Add section layout order indices to MCSectionData.
llvm-svn: 103715
2010-05-13 15:17:26 +00:00
Daniel Dunbar
aa67ae072c MC: Move ordinal calculation, to make sure fragments synthesized for layout get assigned ordinals properly.
llvm-svn: 103711
2010-05-13 08:43:37 +00:00
Daniel Dunbar
e72ef430f7 MC: Create dummy fragments to avoid ever having empty sections, which simplifies layout.
llvm-svn: 103710
2010-05-13 08:43:34 +00:00
Daniel Dunbar
5ef1bcbb97 MC: Add MCAsmLayout::FragmentReplaced() helper function.
llvm-svn: 103709
2010-05-13 08:43:31 +00:00
Daniel Dunbar
5759287db9 Fix -Asserts warning.
llvm-svn: 103697
2010-05-13 03:50:50 +00:00
Daniel Dunbar
561f55c1af MC: Eliminate MCSectionData::{,Address,File}Size, which can now be computed by
utility functions.

llvm-svn: 103695
2010-05-13 03:19:50 +00:00
Daniel Dunbar
a81966a973 MC: Switch to using explicit MCAlignFragments with OnlyAlignAddress bit instead
of manually doing padding/editing layout in LayoutSection().
    - This probably seems like six-of-one and half-dozen of another, but there
      is a method to my madness.

llvm-svn: 103693
2010-05-13 02:34:14 +00:00
Daniel Dunbar
3fc379596a MC: Add MCAlignFragment::OnlyAlignAddress bit. This is a bit of magic that says the align fragment shouldn't contribute to the logical section size, it is will be used for cleaning up the code to handle section alignment.
llvm-svn: 103690
2010-05-13 01:10:26 +00:00
Daniel Dunbar
ec3a2ac5ed MC: Add MCSectionData::AddressSize, which is the size of the address space consumed by the section. This can differ from both the section logical size, and the section size on disk (although the current code handles this without making an explicit distinction).
llvm-svn: 103689
2010-05-13 01:10:22 +00:00
Daniel Dunbar
de7caed021 MC: Move MCAlignFragment::EmitNops value out of the constructor.
llvm-svn: 103665
2010-05-12 22:56:23 +00:00
Daniel Dunbar
cf11e2a0a5 MC: Eliminate MCZeroFillFragment, it is no longer needed.
llvm-svn: 103664
2010-05-12 22:51:38 +00:00
Daniel Dunbar
0040c2c393 MC: Explicitly check that only virtual fragments appear in virtual sections.
llvm-svn: 103663
2010-05-12 22:51:35 +00:00
Daniel Dunbar
08bcc3a6fc MC: Switch MCFillFragment to storing total fill size instead of a count. This allows using ValueSize==0 to represent a virtual fill.
llvm-svn: 103662
2010-05-12 22:51:32 +00:00
Daniel Dunbar
d3f60794d8 MC: Drop support for alignment in ZeroFill fragment, we can just use
MCAlignFragments for this.

llvm-svn: 103661
2010-05-12 22:51:27 +00:00
Daniel Dunbar
e8f8a29de5 Simplify.
llvm-svn: 103651
2010-05-12 21:47:55 +00:00
Daniel Dunbar
6a495507e5 MC: Factor out MCAssembler::LayoutFragment
llvm-svn: 103649
2010-05-12 21:35:25 +00:00
Daniel Dunbar
43dad4fc73 MC: Tweak section layout to not relying on accumulating address value.
llvm-svn: 103648
2010-05-12 21:35:22 +00:00
Daniel Dunbar
7b72c3c7a0 MC: Simplify LayoutSection to just take the index of the section to layout.
llvm-svn: 103627
2010-05-12 17:56:47 +00:00
Daniel Dunbar
adca38558e MC: Track section layout order explicitly, and use to simplify.
llvm-svn: 103616
2010-05-12 15:42:59 +00:00
Daniel Dunbar
e5a79692cf MC/Mach-O/x86_64: Add a new hook for checking whether a particular section can
be diced into atoms, and adjust getAtom() to take this into account.
 - This fixes relocations to symbols in fixed size literal sections, for
   example.

llvm-svn: 103532
2010-05-12 00:38:17 +00:00
Daniel Dunbar
7670f69e42 MC/Mach-O x86_64: Switch to using fragment atom symbol.
- This eliminates getAtomForAddress() (which was a linear search) and
   simplifies getAtom().
 - This also fixes some correctness problems where local labels at the same
   address as non-local labels could be assigned to the wrong atom.

llvm-svn: 103480
2010-05-11 17:22:50 +00:00
Daniel Dunbar
00ffbb63da MC/Mach-O: Explicitly track atoms, as represented by their defining symbol, for each fragment (not yet used).
llvm-svn: 103438
2010-05-10 22:45:09 +00:00
Daniel Dunbar
b7e0c07d88 llvm-mc: Fix case were we would skip a line in the .s file after an instruction
match failure.

Also, fixes a few memory leak FIXMEs.

llvm-svn: 102986
2010-05-04 00:33:07 +00:00
Chris Lattner
80b41881bc rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100709
2010-04-07 22:58:41 +00:00
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
de3fc7d4d8 MC: Explicity track section and fragment ordinals.
llvm-svn: 99500
2010-03-25 07:10:11 +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
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
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
Daniel Dunbar
0f6983752f MC: Add MCInstFragment, not used yet.
llvm-svn: 99229
2010-03-22 23:16:48 +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