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

114316 Commits

Author SHA1 Message Date
Toma Tabacu
b4f7eabf1c [mips] Rename the LA/LI/DLI TableGen definitions and classes. NFC.
Summary:
Use more reasonable names for these pseudo-instructions.
As there's only one definition tied to any one of these classes, I named them with abbreviated versions of their respective class' name.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 231240
2015-03-04 13:01:14 +00:00
Vasileios Kalintiris
c838645a84 [mips] Keep the parameter list of Filler::searchRange() consistent. NFC.
Summary:
Move the "Filler" parameter to the end of the parameter list as it is,
conceptually, the only output parameter of that function.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 231239
2015-03-04 12:37:58 +00:00
Chandler Carruth
0fe0191603 [MBP] Fix a really horrible bug in MachineBlockPlacement, but behind
a flag for now.

First off, thanks to Daniel Jasper for really pointing out the issue
here. It's been here forever (at least, I think it was there when
I first wrote this code) without getting really noticed or fixed.

The key problem is what happens when two reasonably common patterns
happen at the same time: we outline multiple cold regions of code, and
those regions in turn have diamonds or other CFGs for which we can't
just topologically lay them out. Consider some C code that looks like:

  if (a1()) { if (b1()) c1(); else d1(); f1(); }
  if (a2()) { if (b2()) c2(); else d2(); f2(); }
  done();

Now consider the case where a1() and a2() are unlikely to be true. In
that case, we might lay out the first part of the function like:

  a1, a2, done;

And then we will be out of successors in which to build the chain. We go
to find the best block to continue the chain with, which is perfectly
reasonable here, and find "b1" let's say. Laying out successors gets us
to:

  a1, a2, done; b1, c1;

At this point, we will refuse to lay out the successor to c1 (f1)
because there are still un-placed predecessors of f1 and we want to try
to preserve the CFG structure. So we go get the next best block, d1.

... wait for it ...

Except that the next best block *isn't* d1. It is b2! d1 is waaay down
inside these conditionals. It is much less important than b2. Except
that this is exactly what we didn't want. If we keep going we get the
entire set of the rest of the CFG *interleaved*!!!

  a1, a2, done; b1, c1; b2, c2; d1, f1; d2, f2;

So we clearly need a better strategy here. =] My current favorite
strategy is to actually try to place the block whose predecessor is
closest. This very simply ensures that we unwind these kinds of CFGs the
way that is natural and fitting, and should minimize the number of cache
lines instructions are spread across.

It also happens to be *dead simple*. It's like the datastructure was
specifically set up for this use case or something. We only push blocks
onto the work list when the last predecessor for them is placed into the
chain. So the back of the worklist *is* the nearest next block.

Unfortunately, a change like this is going to cause *soooo* many
benchmarks to swing wildly. So for now I'm adding this under a flag so
that we and others can validate that this is fixing the problems
described, that it seems possible to enable, and hopefully that it fixes
more of our problems long term.

llvm-svn: 231238
2015-03-04 12:18:08 +00:00
Vasileios Kalintiris
b31cdd49c8 [mips] Specify the correct value type when combining a CMovFP node.
This commit fixes a bug introduced in r230956 where we were creating
CMovFP_{T,F} nodes with multiple return value types (one for each operand).
With this change the return value type of the new node is the same as the
value type of the True/False operands of the original node.

llvm-svn: 231237
2015-03-04 12:10:18 +00:00
Daniel Jasper
3a2dd1b264 Add a flag to experiment with outlining optional branches.
In a CFG with the edges A->B->C and A->C, B is an optional branch.

LLVM's default behavior is to lay the blocks out naturally, i.e. A, B,
C, in order to improve code locality and fallthroughs. However, if a
function contains many of those optional branches only a few of which
are taken, this leads to a lot of unnecessary icache misses. Moving B
out of line can work around this.

