135280 Commits

Author SHA1 Message Date
Sanjay Patel
dbf9b41991 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:27:58 +00:00
Sanjay Patel
2913e8c9be auto-ggenerate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275685 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 16:24:06 +00:00
Sanjay Patel
05d1283c18 [InstCombine] reassociate logic ops with constants separated by a zext
This is a partial implementation of a general fold for associative+commutative operators:
(op (cast (op X, C2)), C1) --> (cast (op X, op (C1, C2)))
(op (cast (op X, C2)), C1) --> (op (cast X), op (C1, C2))

There are 7 associative operators and 13 cast types, so this could potentially go a lot further.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275684 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 15:20:19 +00:00
Hal Finkel
4fe9cc7cb0 Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"
This reverts commit r275042; the initial commit triggered self-hosting failures
on ARM/AArch64. James Molloy identified the problematic backend code, which has
been disabled in r275677. Trying again...

Original commit message:

Let FuncAttrs infer the 'returned' argument attribute

A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 07:21:28 +00:00
Hal Finkel
aa47729233 Disable this-return argument forwarding on ARM/AArch64
r275042 reverted function-attribute inference for the 'returned' attribute
because the feature triggered self-hosting failures on ARM and AArch64. James
Molloy determined that the this-return argument forwarding feature, which
directly ties the returned input argument to the returned value, was the cause.
It seems likely that this forwarding code contains, or triggers, a subtle bug.
Disabling for now until we can track that down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 07:07:29 +00:00
Yaxun Liu
384c6423e5 Re-commit [AMDGPU] Add metadata for runtime
Attempting to fix lit test failure on ppc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275676 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 05:09:21 +00:00
Craig Topper
108967b172 [AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented with patterns selecting existing instructions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 03:42:59 +00:00
Matthias Braun
3346c15107 llc: Add support for -run-pass none
This does not schedule any passes besides the ones necessary to
construct and print the machine function. This is useful to test .mir
file reading and printing.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:59 +00:00
Matthias Braun
4bd6d7fb73 llc: Move pass query/add code into an own function; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:15 +00:00
Matthias Braun
7e0a8cbfdc ARM/MIR: Move test from MIR to CodeGen/ARM directory
test/CodeGen/MIR/ARM/ARMLoadStoreDBG.mir is an actual test for the ARM
load store optimization pass and not a test of the mir parser/printer.

It belongs to test/CodeGen/ARM; This also updates the test to use the
new -run-pass llc syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:13 +00:00
Matthias Braun
05b523a8b1 ARM: Initialize LoadStore passes in TargetMachine
Initializing them in LLVMInitializeARMTarget() makes them visible early
enough for "llc -run-pass usage".

This required the pass to be renamed from "arm-load-store-opt" to
"arm-ldst-opt", because there already exists an arm-load-store-opt
cl::opt switch which would now clash with the passname getting added as
a switch in opt. On the bright side the pass name now matches the
DEBUG_TYPE name. Renamed "arm-prera-load-store-opt" to
"arm-repra-ldst-opt" as well for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 02:24:10 +00:00
Eric Christopher
01f8f57b81 Reword comment to be more clear.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 01:55:45 +00:00
Matthias Braun
4d5c34d999 MIParser: reject subregister indexes on physregs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 01:36:18 +00:00
Richard Smith
8f1ea71020 Fix modules buildbot after r275633.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 01:05:39 +00:00
Justin Lebar
0616793d5c Don't do uint64_t(1) << 64 in maxUIntN.
Summary:
This shift is undefined behavior (and, as compiled by clang, gives the
wrong answer for maxUIntN(64)).

Reviewers: mkuper

Subscribers: llvm-commits, jroelofs, rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-16 00:59:41 +00:00
Kostya Serebryany
730992dc3b [libFuzzer] add hooks for strstr, strcasestr, strcasecmp, strncasecmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 23:27:19 +00:00
Vedant Kumar
eb1556ce41 [llvm-cov] Attempt to appease an older builder
It's using a version of clang which can't (or won't) deduce an implicit
conversion from a SmallString to a StringRef. Write the conversion out
explicitly:

  http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/8574

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275647 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 23:15:35 +00:00
Sebastian Pop
91aa2f63fb bugpoint: add flag -verbose-errors
The default behavior of bugpoint is to print "<crash>" when it finds a reduced
test that crashes compilation.  With this flag we now can see the output of the
crashing program.  This is useful to make sure it is the same error being
tracked down and not a different error that happens to crash the compiler as
well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 23:15:06 +00:00
Duncan P. N. Exon Smith
7e877ba91a Reapply "Mips: Avoid implicit iterator conversions, NFC"
This reverts commit r275562, effectively reapplying r275141.  Doug
Gilmore reported that there was an error when bisecting the Mips
buildbot failure, and that r275141 was not to blame after all.  Here is
the green build:
https://dmz-portal.mips.com/bb/builders/LLVM%20with%20integrated%20assembler%20and%20fPIC%20and%20-O0/builds/803

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 23:09:47 +00:00
Vedant Kumar
84b511291b [llvm-cov] Attempt to appease Windows bots
They appear to reject r275640 because stdin is held open during an
ExecuteAndWait in which it's redirected:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8390

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275642 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 23:08:22 +00:00
Vedant Kumar
13ca1ccb76 [llvm-cov] Optionally use a symbol demangler when preparing reports
Add an option to specify a symbol demangler (as well as options to the
demangler). This can be used to make reports more human-readable.

This option is especially useful in -output-dir mode, since it isn't as
easy to manually pipe reports into a demangler in this mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:44:57 +00:00
Vedant Kumar
a5ec41d9a9 [llvm-cov] Document a few private fields of CodeCoverageTool (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:44:54 +00:00
Vedant Kumar
b203f8032d [Support] Fix a doxygen comment (NFC)
There was a missing "<" on a line, so its contents wrapped around into
the description of the next argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:44:52 +00:00
Junmo Park
2e7b0c9318 Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:42:52 +00:00
Jacques Pienaar
0207ca8cf5 [lanai] Small cleanup: remove/comment out unused args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:38:32 +00:00
Matt Arsenault
e066e581b1 AMDGPU: Fix verifier error from partially undef copy
In this situation:

%VGPR2<def> = BUFFER_LOAD_DWORD_OFFSET %SGPR8_SGPR9_SGPR10_SGPR11,
%VGPR7<def,tied3> = V_MAC_F32_e32 %VGPR0<undef>, %VGPR1<kill>, %VGPR7<kill,tied0>, %EXEC<imp-use>
%VGPR3_VGPR4_VGPR5_VGPR6<def> = COPY %VGPR0_VGPR1_VGPR2_VGPR3
%VGPR4<def> = COPY %VGPR2

The copy for VGPR1 -> VGPR4 was an error from reading undefined VGPR1,
but VGPR4 is defined immediately after this copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:32:02 +00:00
Michael Kuperstein
467260108e ExpandPostRAPseudos should transfer implicit uses, not only implicit defs
Previously, we would expand:
%BL<def> = COPY %DL<kill>, %EBX<imp-use,kill>, %EBX<imp-def>
Into:
%BL<def> = MOV8rr %DL<kill>, %EBX<imp-def>
Dropping the imp-use on the floor.

That confused CriticalAntiDepBreaker, which (correctly) assumes that if an
instruction defs but doesn't use a register, that register is dead immediately
before the instruction - while in this case, the high lanes of EBX can be very
much alive.

This fixes PR28560.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275634 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:31:14 +00:00
Alexei Starovoitov
36b9c09330 BPF: Use official ELF e_machine value
The same value for EM_BPF is being propagated to glibc,
elfutils, and binutils.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:27:55 +00:00
Jacques Pienaar
6417b3cd22 [lanai] Fix build by updating calls to getLoad & getStore.
rL275592 removed the boolean parameters of SelectionDAG::getLoad and getStore, updating Lanai backend's calls to these functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:18:33 +00:00
Zachary Turner
9b30e73d48 [pdb] Teach MsfBuilder and other classes about the Free Page Map.
Block 1 and 2 of an MSF file are bit vectors that represent the
list of blocks allocated and free in the file.  We had been using
these blocks to write stream data and other data, so we mark them
as the free page map now.  We don't yet serialize these pages to
the disk, but at least we make a note of what it is, and avoid
writing random data to them.

Doing this also necessitated cleaning up some of the tests to be
more general and hardcode fewer values, which is nice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:17:19 +00:00
Zachary Turner
93a8d14081 [pdb] Round trip the NameMap data structure to YAML.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:17:08 +00:00
Zachary Turner
6be3e7c0e8 [pdb] Use MsfBuilder to handle the writing PDBs.
Previously we would read a PDB, then write some of it back out,
but write the directory, super block, and other pertinent metadata
back out unchanged.  This generates incorrect PDBs since the amount
of data written was not always the same as the amount of data read.

This patch changes things to use the newly introduced `MsfBuilder`
class to write out a correct and accurate set of Msf metadata for
the data *actually* written, which opens up the door for adding and
removing type records, symbol records, and other types of data to
an existing PDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:16:56 +00:00
Matt Arsenault
0d9b855807 StructurizeCFG: Fix inverting constantexpr conditions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 22:13:16 +00:00
Krzysztof Parzyszek
1b5d21e1e4 [Hexagon] Handle instruction latency for 0 or 2 cycles
The Hexagon schedulers need to handle instructions with a latency
of 0 or 2 more accurately. The problem, in v60, is that a dependence
between two instructions with a 2 cycle latency can use a .cur version
of the source to achieve a 0 cycle latency when the use is in the
same packet. Any othe use, must be at least 2 packets later, or a
stall occurs. In other words, the compiler does not want to schedule
the dependent instructions 1 cycle later.

To achieve this, the latency adjustment code allows only a single
dependence to have a zero latency. All other instructions have the
other value, which is typically 2 cycles. We use a heuristic to
determine which instruction gets the 0 latency.

The Hexagon machine scheduler was also changed to increase the cost
associated with 0 latency dependences than can be scheduled in the
same packet.

Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275625 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:34:02 +00:00
Matt Arsenault
35290cc53d AMDGPU: Remove brev intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:27:13 +00:00
Matt Arsenault
5fecfa22e5 AMDGPU: Fix TargetPrefix for remaining r600 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:27:08 +00:00
Matt Arsenault
a47e87a336 AMDGPU: Remove AMDGPU.ldexp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:26:56 +00:00
Matt Arsenault
7150fbf236 AMDGPU: Remove legacy rsq.clamped intrinsic
Mesa still has a use of llvm.AMDGPU.rsq.f64 remaining.

Also fix mismatch with non-IEEE rsq selecting to IEEE rsq.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275617 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:26:52 +00:00
Matt Arsenault
8a9af26e28 AMDGPU/R600: Delete dead code.
Dead or the same as the base implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:26:46 +00:00
Saleem Abdulrasool
db823e2f44 DebugInfo: reorder some initializers
Fix a few initialization ordering warnings from gcc from `-Wreorder`.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:10:31 +00:00
Saleem Abdulrasool
1083a5297a CodeGen: avoid emitting unnecessary CFI
Remove unnecessary clutter in assembly output.  When using SjLj EH, the CFI is
not actually used for anything.  Do not emit the CFI needlessly.  The minor test
adjustments are interesting.  The prologue test was just overzealous matcching.
The interesting case is the LSDA change.  It was originally added to ensure that
various compilations did not mangle the name (it explicitly checked the name!).
However, subsequent cleanups made it more reliant on the CFI to find the name.
Parse the generated code flow to generically find the label still.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:10:29 +00:00
Michael Zolotukhin
bf4114e90b Make processInstruction from LCSSA.cpp externally available.
Summary:
When a pass tries to keep LCSSA form it's often convenient to be able to update
LCSSA for a set of instructions rather than for the entire loop. This patch makes the
processInstruction from LCSSA externally available under a name
formLCSSAForInstruction.

Reviewers: chandlerc, sanjoy, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 21:08:41 +00:00
Zachary Turner
32cf292fd8 [pdb] Introduce MsfBuilder for laying out PDB files.
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D22308

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275611 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 20:43:38 +00:00
Nico Weber
2cef100c63 Teach fast isel about the win64 calling convention.
This mostly just works.

Vectorcall rets are still not supported.

The win64_eh test change is because fast isel doesn't use rsi for temporary
computations, so it doesn't need to be pushed. The test case I'm changing was
originally added to test pushes, but by now there are other test cases in that
file exercising that code path.

https://reviews.llvm.org/D22422


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 20:18:37 +00:00
Krzysztof Parzyszek
866d448f64 [Hexagon] Make MI scheduler check for stalls in previous packet on v60
Patch by Ikhlas Ajbar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275606 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 20:16:03 +00:00
George Burgess IV
2347de17da [CFLAA] Add attributes handling for CFLAnders.
This patch adds proper handling of stratified attributes into our
anders-style CFLAA implementation. It also comes bundled with more
CFLAnders tests. :)

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 20:02:49 +00:00
Nemanja Ivanovic
c700450a3c [PowerPC] Set kill flag for scratch register when spilling the link register
This fixes PR 28526.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 19:56:32 +00:00
George Burgess IV
723a3ff949 [CFLAA] Add an initial CFLAnders implementation.
This adds an incomplete anders-style implementation for CFLAA. It's
incomplete in that it's missing interprocedural analysis, attrs
handling, etc. and that it needs more tests. More tests and features
will be added in future commits.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275602 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 19:53:25 +00:00
Derek Schuff
17ea6c191e Fix calls to SelectionDAG::getStore
It was refactored in r275592. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 19:35:43 +00:00
Vitaly Buka
a6cb7108c4 Revert "[AMDGPU] Add metadata for runtime"
This reverts commit r275566.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 19:14:57 +00:00