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

22941 Commits

Author SHA1 Message Date
Akira Hatanaka
5581d69ed8 [AsmPrinter] Use the per-function subtarget to emit inline asm instructions that
are not at the file level.

Previously, the default subtarget created from the target triple was used to
emit inline asm instructions. Compilation would fail in cases where the feature
bits necessary to assemble an inline asm instruction in a function weren't set.

llvm-svn: 232392
2015-03-16 18:02:16 +00:00
Daniel Sanders
5301c4f2c1 Revert r232374: [hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.
2007-12-17-InvokeAsm.ll fails on the buildbot but not on my own system. Will investigate.

llvm-svn: 232376
2015-03-16 14:21:22 +00:00
Daniel Sanders
5e28709fa3 [hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constraints.
Summary:
But still handle them the same way since I don't know how they differ on
this target.

No functional change intended.

Reviewers: kparzysz, adasgupt

Reviewed By: kparzysz, adasgupt

Subscribers: colinl, llvm-commits

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

llvm-svn: 232374
2015-03-16 13:54:19 +00:00
Daniel Sanders
6dc30f40bf Make each target map all inline assembly memory constraints to InlineAsm::Constraint_m. NFC.
Summary:
This is instead of doing this in target independent code and is the last
non-functional change before targets begin to distinguish between
different memory constraints when selecting code for the ISD::INLINEASM
node.

Next, each target will individually move away from the idea that all
memory constraints behave like 'm'.

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 232373
2015-03-16 13:13:41 +00:00
Justin Bogner
6484f6de8c InstrProf: Do a better job of reading coverage mapping data.
This code was casting regions of a memory buffer to a couple of
different structs. This is wrong in a few ways:

1. It breaks aliasing rules.
2. If the buffer isn't aligned, it hits undefined behaviour.
3. It completely ignores endianness differences.
4. The structs being defined for this aren't specifying their padding
   properly, so this doesn't even represent the data properly on some
   platforms.

This commit is mostly NFC, except that it fixes reading coverage for
32 bit binaries as a side effect of getting rid of the mispadded
structs. I've included a test for that.

I've also baked in that we only handle little endian more explicitly,
since that was true in practice already. I'll fix this to handle
endianness properly in a followup commit.

llvm-svn: 232346
2015-03-16 06:55:45 +00:00
Benjamin Kramer
09f8543349 Factor the iterators of ImmutableSet/ImmutableMap into a common base class
This simplifies code quite a bit and brings the iterators closer to
C++'s iterator concept. No functional change intended.

llvm-svn: 232319
2015-03-15 13:26:03 +00:00
David Majnemer
e4b732cd4e ImmutableSet: Rename Self to SelfTy to make it more clear it is a type
No functional change intended.

llvm-svn: 232317
2015-03-15 07:09:20 +00:00
David Majnemer
ade8f38a4d PostOrderIterator: Remove stray semicolon
llvm-svn: 232316
2015-03-15 07:09:18 +00:00
Duncan P. N. Exon Smith
da8c0123c6 IR: Default the Metadata::dump() argument "harder" after r232275
Use an overload instead of a default argument for `Metadata::dump()`.
The latter seems to require calling `dump(nullptr)` explicitly when
using a debugger, where as the former doesn't.

Other than utility for debugging, there's NFC here.

llvm-svn: 232315
2015-03-15 06:53:32 +00:00
David Majnemer
6c4a4dd821 Restore the gcc build
llvm-svn: 232314
2015-03-15 06:11:24 +00:00
David Blaikie
be05df9e18 Remove iterator I accidentally left behind
llvm-svn: 232312
2015-03-15 03:21:20 +00:00
David Blaikie
d2224f8d9b Remove use of reserved identifier _Iterator
llvm-svn: 232311
2015-03-15 03:18:21 +00:00
David Blaikie
8cc4a0c8c7 Remove use of reserved identifiers in Twine
llvm-svn: 232310
2015-03-15 03:17:28 +00:00
David Blaikie
9b68e6accb Remove use of reserved identifier and some excess 'inline' usage
llvm-svn: 232309
2015-03-15 03:11:26 +00:00
David Blaikie
60a1bdcf4c Remove reserved identifier & some unnecessary 'inline'
llvm-svn: 232308
2015-03-15 03:11:24 +00:00
David Blaikie
c8b3422daa Remove use of reserved identifier
& some unnecessary 'inline' keywords

llvm-svn: 232307
2015-03-15 03:03:41 +00:00
David Blaikie
7dccf1828b Remove use of unreserved identifier (_Self)
And some unnecessary inline keywords

llvm-svn: 232304
2015-03-15 01:42:28 +00:00
David Blaikie
feec0ec448 Remove use of a reserved identifier
(& some unnecessary 'inline' keywords, too)

llvm-svn: 232303
2015-03-15 01:40:42 +00:00
David Blaikie
a779c869b7 Remove use of reserved identifier
The C++ standard reserves all identifiers starting with an underscore
followed by an uppercase letter for the implementation for any use.

llvm-svn: 232302
2015-03-15 01:37:01 +00:00
Duncan P. N. Exon Smith
27ff67c213 DbgIntrinsicInst: Downcast to specialized MDNodes in accessors
Change accessors to downcast to `MDLocalVariable` and `MDExpression`,
now that we have -verify checks in place to confirm that it's safe.

llvm-svn: 232299
2015-03-15 01:23:20 +00:00
David Blaikie
39ee3848e4 Remove some unnecessary 'inline' keywords
llvm-svn: 232298
2015-03-15 01:21:37 +00:00
David Blaikie
38fa06a730 IntervalIterator: Add move semantics rather than relying on broken implicit copy ctor (found with -Wdeprecated)
We were just getting lucky because the copy ctor would be elided by RVO.

llvm-svn: 232297
2015-03-15 01:21:34 +00:00
Duncan P. N. Exon Smith
9f52f307c2 Verifier: Check debug info intrinsic arguments
Verify that debug info intrinsic arguments are valid.  (These checks
will not recurse through the full debug info graph, so they don't need
to be cordoned of in `DebugInfoVerifier`.)

With those checks in place, changing the `DbgIntrinsicInst` accessors to
downcast to `MDLocalVariable` and `MDExpression` is natural (added isa
specializations in `Metadata.h` to support this).

Added tests to `test/Verifier` for the new -verify checks, and fixed the
debug info in all the in-tree tests.

If you have out-of-tree testcases that have started to fail to -verify,
hopefully the verify checks are helpful.  The most likely problem is
that the expression argument is `!{}` (instead of `!MDExpression()`).

llvm-svn: 232296
2015-03-15 01:21:30 +00:00
David Blaikie
441e94fa44 [opaque pointer type] IRBuilder gep migration progress
llvm-svn: 232294
2015-03-15 01:03:19 +00:00
David Blaikie
71a16e92de [opaque pointer type] gep API migration
This concludes the GetElementPtrInst::Create migration, thus marking the
beginning of the IRBuilder::CreateGEP* migration to come.

llvm-svn: 232280
2015-03-14 21:40:10 +00:00
Duncan P. N. Exon Smith
40ea3b1320 IR: Make Metadata::print() reliable and useful
Replumb the `AsmWriter` so that `Metadata::print()` is generally useful.
(Similarly change `Metadata::printAsOperand()`.)

- `SlotTracker` now has a mode where all metadata will be correctly
  numbered when initializing a `Module`.  Normally, `Metadata` only
  referenced from within `Function`s gets numbered when the `Function`
  is incorporated.
- `Metadata::print()` and `Metadata::printAsOperand()` (and
  `Metadata::dump()`) now take an optional `Module` argument.  When
  provided, `SlotTracker` is initialized with the new mode, and the
  numbering will be complete and consistent for all calls to `print()`.
- `Value::print()` uses the new `SlotTracker` mode when printing
  intrinsics with `MDNode` operands, `MetadataAsValue` operands, or the
  bodies of functions.  Thus, metadata numbering will be consistent
  between calls to `Metadata::print()` and `Value::print()`.
- `Metadata::print()` (and `Metadata::dump()`) now print the full
  definition of `MDNode`s:

    !5 = !{!6, !"abc", !7}

  This matches behaviour for `Value::print()`, which includes the name
  of instructions.
- Updated call sites in `Verifier` to call `print()` instead of
  `printAsOperand()`.

All this, so that `Verifier` can print out useful failure messages that
involve `Metadata` for PR22777.

Note that `Metadata::printAsOperand()` previously took an optional
`bool` and `Module` operand.  The former was cargo-culted from
`Value::printAsOperand()` and wasn't doing anything useful.  The latter
didn't give consistent results (without the new `SlotTracker` mode).

llvm-svn: 232275
2015-03-14 20:19:36 +00:00
David Blaikie
7279c7f872 [opaque pointer type] more gep API migrations
Adding nullptr to all the IRBuilder stuff because it's the first thing
that fails to build when testing without the back-compat functions, so
I'll keep having to re-add these locally for each chunk of migration I
do. Might as well check them in to save me the churn. Eventually I'll
have to migrate these too, but I'm going breadth-first.

llvm-svn: 232270
2015-03-14 19:24:04 +00:00
Benjamin Kramer
0f26f87dee array_pod_sort: Since we're checking the length anyways also ignore one-element ranges
Sorting them is obviously a noop and we can skip the libc call. This is
surprisingly common in clang. NFC.

llvm-svn: 232265
2015-03-14 14:53:14 +00:00
David Blaikie
2db52814fd [opaque pointer type] Start migrating GEP creation to explicitly specify the pointee type
I'm just going to migrate these in a pretty ad-hoc & incremental way -
providing the backwards compatible API for now, then locally removing
it, fixing a few callers, adding it back in and commiting those callers.
Rinse, repeat.

The assertions should ensure that if I get this wrong we'll find out
about it and not just have one giant patch to revert, recommit, revert,
recommit, etc.

llvm-svn: 232240
2015-03-14 01:53:18 +00:00
Frederic Riss
d9dbe1b44c DWARFDebugRangeList: make the list of entries available to clients.
For users like llvm-dsymutil that want to have access to the encoded
debug_ranges entries.

llvm-svn: 232230
2015-03-13 23:30:07 +00:00
Rafael Espindola
20325e7adb Be lazy about loading metadata in IRObjectFile.
This speeds up llvm-ar building lib64/libclangSema.a with debug IR files
from 8.658015807 seconds to just 0.351036519 seconds :-)

llvm-svn: 232221
2015-03-13 21:54:20 +00:00
David Blaikie
3c00f3082e [opaque pointer type] Bitcode support for explicit type parameter on the gep operator
This happened to be fairly easy to support backwards compatibility based
on the number of operands (old format had an even number, new format has
one more operand so an odd number).

test/Bitcode/old-aliases.ll already appears to test old gep operators
(if I remove the backwards compatibility in the BitcodeReader, this and
another test fail) so I'm not adding extra test coverage here.

llvm-svn: 232216
2015-03-13 21:03:36 +00:00
David Blaikie
ea5be8083a Simplify expression
llvm-svn: 232214
2015-03-13 21:03:30 +00:00
Manman Ren
3b5ee180c5 Add a parameter for getLazyBitcodeModule to lazily load Metadata.
We only defer loading metadata inside ParseModule when ShouldLazyLoadMetadata
is true and we have not loaded any Metadata block yet.

This commit implements all-or-nothing loading of Metadata. If there is a
request to load any metadata block, we will load all deferred metadata blocks.

We make sure the deferred metadata blocks are loaded before we materialize any
function or a module.

The default value of the added parameter ShouldLazyLoadMetadata for
getLazyBitcodeModule is false, so the default behavior stays the same.

We only set the parameter to true when creating LTOModule in local contexts.
These can only really be used for parsing symbols, so it's unnecessary to ever
load the metadata blocks.

If we are going to enable lazy-loading of Metadata for other usages of
getLazyBitcodeModule, where deferred metadata blocks need to be loaded, we can
expose BitcodeReader::materializeMetadata to Module, similar to
Module::materialize.

rdar://19804575

llvm-svn: 232198
2015-03-13 19:24:30 +00:00
Joerg Sonnenberger
2c4547654b Improve wording of newline handling.
llvm-svn: 232195
2015-03-13 19:05:24 +00:00
Daniel Sanders
b2b69459a8 Recommit r232027 with PR22883 fixed: Add infrastructure for support of multiple memory constraints.
The operand flag word for ISD::INLINEASM nodes now contains a 15-bit
memory constraint ID when the operand kind is Kind_Mem. This constraint
ID is a numeric equivalent to the constraint code string and is converted
with a target specific hook in TargetLowering.

This patch maps all memory constraints to InlineAsm::Constraint_m so there
is no functional change at this point. It just proves that using these
previously unused bits in the encoding of the flag word doesn't break
anything.

The next patch will make each target preserve the current mapping of
everything to Constraint_m for itself while changing the target independent
implementation of the hook to return Constraint_Unknown appropriately. Each
target will then be adapted in separate patches to use appropriate
Constraint_* values.

PR22883 was caused the matching operands copying the whole of the operand flags
for the matched operand. This included the constraint id which needed to be
replaced with the operand number. This has been fixed with a conversion
function. Following on from this, matching operands also used the operand
number as the constraint id. This has been fixed by looking up the matched
operand and taking it from there. 

llvm-svn: 232165
2015-03-13 12:45:09 +00:00
Richard Smith
65409cec95 Fix build break in this code. Nothing uses this header, but the modules
buildbot builds it anyway and was angry because of this.

llvm-svn: 232139
2015-03-13 03:56:27 +00:00
Sanjay Patel
13a9b5db63 [X86, AVX2] Replace inserti128 and extracti128 intrinsics with generic shuffles
This should complete the job started in r231794 and continued in r232045:
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.

AVX2 introduced proper integer variants of the hacked integer insert/extract
C intrinsics that were created for this same functionality with AVX1.

This should complete the removal of insert/extract128 intrinsics.

The Clang precursor patch for this change was checked in at r232109.

llvm-svn: 232120
2015-03-12 23:16:18 +00:00
Hal Finkel
dc4180d54f Revert "r232027 - Add infrastructure for support of multiple memory constraints"
This (r232027) has caused PR22883; so it seems those bits might be used by
something else after all. Reverting until we can figure out what else to do.

Original commit message:

The operand flag word for ISD::INLINEASM nodes now contains a 15-bit
memory constraint ID when the operand kind is Kind_Mem. This constraint
ID is a numeric equivalent to the constraint code string and is converted
with a target specific hook in TargetLowering.

This patch maps all memory constraints to InlineAsm::Constraint_m so there
is no functional change at this point. It just proves that using these
previously unused bits in the encoding of the flag word doesn't break anything.

The next patch will make each target preserve the current mapping of
everything to Constraint_m for itself while changing the target independent
implementation of the hook to return Constraint_Unknown appropriately. Each
target will then be adapted in separate patches to use appropriate Constraint_*
values.

llvm-svn: 232093
2015-03-12 20:09:39 +00:00
Frederic Riss
aaf2dea062 [ADT] IntervalMap: use AlignedCharArrayUnion.
Currently IntervalMap would assert when used with keys bigger than host
pointers. This patch uses the AlignedCharArrayUnion functionality to
overcome that limitation.

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

llvm-svn: 232079
2015-03-12 18:45:07 +00:00
Yaron Keren
28b68fa9de Add missing include guards.
llvm-svn: 232078
2015-03-12 18:39:54 +00:00
Sanjay Patel
1912cfcc7b IRBuilder: add a CreateShuffleVector function that takes an ArrayRef of int
This is a convenience function to ease mask creation of ShuffleVectors
in AutoUpgrade and other places.

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

llvm-svn: 232047
2015-03-12 15:27:07 +00:00
Sanjay Patel
aa9ea9aae7 [X86, AVX] replace vextractf128 intrinsics with generic shuffles
Now that we've replaced the vinsertf128 intrinsics, 
do the same for their extract twins.

This is very much like D8086 (checked in at r231794):
We want to replace as much custom x86 shuffling via intrinsics
as possible because pushing the code down the generic shuffle
optimization path allows for better codegen and less complexity
in LLVM.

This is also the LLVM sibling to the cfe D8275 patch.

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

llvm-svn: 232045
2015-03-12 15:15:19 +00:00
Daniel Sanders
4eee6f840d Add infrastructure for support of multiple memory constraints.
Summary:
The operand flag word for ISD::INLINEASM nodes now contains a 15-bit
memory constraint ID when the operand kind is Kind_Mem. This constraint
ID is a numeric equivalent to the constraint code string and is converted
with a target specific hook in TargetLowering.

This patch maps all memory constraints to InlineAsm::Constraint_m so there
is no functional change at this point. It just proves that using these
previously unused bits in the encoding of the flag word doesn't break anything.

The next patch will make each target preserve the current mapping of
everything to Constraint_m for itself while changing the target independent
implementation of the hook to return Constraint_Unknown appropriately. Each
target will then be adapted in separate patches to use appropriate Constraint_*
values.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, jholewinski, llvm-commits

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

llvm-svn: 232027
2015-03-12 11:00:48 +00:00
Davide Italiano
6d0dbecedf [Object/ELF] Add support for setVisibility()
This is a prerequisite to implement symbol visibility for ELF
in lld.

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

llvm-svn: 232020
2015-03-12 07:48:25 +00:00
Jingyue Wu
764ac5a7c6 [NVPTXAsmPrinter] do not print .align on function headers
Summary:
PTX does not allow .align directives on function headers.

Fixes PR21551.

Test Plan: test/Codegen/NVPTX/function-align.ll

Reviewers: eliben, jholewinski

Reviewed By: eliben, jholewinski

Subscribers: llvm-commits, eliben, jpienaar, jholewinski

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

llvm-svn: 232004
2015-03-12 01:50:30 +00:00
Reid Kleckner
ae151db0a9 Make llvm.eh.actions an intrinsic and add docs for it
These docs *don't* match the way WinEHPrepare uses them yet, and
verifier support isn't implemented either. The implementation will come
after the documentation text is reviewed and agreed upon.

llvm-svn: 232003
2015-03-12 01:45:37 +00:00
Reid Kleckner
997aab28ac Stop calling DwarfEHPrepare from WinEHPrepare
Instead, run both EH preparation passes, and have them both ignore
functions with unrecognized EH personalities. Pass delegation involved
some hacky code for creating an AnalysisResolver that we don't need now.

llvm-svn: 231995
2015-03-12 00:36:20 +00:00
Mehdi Amini
94c8770ed5 Move the DataLayout to the generic TargetMachine, making it mandatory.
Summary:
I don't know why every singled backend had to redeclare its own DataLayout.
There was a virtual getDataLayout() on the common base TargetMachine, the
default implementation returned nullptr. It was not clear from this that
we could assume at call site that a DataLayout will be available with
each Target.

Now getDataLayout() is no longer virtual and return a pointer to the
DataLayout member of the common base TargetMachine. I plan to turn it into
a reference in a future patch.

The only backend that didn't have a DataLayout previsouly was the CPPBackend.
It now initializes the default DataLayout. This commit is NFC for all the
other backends.

Test Plan: clang+llvm ninja check-all

Reviewers: echristo

Subscribers: jfb, jholewinski, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231987
2015-03-12 00:07:24 +00:00
Andrew Kaylor
6bed959c78 Extended support for native Windows C++ EH outlining
Differential Review: http://reviews.llvm.org/D7886

llvm-svn: 231981
2015-03-11 23:22:06 +00:00