Review: http://reviews.llvm.org/D7719
llvm-svn: 231230
2015-03-04 11:05:34 +00:00
Kristof Beyls
4e1076f140 Fix PR22408 - LLVM producing AArch64 TLS relocations that GNU linkers cannot handle yet.
As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the GNU linkers
ld.bfd and ld.gold currently only support a subset of the whole range of AArch64
ELF TLS relocations. Furthermore, they assume that some of the code sequences to
access thread-local variables are produced in a very specific sequence.
When the sequence is not as the linker expects, it can silently mis-relaxe/mis-optimize
the instructions.
Even if that wouldn't be the case, it's good to produce the exact sequence,
as that ensures that linkers can perform optimizing relaxations.

This patch:

* implements support for 16MiB TLS area size instead of 4GiB TLS area size. Ideally clang
  would grow an -mtls-size option to allow support for both, but that's not part of this patch.
* by default doesn't produce local dynamic access patterns, as even modern ld.bfd and ld.gold
  linkers do not support the associated relocations. An option (-aarch64-elf-ldtls-generation)
  is added to enable generation of local dynamic code sequence, but is off by default.
* makes sure that the exact expected code sequence for local dynamic and general dynamic
  accesses is produced, by making use of a new pseudo instruction. The patch also removes
  two (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing AArch64-specific pseudo
  SDNode instructions that are superseded by the new one (TLSDESC_CALLSEQ).

llvm-svn: 231227
2015-03-04 09:12:08 +00:00
Craig Topper
20da4fe8fb [Tablegen] Use correct result number variables with the pattern nodes they go with when handling SDTCisSameAs. No functional change as they are always both 0 unless you try to define a multi result type profile that uses SDTCisSame on one of the other results.
llvm-svn: 231226
2015-03-04 09:04:54 +00:00
David Blaikie
3dff41547c Explicitly default DenseMapTest::CtorTest::operator=
Using the implicit default copy assignment operator in the presence of a
user-declared copy ctor is deprecated in C++11.

llvm-svn: 231225
2015-03-04 07:57:45 +00:00
David Blaikie
1d38351176 Remove explicit RNSuccIterator copy assignment in favor of implicit default
Asserting that the source and destination iterators are from the same
region is unnecessary - there's no reason to disallow reassignment from
any regions, so long as they aren't compared.

llvm-svn: 231224
2015-03-04 07:51:50 +00:00
David Blaikie
9b5f68b129 use = default instead of {}
llvm-svn: 231223
2015-03-04 07:35:04 +00:00
David Blaikie
e62694bb59 Make format_object_base explicitly copyable, so format_objects can be copied without relying on the implicit copy ctor
Use of the implicit copy ctor is deprecated in C++11 in the presence of
a user declared dtor.

llvm-svn: 231222
2015-03-04 07:35:02 +00:00
David Blaikie
0c92652183 Devirtualize ~parser<T> by making it protected in base classes and making derived classes final
These objects are never owned/destroyed polymorphically, so there's no
need for a virtual dtor.

llvm-svn: 231221
2015-03-04 07:29:01 +00:00
David Blaikie
23f9722d00 Avoid copying parser objects
Use of their copy members is deprecated since they have a user-declared
dtor.

llvm-svn: 231220
2015-03-04 07:28:59 +00:00
Michael Kuperstein
c46a58c60e [DAGCombine] Fix a bug in a BUILD_VECTOR combine
When trying to convert a BUILD_VECTOR into a shuffle, we try to split a single source vector that is twice as wide as the destination vector. 
We can not do this when we also need the zero vector to create a blend.
This fixes PR22774.

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

llvm-svn: 231219
2015-03-04 07:27:39 +00:00
David Blaikie
33666a8426 Make OptionValue explicitly copyable
Since OptionValue (& its base classes) have user-declared dtors, use of
the implicit copy ctor/assignment operator is deprecated in C++11.
Provide them explicitly (defaulted) to avoid depending on this
deprecated feature.

llvm-svn: 231218
2015-03-04 07:09:53 +00:00
David Blaikie
73831788f6 Devirtualize OptionValue::~OptionValue in favor of protected in the base, with final derived classes
These objects are never polymorphically owned, so there's no need for
virtual dtors - just make the dtor protected in the base classes, and
make the derived classes final.

llvm-svn: 231217
2015-03-04 06:57:14 +00:00
Davide Italiano
02e7db63b7 [MC][Target] Implement support for R_X86_64_SIZE{32,64}.
Differential Revision:	D7990
Reviewed by:	rafael, majnemer

llvm-svn: 231216
2015-03-04 06:49:39 +00:00
Zachary Turner
077c624adf [llvm-pdbdump] Display full enum definitions.
This will now display enum definitions both at the global
scope as well as nested inside of classes.  Additionally,
it will no longer display enums at the global scope if the
enum is nested.  Instead, it will omit the definition of
the enum globally and instead emit it in the corresponding
class definition.

llvm-svn: 231215
2015-03-04 06:09:53 +00:00
Chaoren Lin
4c82c612a6 Revert "[ADT] fail-fast iterators for DenseMap"
This reverts commit 4b7263d855006988854036b4a4891fcf19aebe65.

r231125 http://reviews.llvm.org/D7931

This was causing many LLDB tests to fail on OS X, Linux, and FreeBSD.

https://bpaste.net/show/6a23e1f53623

llvm-svn: 231214
2015-03-04 06:05:37 +00:00
Frederic Riss
ff6a5cb9e4 Move emitDIE and emitAbbrevs to AsmPrinter. NFC.
(They are called emitDwarfDIE and emitDwarfAbbrevs in their new home)

llvm-dsymutil wants to reuse that code, but it doesn't have a DwarfUnit or
a DwarfDebug object to call those. It has access to an AsmPrinter though.

Having emitDIE in the AsmPrinter also removes the DwarfFile dependency
on DwarfDebug, and thus the patch drops that field.

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

llvm-svn: 231210
2015-03-04 02:30:17 +00:00
Frederic Riss
ddd86366cc Constify AsmPrinter passed to DIE methods.
llvm-svn: 231209
2015-03-04 02:30:08 +00:00
Filipe Cabecinhas
1f8bf333db Fix the test for r231201. We don't crash anymore.
llvm-svn: 231207
2015-03-04 02:09:40 +00:00
David Blaikie
22e443bb29 Workaround MSVC not providing implicit move members
llvm-svn: 231204
2015-03-04 02:07:51 +00:00
Rui Ueyama
196ee67671 Object: Add range iterators to Archive symbols
Also define operator* for symbol iterator just like Archive children iterator.

llvm-svn: 231203
2015-03-04 02:05:06 +00:00
Mehdi Amini
62f77ca5f4 Use report_fatal_error instead of unreachable for -fast-isel-abort
Suggestion by Andrea Di Biagio

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231201
2015-03-04 01:48:39 +00:00
David Blaikie
731e1ed968 unique_ptrify ValID::ConstantStructElts
llvm-svn: 231200
2015-03-04 01:41:01 +00:00
David Blaikie
e3c56b2d84 LLParser: Avoid copying ValIDs, the copy ctor is deprecated in C++11 due to the presence of a user-declared dtor
llvm-svn: 231199
2015-03-04 01:40:07 +00:00
Rafael Espindola
eb2f517737 Use the vanilla func_end symbol for .size.
No need to create yet another temp symbol.

llvm-svn: 231198
2015-03-04 01:35:23 +00:00
Pete Cooper
a0f6bd0d3b Remove MCStreamer include which isn't used here. NFC
llvm-svn: 231195
2015-03-04 01:24:26 +00:00
Pete Cooper
b101a03b5e This file should always have included MCAssembler and not MCStreamer. NFC
llvm-svn: 231194
2015-03-04 01:24:24 +00:00
Pete Cooper
4a534a2133 Remove MCStreamer.h include from MCContext.h and explictly include it where necessary. NFC
llvm-svn: 231193
2015-03-04 01:24:11 +00:00
David Blaikie
ffa6b17b59 Recommit r231168: unique_ptrify LiveRange::segmentSet
GCC 4.7's libstdc++ doesn't have std::map::emplace, but it does have
std::unordered_map::emplace, and the use case here doesn't appear to
need ordering. The container has been changed in a separate/precursor
patch, and now this patch should hopefully build cleanly even with
GCC 4.7.

& then I realized the order of the container did matter, so extra
handling of ordering was added in r231189.

Original commit message:
This makes LiveRange non-copyable, and LiveInterval is already
non-movable (due to the explicit dtor), so now it's non-copyable and
non-movable.

Fix the one case where we were relying on the (deprecated in C++11)
implicit copy ctor of LiveInterval (which happened to work because the
ctor created an object with a null segmentSet, so double-deleting the
null pointer was fine).

llvm-svn: 231192
2015-03-04 01:20:33 +00:00
Eric Christopher
3c27e28cc5 Weaken the check for a specific movl on the twoaddr-coalesce-3
test - we only care that there are two moves in the loop and not
which part is relative to which register anyhow.

llvm-svn: 231191
2015-03-04 01:19:17 +00:00
Eric Fiselier
85833e58f4 Reverse the order libc++ and libc++abi are added in CMake.
llvm-svn: 231190
2015-03-04 01:16:43 +00:00
David Blaikie
0b4edcf797 Recommit r231175: Change LiveStackAnalysis::SS2IntervalMap from std::map to std::unordered_map
The order of this container was needed at one point - so, at that point
create a temporary array of pointers, sort those, then iterate them.
This keeps lookup efficient (& the lesser issue, of allowing the use of
emplace... ), object identity preserved, and ordered iteration in the
one place that requires it.

While this has no functional change, I realize it does mean allocating
an extra data structure and performing a sort - so if this looks suspect
to anyone regarding perf characteristics, I'm all ears.

llvm-svn: 231189
2015-03-04 01:15:53 +00:00
Filipe Cabecinhas
566e4876d5 Fix the x86-upgrade-avx2-vbroadcast.ll test by commenting the CHECK lines
llvm-svn: 231187
2015-03-04 00:49:12 +00:00
Matthias Braun
13805aa1b9 RegisterCoalescer: Gracefully continue if subrange merging fails.
There is a known bug where the register coalescer fails to merge
subranges when multiple ranges end up in the "overflow" bit 32 of the
lanemasks. A proper fix for this is complicated so for now this is a
workaround which lets the register coalescer drop the subregister
liveness information (we just loose some precision by that) and
continue.

llvm-svn: 231186
2015-03-04 00:43:50 +00:00
Rafael Espindola
64eb6d620c Drop the "eh_" from eh_func_begin and eh_func_end.
They will be used for more than eh tables.

llvm-svn: 231185
2015-03-04 00:27:43 +00:00
David Blaikie
584f0b5274 Revert "unique_ptrify LiveRange::segmentSet"
Apparently something does care about ordering of LiveIntervals... so
revert all that stuff (r231175, r231176, r231177) & take some time to
re-evaluate.

llvm-svn: 231184
2015-03-04 00:15:02 +00:00
Philip Reames
59aed68d01 [RewriteStatepointsForGC] Fix a relocation bug w.r.t values defined by invoke instructions
RewriteStatepointsForGC pass emits an alloca for each GC pointer which will be relocated. It then inserts stores after def and all relocations, and inserts loads before each use as well. In the end, mem2reg is used to update IR with relocations in SSA form.

However, there is a problem with inserting stores for values defined by invoke instructions. The code didn't expect a def was a terminator instruction, and inserting instructions after these terminators resulted in malformed IR.

This patch fixes this problem by handling invoke instructions as a special case. If the def is an invoke instruction, the store will be inserted at the beginning of the normal destination block. Since return value from invoke instruction does not dominate the unwind destination block, no action is needed there.

Patch by: Chen Li
Differential Revision: http://reviews.llvm.org/D7923

llvm-svn: 231183
2015-03-04 00:13:52 +00:00
Juergen Ributzka
a0c556be5c Remove 'llvm.x86.avx2.vbroadcasti128' intrinsic.
The intrinsic is no longer generated by the front-end. Remove the intrinsic and
auto-upgrade it to a vector shuffle.

Reviewed by Nadav

This is related to rdar://problem/18742778.

llvm-svn: 231182
2015-03-04 00:13:25 +00:00
Reid Kleckner
6e4477efc1 Document the LLVM "thunk" attribute added back in r226708
llvm-svn: 231181
2015-03-04 00:08:56 +00:00
Eric Christopher
a02ce78817 Update twoaddr-coalesce-3.ll to run on darwin and linux machines:
a) Default relocation model differences,
b) Different numbers of # in comments

