145800 Commits

Author SHA1 Message Date
NAKAMURA Takumi
f2c4103083 PDB/BinaryStreamTest.cpp: Appease mingw to avoid std::errc::no_buffer_space.
Unfortunately, mingw's libstdc++ doesn't provide winsock2 errors.
That said, we should avoid raising OS-oriented error code in our code.

For now, I suggest to define custom error from std::error_category.
See also; https://reviews.llvm.org/D20592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 05:06:31 +00:00
Adam Nemet
90c4f1ee16 [LV] These remark should have been missed remarks
The practice in LV is that we emit analysis remarks and then finally report
either a missed or applied remark on the final decision whether vectorization
is taking place.  On this code path, we were closing with an analysis remark.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 04:31:15 +00:00
Mohammad Shahid
b2ec2bd1f6 [SLP] Fixes the bug due to absence of in order uses of scalars which needs to be available
for VectorizeTree() API.This API uses it for proper mask computation to be used in shufflevector IR.
The fix is to compute the mask for out of order memory accesses while building the vectorizable tree
instead of actual vectorization of vectorizable tree.

Reviewers: mkuper

Differential Revision: https://reviews.llvm.org/D30159

Change-Id: Id1e287f073fa4959713ba545fa4254db5da8b40d

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 03:51:54 +00:00
Matt Arsenault
eaeac1f1aa AMDGPU: Re-do update for branch-relaxation test
Modify the test so that it is still testing something
closer to what it was intended to originally.

I think the original intent was to test the situation where
there was a branch on execz and then unconditional branch
required relaxing.With the change in r296539,
there was no longer and execz branch.

Change the test so that there is now an execz branch inserted.
There is no longer an unconditional branch after the execz branch,
so this might need to be tricked in some other way to keep that
there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296574 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 03:36:04 +00:00
Daniel Berlin
108b26d6d3 clang-format GenericDomTreeConstruction.h, since the current formatting makes it look like their is a bug in the loop indentation, and there is not
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 02:50:46 +00:00
Daniel Berlin
037e1535be Only run the overloaded-intrinsic-name.ll test once, with FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:56:41 +00:00
Daniel Berlin
ee517039d6 Keep attributes, calling convention, etc, when remangling intrinsic
Summary: Fix issue reported where intrinsic calling convention is dropped after r295253.

Reviewers: sanjoy

Subscribers: materi, llvm-commits

Differential Revision: https://reviews.llvm.org/D30422

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296563 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:49:13 +00:00
Zachary Turner
22de43b01e Move constexpr arrays out of class definition.
GCC Linker doesn't seem to like this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:17:31 +00:00
Eugene Zelenko
ca953345f8 [DebugInfo] Fix some Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296559 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:14:23 +00:00
Zachary Turner
2848ebe89e Fix signed / unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296557 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:07:10 +00:00
Zachary Turner
00d9a548e8 [PDB] Add an additional test for BinaryStreamRef.
A bug was uncovered where if you have a StreamRef whose ViewOffset
is > 0, then when you call readLongestContiguousChunk it will
succeed even when it shouldn't, and it always return you a
buffer that was taken as if the ViewOffset was 0.

Fixed this bug and added a test for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296556 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:04:16 +00:00
Zachary Turner
854f9fd147 [PDB] Add tests for BinaryStream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 01:03:53 +00:00
Adam Nemet
a3f7c6ad38 [opt-viewer] Suggest installing the faster parser (libYAML)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 00:54:40 +00:00
Ahmed Bougacha
fb5e79a577 [CodeGen] Remove dead FastISel code after SDAG emitted a tailcall.
When SDAGISel (top-down) selects a tail-call, it skips the remainder
of the block.

If, before that, FastISel (bottom-up) selected some of the (no-op) next
few instructions, we can end up with dead instructions following the
terminator (selected by SDAGISel).

We need to erase them, as we know they aren't necessary (in addition to
being incorrect).

We already do this when FastISel falls back on the tail-call itself.
Also remove the FastISel-emitted code if we fallback on the
instructions between the tail-call and the return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296552 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 00:43:42 +00:00
Ahmed Bougacha
7fdaba3e0f [GlobalISel] Replace all combined G_EXTRACT uses.
Iterating on the use-list we're modifying doesn't work: after the first
iteration, the use-list iterator will point to a MachineOperand
referencing the new register.  This caused us to skip the other uses to
replace.

