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

23609 Commits

Author SHA1 Message Date
Peter Collingbourne
dda6a07fcf Revert r237766, "Support: Introduce LLVM_FALLTHROUGH macro."
The value of this macro seems to be very low unless we actually start
using it everywhere, and I don't have immediate plans to make that
happen.

llvm-svn: 237941
2015-05-21 19:44:44 +00:00
Derek Schuff
435b70a5c0 Fix StreamingMemoryObject to respect known object size.
The existing code for method StreamingMemoryObject.fetchToPos does not respect
the corresonding call to setKnownObjectSize(). As a result, it allows the
StreamingMemoryObject to read bytes past the object size.

This patch provides a test case, and code to fix the problem.

Patch by Karl Schimpf
Differential Revision: http://reviews.llvm.org/D8931

llvm-svn: 237939
2015-05-21 19:40:19 +00:00
Rafael Espindola
dda3f1317e Move alignment from MCSectionData to MCSection.
This starts merging MCSection and MCSectionData.

There are a few issues with the current split between MCSection and
MCSectionData.

* It optimizes the the not as important case. We want the production
of .o files to be really fast, but the split puts the information used
for .o emission in a separate data structure.

* The ELF/COFF/MachO hierarchy is not represented in MCSectionData,
leading to some ad-hoc ways to represent the various flags.

* It makes it harder to remember where each item is.

The attached patch starts merging the two by moving the alignment from
MCSectionData to MCSection.

Most of the patch is actually just dropping 'const', since
MCSectionData is mutable, but MCSection was not.

llvm-svn: 237936
2015-05-21 19:20:38 +00:00
Rafael Espindola
e11015eff3 Avoid unnecessary section switching. NFC.
llvm-svn: 237913
2015-05-21 17:00:40 +00:00
Rafael Espindola
ef656a945b Remove yet another method of creating begin and end symbol for sections.
I missed this one when first unifying how we handle begin and end symbols.

llvm-svn: 237912
2015-05-21 16:52:32 +00:00
Sanjay Patel
9c27a1a2bc don't repeat function names in comments; NFC
llvm-svn: 237911
2015-05-21 16:42:22 +00:00
Pete Cooper
ad41216bfa Size enum so we can store it as 16-bits and avoid casts. NFC
llvm-svn: 237910
2015-05-21 16:40:18 +00:00
Rafael Espindola
8bef62eb9d Use existing helper for adding a section. NFC.
llvm-svn: 237909
2015-05-21 16:19:32 +00:00
Renato Golin
f02533865a Make Triple::parseARMArch use ARMTargetParser
Simplifying Triple::parseARMArch, leaving all the parsing to ARMTargetParser.

This commit also adds AArch64 detection to ARMTargetParser canonicalization,
and a two RedHat arch names (v{6,7}hl, meaning hard-float / little-endian).

Adding enough unit tests to cover the basics. Clang checks fine.

llvm-svn: 237902
2015-05-21 13:52:20 +00:00
Duncan P. N. Exon Smith
8a5ef02df0 AsmPrinter: Compute absolute label difference directly
Create a low-overhead path for `EmitLabelDifference()` that emits a
emits an absolute number when (1) the output is an object stream and (2)
the two symbols are in the same data fragment.