llvm-svn: 231178
2015-03-03 23:56:20 +00:00
David Blaikie
0b1af584f7 Add missing header include
llvm-svn: 231177
2015-03-03 23:54:35 +00:00
David Blaikie
15dab25a2e Recommit r231168: unique_ptrify LiveRange::segmentSet
GCC 4.7's libstdc++ doesn't have std::map::emplace, but it does have
std::unordered_map::emplace, and the use case here doesn't appear to
need ordering. The container has been changed in a separate/precursor
patch, and now this patch should hopefully build cleanly even with
GCC 4.7.

Original commit message:
This makes LiveRange non-copyable, and LiveInterval is already
non-movable (due to the explicit dtor), so now it's non-copyable and
non-movable.

Fix the one case where we were relying on the (deprecated in C++11)
implicit copy ctor of LiveInterval (which happened to work because the
ctor created an object with a null segmentSet, so double-deleting the
null pointer was fine).

llvm-svn: 231176
2015-03-03 23:53:03 +00:00
David Blaikie
cceec39421 Change LiveStackAnalysis::SS2IntervalMap from std::map to std::unordered_map
This use case doesn't appear to benefit from ordering, and
std::unordered_map has the advantage that it supports emplace (the
LiveInterval values really shouldn't be copyable or movable & they won't
be in a near-future patch).