Instead, use MRI.replaceRegWith(), which accounts for this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 00:43:39 +00:00
Paul Robinson
12246fec03 Add missing module/license header. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 00:14:42 +00:00
Adam Nemet
2f28d0c7ba [opt-viewer] Handle column number 0
The asm-printer now emits remarks with function location which have
unspecified (0) source column number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:59:46 +00:00
Adam Nemet
d2478aa1d8 Revert "(HEAD, origin/master, origin/HEAD, master) [LV] These should missed remarks"
This reverts commit r296544.

This got committed by accident.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:54:27 +00:00
Adam Nemet
2a73470ef0 [LV] These should missed remarks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296544 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:48:58 +00:00
Adrian Prantl
56d0100cfa Teach the IR verifier to reject conflicting debug info for function arguments.
Conflicting debug info for function arguments causes hard-to-debug
assertions in the DWARF backend, so the Verifier should reject it.
For performance reasons this only checks function arguments from
non-inlined debug intrinsics for now.

rdar://problem/30520286

This reapplies r295749 after fixing PR32042.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:48:42 +00:00
Paul Robinson
28ca8c3c86 [DWARFv5] llvm-mc support for new unit header.
This is for running the assembler with -g (to emit DWARF describing
the assembler source).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296541 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:40:46 +00:00
Dan Gohman
24efa5d42e [WebAssembly] Convert the remaining unit tests to the new wasm-object-file target.
To facilitate this, add a new hidden command-line option to disable
the explicit-locals pass. That causes llc to emit invalid code that doesn't
have all locals converted to get_local/set_local, however it simplifies
testwriting in many cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:37:04 +00:00
Daniel Berlin
f5d4310169 Update AMDGPU test branch-relaxation.ll for changes after post-dom fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:35:24 +00:00
Eli Friedman
a918957b28 [ARM] Don't generate deprecated T1 STM.
This prevents generating stm r1!, {r0, r1} on Thumb1, where value
stored for r1 is UNKONWN.

Patch by Zhaoshi Zheng.

Differential Revision: https://reviews.llvm.org/D27910



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296538 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:32:55 +00:00
Krzysztof Parzyszek
b45bb28e1f [Hexagon] Generate extract instructions more aggressively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296537 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:27:33 +00:00
Kostya Serebryany
27a5a29184 [libFuzzer] remove usage of the old coverage instrumentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 23:23:48 +00:00
Daniel Berlin
379e7c2248 Fix PR 24415 (at least), by making our post-dominator tree behavior sane.
Summary:
Currently, our post-dom tree tries to ignore and remove the effects of
infinite loops.  It fails miserably at this, because it tries to do it
ahead of time, and thus can only detect self-loops, and any other type
of infinite loop, it pretends doesn't exist at all.

This can, in a bunch of cases, lead to wrong answers and a completely
empty post-dom tree.

Wrong answer:

```
declare void foo()
define internal void @f() {
entry:
  br i1 undef, label %bb35, label %bb3.i

bb3.i:
  call void @foo()
  br label %bb3.i

bb35.loopexit3:
  br label %bb35

bb35:
  ret void
}
```
We get:
```
Inorder PostDominator Tree:
  [1]  <<exit node>> {0,7}
    [2] %bb35 {1,6}
      [3] %bb35.loopexit3 {2,3}
      [3] %entry {4,5}
```

This is a trivial modification of the testcase for PR 6047
Note that we pretend bb3.i doesn't exist.
We also pretend that bb35 post-dominates entry.