This drops memory usage on Mach-O from 975 MB down to 919 MB (5.8%).
The only call is when `!doesDwarfUseRelocationsAcrossSections()` --
i.e., on Mach-O -- since otherwise an absolute offset from the start of
the section needs a relocation.  (`EmitLabelDifference()` is cheaper on
ELF anyway, since it creates 1 fewer temp symbol, and it gets called far
less often.  It's not clear to me if this is even a bottleneck there.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 237876
2015-05-21 02:41:23 +00:00
Duncan P. N. Exon Smith
5817cdc139 MC: Initialize MCSymbolData::Offset directly
Try to fix miscompile after r237873.  Looks like this union
initialization isn't legal (or at least not supported).

llvm-svn: 237875
2015-05-21 01:59:58 +00:00
Duncan P. N. Exon Smith
1b6f9e7345 MC: Simplify MCSymbolData initialization and remove MCSymbol pointer
Finally remove the `MCSymbolData::Symbol` pointer.  It was still being
used to track whether `MCSymbolData` had been initialized, but this is
better tracked by the bitfield in `MCSymbol`.

The only caller of `MCSymbolData::initialize()` was `MCAssembler`, which
(other than `Symbol`) passed in all-0 values.  Replace all that
indirection with a default constructor.

The main point is a cleanup (and there's more cleanup to do), but there
are also some small memory savings.  I measured ~989 MB down to ~975 MB,
cutting a little over 1% off the top of `llc`.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 237873
2015-05-21 01:33:03 +00:00
Duncan P. N. Exon Smith
d780f6da0c MC: Make MCSymbolData::Symbol private
Make the back-pointer from `MCSymbolData` to `MCSymbol` private,
preparing to remove the back pointer entirely.  I've already updated all
the users, although for now it's still used to indicate whether
`MCSymbol::Data` has been initialized.

llvm-svn: 237868
2015-05-21 00:49:09 +00:00
Andrew Kaylor
7532e8ed04 [WinEH] C++ EH state numbering fixes
Differential Revision: http://reviews.llvm.org/D9787

llvm-svn: 237854
2015-05-20 23:22:24 +00:00
Reid Kleckner
45341c98d0 [WinEH] Store pointers to the LSDA in the exception registration object
We aren't yet emitting the LSDA yet, so this will still fail to
assemble.

llvm-svn: 237852
2015-05-20 23:08:04 +00:00
David Blaikie
7aa3cb67dd [opaque pointer type] Pass explicit type to Load instruction creation in AutoUpgrade
llvm-svn: 237838
2015-05-20 21:46:30 +00:00
Duncan P. N. Exon Smith
cc5ca76810 MC: Use MCSymbol in LocalCommon, NFC
Switch from MCSymbolData to MCSymbol in LocalCommon.

llvm-svn: 237816
2015-05-20 18:25:40 +00:00
Pete Cooper
eba43436d0 Change Function::getIntrinsicID() to return an Intrinsic::ID. NFC.
Now that Intrinsic::ID is a typed enum, we can forward declare it and so return it from this method.

This updates all users which were either using an unsigned to store it, or had a now unnecessary cast.

llvm-svn: 237810
2015-05-20 17:16:39 +00:00
Duncan P. N. Exon Smith
55f15b8f68 MC: Update MCAssembler to use MCSymbol, NFC
Use `MCSymbol` over `MCSymbolData` where both are needed.

llvm-svn: 237803
2015-05-20 16:02:11 +00:00
Benjamin Kramer
e9491762bc [YAML] Make Node's destructor non-virtual.
Nodes aren't supposed to be destroyed polymorphically. Also make all subclasses
final to avoid non-virtual dtor warnings.

llvm-svn: 237801
2015-05-20 15:38:29 +00:00
Duncan P. N. Exon Smith
1f4ff82e51 MC: Use MCSymbol in MachObjectWriter, NFC
Replace uses of `MCSymbolData` with `MCSymbol` where both are needed, so
we can remove the backpointer.

llvm-svn: 237799
2015-05-20 15:16:14 +00:00
Duncan P. N. Exon Smith
842194f532 MC: Use MCSymbol in MCObjectWriter::isWeak(), NFC
Continue to prefer `MCSymbol` when we need both.

llvm-svn: 237798
2015-05-20 15:10:03 +00:00
Renato Golin
af6572aa97 Get Triple::getARMCPUForArch() to use TargetParser
First ARMTargetParser FIXME, conservatively changing the way we parse CPUs
in the back-end. Still not perfect, with a lot of special cases, but moving
towards a more generic solution.

Moving all logic to the target parser made some unwritten assumptions
about architectures in Clang to break. I've added a lot of architectures
required by Clang, and default to CPUs that Clang believes it should
(and I agree).

I've also added a lot of unit tests, with the correct CPU for each
architecture, and Clang seems to be working correctly, too.

It also became clear that using "unsigned ID" as the argument for the get
methods makes it hard to know what ID, so I also changed the argument names
to match the enum type names.

llvm-svn: 237797
2015-05-20 15:05:07 +00:00
Daniel Sanders
cf42b6a699 Revert r237789 - [mips] The naming convention for private labels is ABI dependant.
It works, but I've noticed that I missed several callers of createMCAsmInfo()
and many don't have a TargetMachine to provide.

llvm-svn: 237792
2015-05-20 14:18:59 +00:00
Daniel Sanders
571a176b3d [mips] The naming convention for private labels is ABI dependant.
Summary:
For N32/N64, private labels begin with '.L' but for O32 they begin with '$'.

MCAsmInfo now has an initializer function which can be used to provide information from the TargetMachine to control the assembly syntax.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: jfb, sandeep, llvm-commits, rafael

Differential Revision: http://reviews.llvm.org/D9821

llvm-svn: 237789
2015-05-20 13:16:42 +00:00
Igor Laevsky
277d7cfcc2 [StatepointLowering] Support of the gc.relocates for invoke statepoints.
This change implements support for lowering of the gc.relocates tied to the invoke statepoint.
This is acomplished by storing frame indices of the lowered values in "StatepointRelocatedValues" map inside FunctionLoweringInfo instead of storing them in per-basic block structure StatepointLowering.
After this change StatepointLowering is used only during "LowerStatepoint" call and it is not necessary to store it as a field in SelectionDAGBuilder anymore.

Differential Revision: http://reviews.llvm.org/D7798

llvm-svn: 237786
2015-05-20 11:37:25 +00:00
Craig Topper
2af3864479 [TableGen] Make some variable names consistent with their type names and just generally consistent across all of the overloads.
llvm-svn: 237775
2015-05-20 05:40:13 +00:00
Craig Topper
8546defae8 [TableGen] Don't override convertValue for some of the Init types when it does the same thing as the base class implementation.
llvm-svn: 237773
2015-05-20 05:40:06 +00:00
Peter Collingbourne
b32832c222 Support: Introduce LLVM_FALLTHROUGH macro.
llvm-svn: 237766
2015-05-20 02:44:14 +00:00
Swaroop Sridhar
8765ceb638 Add a GCStrategy for CoreCLR
This change adds a new GC strategy for supporting the CoreCLR runtime.

This strategy is currently identical to Statepoint-example GC, 
but is necessary for several upcoming changes specific to CoreCLR, such as:

1. Base-pointers not explicitly reported for interior pointers
2. Different format for stack-map encoding
3. Location of Safe-point polls: polls are only needed before loop-back edges and before tail-calls (not needed at function-entry)
4. Runtime specific handshake between calls to managed/unmanaged functions.

llvm-svn: 237753
2015-05-20 01:07:23 +00:00
Duncan P. N. Exon Smith
1b0c97740a MC: Take MCSymbol in MachObjectWriter::getSymbolAddress(), NFC
Pass through an `MCSymbol` instead of an `MCSymbolData` so we can get
rid of the back pointer.

llvm-svn: 237750
2015-05-20 00:02:39 +00:00
Duncan P. N. Exon Smith
4c0dd00c17 MC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC
Continue to canonicalize on MCSymbol instead of MCSymbolData when both
are needed.

llvm-svn: 237749
2015-05-19 23:53:20 +00:00
Akira Hatanaka
e7b801e86a Add a comment line that was accidentally dropped in r236671.
llvm-svn: 237734
2015-05-19 21:59:11 +00:00
Alexey Samsonov
ba248af49e [DWARF parser] Make DWARF parser more robust against missing compile/type units.
DWARF standard claims that each compilation/type unit header in
.debug_info/.debug_types section must be followed by corresponding
compile/type unit DIE, possibly with its children. Two situations
are possible:

 * compile/type unit DIE is missing because DWARF producer failed to
   emit it.
 * DWARF parser failed to parse unit DIE correctly, for instance if it
   contains some unsupported attributes (see r237721, for instance).

In either of these cases, the library, and the tools that use it
(llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate
checks to protect against this.

llvm-svn: 237733
2015-05-19 21:54:32 +00:00
David Blaikie
d6bee03bf9 [opaque pointer type] Provide a convenience function for creating direct CallInsts to Functions in IRBuilder
Might need a similar convenience in CallInst's ctor too, but we'll
see/will add it when it becomes useful.

llvm-svn: 237731
2015-05-19 21:47:12 +00:00
Alex Lorenz
740bc929d2 Revert r237708 (MIR serialization) - incremental buildbots became unstable.
The incremental buildbots entered a pass-fail cycle where during the fail
cycle one of the tests from this commit fails for an unknown reason. I
have reverted this commit and will investigate the cause of this problem.

llvm-svn: 237730
2015-05-19 21:41:28 +00:00
David Blaikie
dcfe53031c [opaque pointer type] Provide the ability to pass an explicit type when creating a CallInst through IRBuilder
A use for this will be added to Clang shortly. I haven't hit the
specific cases I want to cleanup in LLVM just yet.

A utility that avoids the need for this in direct calls to
llvm::Functions will be added too - since in that case the type can be
retrieved from the llvm::Function directly.

llvm-svn: 237728
2015-05-19 21:31:18 +00:00
Matthias Braun
0e49c41528 MachineInstr: Remove unused parameter.
llvm-svn: 237726
2015-05-19 21:22:20 +00:00
Alexey Samsonov
5c64f0995b [DWARF parser] Add basic support for DWZ DWARF multifile extensions.
This change implements basic support for DWARF alternate sections
proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open

LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and
DW_FORM_GNU_strp_alt, which are used as references to .debug_info and
.debug_str sections respectively, stored in a separate file, and
possibly shared between different executables / shared objects.

llvm-dwarfdump and llvm-symbolizer don't yet know how to access this
alternate debug file (usually pointed by .gnu_debugaltlink section),
but they can at lease properly parse and dump regular files, which
refer to it.

This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on
files produced by running "dwz" tool. Such files are already installed
on some modern Linux distributions.

llvm-svn: 237721
2015-05-19 20:29:28 +00:00
Sanjoy Das
4eaf966f48 Dereferenceable, dereferenceable_or_null metadata for loads
Summary:
Introduce dereferenceable, dereferenceable_or_null metadata for loads
with the same semantic as corresponding attributes.

This patch depends on http://reviews.llvm.org/D9253

Patch by Artur Pilipenko!

Reviewers: hfinkel, sanjoy, reames

Reviewed By: sanjoy, reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9365

llvm-svn: 237720
2015-05-19 20:10:19 +00:00
Pete Cooper
c6ba6101fd Remove unused MCExpr.h include from MCELF.h. NFC
llvm-svn: 237717
2015-05-19 19:20:02 +00:00
Pete Cooper
c96695a9d1 Remove unused MCRelocationInfo.h include from MCDisassembler.h. NFC
llvm-svn: 237710
2015-05-19 18:18:49 +00:00
Filipe Cabecinhas
9fd1becc70 Change a reachable unreachable to a fatal error.
Summary:
Also tagged a FIXME comment, and added information about why it breaks.

Bug found using AFL fuzz.

Reviewers: rafael, craig.topper

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9729

llvm-svn: 237709
2015-05-19 18:18:10 +00:00
Alex Lorenz
cb5500c145 MIR Serialization: print and parse LLVM IR using MIR format.
This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR 
using the MIR format. This pass is then added as a last pass when a 
'stop-after' option is used in llc. The new library adds the initial 
functionality for parsing of MIR files as well. This commit also 
extends the llc tool so that it can recognize and parse MIR input files.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames

Differential Revision: http://reviews.llvm.org/D9616

llvm-svn: 237708
2015-05-19 18:17:39 +00:00
Pete Cooper
75cb70e351 Remove unused MachineLocation.h include from MCAsmInfo.h. NFC
llvm-svn: 237707
2015-05-19 17:59:09 +00:00
Pawel Bylica
3eef2468e3 Revert "Avoid size_t -> unsigned conversion in MathExtras.h header. NFC".
llvm-svn: 237680
2015-05-19 10:51:24 +00:00
Pawel Bylica
1a52f69bfe Avoid size_t -> unsigned conversion in MathExtras.h header. NFC.
llvm-svn: 237678
2015-05-19 10:35:32 +00:00
Pawel Bylica
f46548166d Fix getSwappedBytes for double.
llvm-svn: 237673
2015-05-19 08:44:15 +00:00
Tobias Grosser
113a9e0d99 Drop unnecessary ';' after namespace
The ';' was introduced in 237642. With it in place, we get a large number of
warnings in -pedantic mode.

llvm-svn: 237667
2015-05-19 06:25:19 +00:00
Matthias Braun
ed527f2f9e SelectionDAG: Cleanup and simplify FoldConstantArithmetic
This cleans up the FoldConstantArithmetic code by factoring out the case
of two ConstantSDNodes into an own function. This avoids unnecessary
complexity for many callers who already have ConstantSDNode arguments.

This also avoids an intermeidate SmallVector datastructure and a loop
over that datastructure.

llvm-svn: 237651
2015-05-19 01:40:21 +00:00