llvm-svn: 231175
2015-03-03 23:53:00 +00:00
David Blaikie
697241f146 Revert "unique_ptrify LiveRange::segmentSet"
GCC 4.7 *shakes fist* (doesn't have std::map::emplace... )

This reverts commit r231168.

llvm-svn: 231173
2015-03-03 23:44:07 +00:00
Jan Wen Voung
3c49412d27 Move TargetLibraryInfo data from two files into one common .def file.
Summary:
This makes it more obvious that the enum definition and the
"StandardName" array is in sync. Mechanically refactored w/ a
python script.

Test Plan: still compiles

Subscribers: llvm-commits

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

llvm-svn: 231172
2015-03-03 23:41:58 +00:00
David Blaikie
b042ba9ed4 unique_ptrify LiveRange::segmentSet
This makes LiveRange non-copyable, and LiveInterval is already
non-movable (due to the explicit dtor), so now it's non-copyable and
non-movable.

Fix the one case where we were relying on the (deprecated in C++11)
implicit copy ctor of LiveInterval (which happened to work because the
ctor created an object with a null segmentSet, so double-deleting the
null pointer was fine).

llvm-svn: 231168
2015-03-03 23:30:40 +00:00
Kostya Serebryany
285f1f0e41 [sanitizer/coverage] Add AFL-style coverage counters (search heuristic for fuzzing).
Introduce -mllvm -sanitizer-coverage-8bit-counters=1
which adds imprecise thread-unfriendly 8-bit coverage counters.

The run-time library maps these 8-bit counters to 8-bit bitsets in the same way
AFL (http://lcamtuf.coredump.cx/afl/technical_details.txt) does:
counter values are divided into 8 ranges and based on the counter
value one of the bits in the bitset is set.
The AFL ranges are used here: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+.

These counters provide a search heuristic for single-threaded
coverage-guided fuzzers, we do not expect them to be useful for other purposes.

Depending on the value of -fsanitize-coverage=[123] flag,
these counters will be added to the function entry blocks (=1),
every basic block (=2), or every edge (=3).

Use these counters as an optional search heuristic in the Fuzzer library.
Add a test where this heuristic is critical.

llvm-svn: 231166
2015-03-03 23:27:02 +00:00