While it's true that it does not exit in a theoretical sense, it's not
really helpful to try to ignore the effect and pretend that bb35
post-dominates entry.  Worse, we pretend the infinite loop does
nothing (it's usually considered a side-effect), and doesn't even
exist, even when it calls a function.  Sadly, this makes it impossible
to use when you are trying to move code safely.  All compilers also
create virtual or real single exit nodes (including us), and connect
infinite loops there (which this patch does).  In fact, others have
worked around our behavior here, to the point of building their own
post-dom trees:
https://zneak.github.io/fcd/2016/02/17/structuring.html and pointing
out the region infrastructure is near-useless for them with postdom in
this state :(

Completely empty post-dom tree:
```
define void @spam() #0 {
bb:
  br label %bb1

bb1:                                              ; preds = %bb1, %bb
  br label %bb1

bb2:                                              ; No predecessors!
  ret void
}
```
Printing analysis 'Post-Dominator Tree Construction' for function 'foo':
=============================--------------------------------
Inorder PostDominator Tree:
  [1]  <<exit node>> {0,1}

:(

(note that even if you ignore the effects of infinite loops, bb2
should be present as an exit node that post-dominates nothing).

This patch changes post-dom to properly handle infinite loops and does
root finding during calculation to prevent empty tress in such cases.

We match gcc's (and the canonical theoretical) behavior for infinite
loops (find the backedge, connect it to the exit block).

Testcases coming as soon as i finish running this on a ton of random graphs :)

Reviewers: chandlerc, davide

Subscribers: bryant, llvm-commits

Differential Revision: https://reviews.llvm.org/D29705

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 22:57:50 +00:00
Peter Collingbourne
d2170754c4 gold-plugin: Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 22:40:30 +00:00
Krzysztof Parzyszek
3fa39c0a81 [Hexagon] Fix instruction selection for sign-extending i1 to i64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 22:37:01 +00:00
Dean Michael Berris
7577713c9b [XRay][Docs] Update the XRay documentation
Summary:
Update the XRay docs to mention new subcomands to the llvm-xray tool,
and details on FDR mode logging. Also list down available libraries for
use part of the LLVM distribution.

Reviewers: rSerge, pelikan, echristo, timshen, sdardis, rengolin

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D30395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 22:01:26 +00:00
Kevin Enderby
505b77004a Actually add error handling to unpacking the dyld compact bind and
other tables.  Providing a helpful error message to what the error is and
where the error occurred based on which opcode it was associated with.

There have been handful of bug fixes dealing with bad bind info in
object files, r294021 and r249845, which only put a band aid on the
problem after a bad bind table was created after unpacking from
its compact info.  In these cases a bind table should have never been
created and an error should have simply been generated.

This change puts in place the plumbing to allow checking and returning
of an error when the compact info is unpacked.  This follows the model
of iterators that can fail that Lang Hanes designed when fixing the problem
for bad archives r275316 (or r275361).

This change uses one of the existing test cases that now causes an
error instead of printing <<bad library ordinal>> after a bad bind table
is created.  The error uses the offset into the opcode table as shown with
the macOS dyldinfo(1) tool to indicate where the error is and which
opcode and which parameter is in error.

For example the exiting test case has this lazy binding opcode table:

% dyldinfo -opcodes test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 
…
lazy binding opcodes:
0x0000 BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x02, 0x00000010)
0x0002 BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(2)

In the test case the binary only has one library so setting the library 
ordinal to the value of 2 in the BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
opcode at 0x0002 above is an error.  This now produces this error message:

% llvm-objdump -lazy-bind bad-ordinal.macho-x86_64 
…
llvm-objdump: 'bad-ordinal.macho-x86_64': truncated or malformed object (for BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB bad library ordinal: 2 (max 1) for opcode at: 0x2)

This change provides the plumbing for the error handling and one example
of an error message.  Other error checks and test cases will be added in follow
on commits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296527 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 21:47:07 +00:00
Mehdi Amini
00684f5d0c Mark some libFuzzer tests as XFAIL'd on Darwin
We're bringing up a bot on Green Dragon right now:

http://green.lab.llvm.org/green/view/Experimental/job/libFuzzer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 21:45:59 +00:00
Matt Arsenault
1a0fc1885e AMDGPU: Fix types for VOP_I16_I16_I16
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296523 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 21:31:45 +00:00
Matt Arsenault
743da63164 AMDGPU: Add definition for v_swap_b32
This is somewhat tricky because there are two
pairs of tied operands, and it isn't allowed to be
VOP3 encoded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296519 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 21:09:04 +00:00
Matt Arsenault
0911246281 AMDGPU: Add definition for v_xad_u32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 20:27:30 +00:00
Paul Robinson
77bf4a4c38 [DWARFv5] Emit new unit header format.
Requesting DWARF v5 will now get you the new compile-unit and
type-unit headers.  llvm-dwarfdump will also recognize them.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 20:24:55 +00:00
Matt Arsenault
c1a133abee AMDGPU: Add ds_nop to assembler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296513 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 20:15:46 +00:00
Matt Arsenault
efc7556475 AMDGPU: Add definitions for ds_{read|write}_b{96|128}
It's not clear to me if this is always better than
doing ds_write2_b64 This adds the constraint of
a 128-bit register input instead of a pair of
64-bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 20:15:43 +00:00
Stanislav Mekhanoshin
0248798c22 [AMDGPU] Add second pass of the scheduler
If during scheduling we have identified that we cannot keep optimistic
occupancy increase critical register pressure limit and try scheduling
of the whole function again. In this case blocks with smaller pressure
will have a chance for better scheduling.

Differential Revision: https://reviews.llvm.org/D30442

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296506 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 19:20:33 +00:00
Sanjay Patel
0e267e802a [DAGCombiner] use dyn_cast values in foldSelectOfConstants(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296502 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:41:49 +00:00
Zachary Turner
584a5d174f Fix -Wcovered-switch-default warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:35:40 +00:00
Francis Visoiu Mistrih
114240abb9 [LCG] Fix EXPENSIVE_CHECKS typo. NFC
Differential Revision: https://reviews.llvm.org/D30434

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:34:55 +00:00
Dehao Chen
e26c421c66 Add function importing info from samplepgo profile to the module summary.
Summary: For SamplePGO, the profile may contain cross-module inline stacks. As we need to make sure the profile annotation happens when all the hot inline stacks are expanded, we need to pass this info to the module importer so that it can import proper functions if necessary. This patch implemented this feature by emitting cross-module targets as part of function entry metadata. In the module-summary phase, the metadata is used to build call edges that points to functions need to be imported.

Reviewers: mehdi_amini, tejohnson

Reviewed By: tejohnson

Subscribers: davidxl, llvm-commits

Differential Revision: https://reviews.llvm.org/D30053

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:09:44 +00:00
James Y Knight
f563b7840e Workaround MSVC bug when using TrailingObjects from a template.
MSVC appears to be getting confused as to whether OverloadToken is
supposed to be public or not.

This was discovered by code in Swift, and has been reported to
microsoft by hughbe:
https://connect.microsoft.com/VisualStudio/feedback/details/3116517

Differential Revision: https://reviews.llvm.org/D29880

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:05:41 +00:00
Sanjay Patel
9070606d47 [x86] add alternate IR tests for select of constants; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296496 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:02:38 +00:00
Zachary Turner
54a7acb455 [PDB] Add BinaryStreamError.
This migrates the stream code away from MSFError to using its
own custom Error class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 17:49:34 +00:00
Brad Smith
6bca79c2f9 Set default CPU for OpenBSD/arm to Cortex-A8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 17:28:35 +00:00
David Bozier
a786b77c39 Fix issue with test case. Make test x86_64 specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 17:25:38 +00:00
Stanislav Mekhanoshin
004075214e [AMDGPU] New method to estimate register pressure
This change introduces new method to estimate register pressure in
GCNScheduler. Standard RPTracker gives huge error due to the following
reasons:

1. It does not account for live-ins or live-outs if value is not used
in the region itself. That creates a huge error in a very common case
if there are a lot of live-thu registers.
2. It does not properly count subregs.
3. It assumes a register used as an input operand can be reused as an
output. This is not always possible by itself, this is not what RA
will finally do in many cases for various reasons not limited to RA's
inability to do so, and this is not so if the value is actually a
live-thu.

In addition we can now see clear separation between live-in pressure
which we cannot change with the scheduling and tentative pressure
which we can change.

Differential Revision: https://reviews.llvm.org/D30439

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296491 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 17:22:39 +00:00
Konstantin Zhuravlyov
b1d063dce5 [AMDGPU] Change amd_kernel_code_t's minor version to 1
- We do emit amd_kernel_code_t v1.1

Differential Revision: https://reviews.llvm.org/D30433


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 17:17:52 +00:00