141187 Commits

Author SHA1 Message Date
Jacob Baungard Hansen
6ea9891f93 [Sparc] Use target name instead of namespace as prefix for MCRegisterClasses array
Summary:
For Sparc the namespace (SP) is different from the target name (Sparc),
which causes the name of the array in this declaration to differ from
the name used in the definition.

Patch by Daniel Cederman.

Reviewers: jyknight

Subscribers: llvm-commits, jyknight

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287528 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 09:33:05 +00:00
Craig Topper
fd72811874 [AVX-512] Add EVEX form of VMOVZPQILo2PQIZrm to load folding tables to match SSE and AVX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 07:51:31 +00:00
Alexei Starovoitov
7362a66c70 [bpf] attempt to fix big-endian bots
attempt to fix big-endian bots failing on new dwarfdump test

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 07:26:23 +00:00
Alexei Starovoitov
db476dbf2e [bpf] fix dwarf elf relocs and line numbers
- teach RelocVisitor to recognize bpf relocations
- fix AsmInfo->PointerSize to make sure dwarf is emitted correctly
- add a test for the above

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 06:21:23 +00:00
Craig Topper
80f1fb4ea1 [TableGen][ISel] Do a better job of factoring ScopeMatchers created during creation of SwitchTypeMatcher.
Previously we were factoring when the ScopeMatcher was initially created, but it might get more Matchers added to it later. Delay factoring until we have fully created/populated the ScopeMatchers.

This reduces X86 isel tables by 154 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 04:07:58 +00:00
Craig Topper
51f05962d8 [X86] Remove duplicate instructions for (v)movq and replace with patterns on other instructions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 04:07:56 +00:00
Dean Michael Berris
4fedda5369 [XRay][AArch64] Implemented a test for the compile-time sleds emitted, and fixed a bug in the jump instruction
This patch adds a test for the assembly code emitted with XRay
instrumentation. It also fixes a bug where the operand of a jump
instruction must be not the number of bytes to jump over, but rather the
number of 4-byte instructions.

Author: rSerge

Reviewers: dberris, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 03:01:43 +00:00
Davide Italiano
02ca2cb0e6 [GlobalSplit] Port to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 00:28:23 +00:00
Simon Dardis
544f14c6b2 [mips] Restrict tail call optimization
The tail call optimization was being used without proper consideration of
ABI requirements for saving and restoring the GP. This patch restricts tail
call optimization to functions within the same translation unit.

Reviewers: vkalintiris

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 21:23:08 +00:00
Simon Pilgrim
cbc1c49eda [X86][SSE] Add some initial combine tests that could (should?) use PACKSS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 21:12:49 +00:00
Craig Topper
b19918a691 [AVX-512] Add tests for masked palignr/valignd/valignq shuffles, many of which show failures to fold the masking into the operation.
Many of these problems are because shuffle lowering widens element size and reduces element count when possible. This causes the shuffle to become separated from the select by a bitcast. Future patches will work to improve these cases by rewriting the shuffle back to a narrow element type if we think it can result in folding the mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 19:50:32 +00:00
Coby Tayree
57e555600b The 'vpmultishiftqb' instruction was implemented falsely, this patch amend it.
More specifically - (MS dialect) broadcasting variants were implemented falsely.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 17:19:55 +00:00
Coby Tayree
89ba3f29a1 Some instructions were missing, other implemented falsely. this patch aims at amending those issues. full list:
vcvtps2pd
vcvtudq2pd
vcvtps2qq
vcvttps2qq
vcvtps2uqq
vcvttps2uqq

variants are:

[Dst]XMM(zero-masked/merge-masked/unmasked)
[Src]Mem64

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 17:09:56 +00:00
Simon Pilgrim
d14ddee539 [X86][AVX512] Combine unary + zero target shuffles to VPERMV3 with a zero vector where possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 16:11:36 +00:00
Simon Pilgrim
73373f7847 [X86][AVX512] Add support for VBMI VPERMV3 target shuffle combines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 15:24:38 +00:00
Simon Pilgrim
ccb6a0ca98 [X86][AVX512] Add support for VBMI VPERMV target shuffle combines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 15:05:45 +00:00
Simon Pilgrim
c04ba41915 [X86][AVX512] Add some initial VBMI target shuffle combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 14:45:46 +00:00
Simon Pilgrim
de040297a3 [X86][AVX512VL] Removed duplicate operation action
Basic AVX512F already declared uint_to_fp v4i32 as legal

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 14:19:29 +00:00
Simon Pilgrim
2cd09f3bfd Strip trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287492 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 14:05:23 +00:00
Simon Pilgrim
d40266bd28 [X86][AVX512F] Add support for uint_to_fp v2i32 to v2f64 on AVX512F-only targets
Use 512-bit instructions (we already do something similar for uint_to_fp v4i32 to v4f64)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 14:03:23 +00:00
Simon Pilgrim
84d1e9104a Fix comment typos. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:47:59 +00:00
Simon Pilgrim
84354d97d5 Fix spelling mistakes in Tools/Tests comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:31:13 +00:00
Simon Pilgrim
431da84b02 Fix spelling mistakes in Transforms comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:19:49 +00:00
Simon Pilgrim
cc5e30431d Fix spelling mistakes in SelectionDAG comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:14:57 +00:00
Simon Pilgrim
0f550ef263 Fix comment typos. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:10:51 +00:00
Oren Ben Simhon
88688e8d48 [X86] RegCall - Handling long double arguments
The change is part of RegCall calling convention support for LLVM.
Long double (f80) requires special treatment as the first f80 parameter is saved in FP0 (floating point stack).
This review present the change and the corresponding tests.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 11:06:07 +00:00
Coby Tayree
815a7e0780 [X86][InlineAsm]Test commit.
Fixing a wrong comment on X86AsmParser.cpp::ParseZ: "true" --> "false"

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 09:31:11 +00:00
Serge Pavlov
15f7935637 Fix file name resolution in nested response files
If a response file in construct `@file` was specified by relative name,
constructs `@file` nested within it were resolved incorrectly if the
flag RelativeNames in call to ExpandResponseFile was set to true.
This feature is used in configuration files, tests for it are in
respective change (see D24933).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 06:25:07 +00:00
Saleem Abdulrasool
802a1be56a ExceptionDemo: remove some undefined behaviour
The casting based reading of the LSDA could attempt to read unsuitably aligned
data.  Avoid that case by explicitly using a memcpy.  A similar approach is used
in libc++abi to address the same UB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 02:36:38 +00:00
Saleem Abdulrasool
308b046dd4 ExceptionDemo: prefer headers over redeclarations
Rather than redeclaring the interfaces for exceptions, prefer using the
`unwind.h` header.  This is vended by at least gcc and clang, and can also be
found by an external unwinding library (e.g. libunwind).  Doing this simplifies
the example to the exception handling itself.  Minor tweaks are the result of
_Unwind_Context_t not being defined, which is just a typedef for struct
_Unwind_Context *.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 02:36:36 +00:00
Alexei Starovoitov
e58b8cc117 [bpf] add BPF disassembler
add BPF disassembler, so tools like llvm-objdump can be used:
$ llvm-objdump -d -no-show-raw-insn ./sockex1_kern.o

./sockex1_kern.o:	file format ELF64-BPF

Disassembly of section socket1:
bpf_prog1:
       0:	r6 = r1
       8:	r0 = *(u8 *)skb[23]
      10:	*(u32 *)(r10 - 4) = r0
      18:	r1 = *(u32 *)(r6 + 4)
      20:	if r1 != 4 goto 8
      28:	r2 = r10
      30:	r2 += -4

ld_imm64 (the only 16-byte insn) and special ld_abs/ld_ind instructions
had to be treated in a special way. The decoders for the rest of the insns
are automatically generated.

Add tests to cover new functionality.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 02:25:00 +00:00
Rui Ueyama
b665150021 Attempt to fix big-endian buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:41:28 +00:00
Rui Ueyama
533eaeefec Style fix. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:15:56 +00:00
Rui Ueyama
54ac8bee97 Fix buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:13:22 +00:00
Rui Ueyama
8afc3ea3bd SHA1: unroll loop in hashBlock.
This code is taken from public domain.
https://github.com/jsonn/src/blob/trunk/common/lib/libc/hash/sha1/sha1.c

I wrote a sha1 command and ran it on my Xeon E5-2680 v2 2.80GHz machine.
Here is a result. The new hash function is 37% faster than before.

 Performance counter stats for './llvm-sha1-old /ssd/build/bin/lld' (10 runs):

       6640.503687 task-clock (msec)         #    1.001 CPUs utilized            ( +-  0.03% )
                54 context-switches          #    0.008 K/sec                    ( +-  5.03% )
                 5 cpu-migrations            #    0.001 K/sec                    ( +- 31.73% )
           183,803 page-faults               #    0.028 M/sec                    ( +-  0.00% )
    18,527,954,113 cycles                    #    2.790 GHz                      ( +-  0.03% )
     4,993,237,485 stalled-cycles-frontend   #   26.95% frontend cycles idle     ( +-  0.11% )
   <not supported> stalled-cycles-backend
    50,217,149,423 instructions              #    2.71  insns per cycle
                                             #    0.10  stalled cycles per insn  ( +-  0.00% )
     6,094,322,337 branches                  #  917.750 M/sec                    ( +-  0.00% )
        11,778,239 branch-misses             #    0.19% of all branches          ( +-  0.01% )

       6.634017401 seconds time elapsed                                          ( +-  0.03% )

 Performance counter stats for './llvm-sha1-new /ssd/build/bin/lld' (10 runs):

       4167.062720 task-clock (msec)         #    1.001 CPUs utilized            ( +-  0.02% )
                52 context-switches          #    0.012 K/sec                    ( +- 16.45% )
                 7 cpu-migrations            #    0.002 K/sec                    ( +- 32.20% )
           183,804 page-faults               #    0.044 M/sec                    ( +-  0.00% )
    11,626,611,958 cycles                    #    2.790 GHz                      ( +-  0.02% )
     4,491,897,976 stalled-cycles-frontend   #   38.63% frontend cycles idle     ( +-  0.05% )
   <not supported> stalled-cycles-backend
    24,320,180,617 instructions              #    2.09  insns per cycle
                                             #    0.18  stalled cycles per insn  ( +-  0.00% )
     1,574,674,576 branches                  #  377.886 M/sec                    ( +-  0.00% )
        11,769,693 branch-misses             #    0.75% of all branches          ( +-  0.00% )

       4.163251552 seconds time elapsed                                          ( +-  0.02% )

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:03:22 +00:00
Saleem Abdulrasool
902878bb3f Demangle: remove references to allocator for default allocator
The demangler had stopped using a custom allocator but had not been updated to
remove the use of the explicit allocator passing.  This removes that as we do
not need to do anything special here anymore.  This just makes the code more
compact.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:27 +00:00
Saleem Abdulrasool
21918ee4aa Demangle: remove unnecessary typedef for std::vector
We could create a local typedef for std::vector called Vector.  Inline the use
of std::vector rather than use the typedef.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:25 +00:00
Saleem Abdulrasool
e17a816352 Demangle: replace custom typedef for std::string with std::string
We created a local typedef for `std::basic_string<char, std::char_traits<char>>`
which is just `std::string`.  Remove the local typedef and propagate the type
information through the rest of the demangler.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:23 +00:00
Saleem Abdulrasool
7f90f9e9a9 Demangle: use direct member initialization (NFC)
Prefer direct member initialization over the explicit out-of-line initialization
for the construction of the local type.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:20 +00:00
Benjamin Kramer
c57d1d6295 Give some helper classes/functions internal linkage. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 20:44:26 +00:00
Simon Pilgrim
c6fddca294 [X86][SSE] Improve PSHUFB lowering from either input
Canonicalization may leave the zeroable vector in the first input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 20:41:48 +00:00
Simon Pilgrim
b799ae96d6 [X86][AVX512] Add VPERMV/VPERMV3 v64i8 byte shuffles on avx512vbmi targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 20:12:34 +00:00
Mehdi Amini
c695a0be78 [ThinLTO] Fix crash when importing an opaque type
It seems that because ThinLTO does not import the full module,
some invariant of the type mapper are broken.

In Monolithic LTO, we import every globals: when calling
IRLinker::copyFunctionProto() on @foo(), we end-up calling
TypeMapTy::get(FTy) on the type of @foo(), which will map
%0 and record the destination as opaque.

ThinLTO skips this because @foo is not imported and goes directly
to the next stage.

Next we call computeTypeMapping() that map the types for each
globals, and ends up checking for type isomorphism, and may add
type mapping. However it doesn't record if there was an opaque
destination type that was resolved.

Instead of lazily "discovering" opaque type in the destination
module on the go, we change the TypeFinder to eagerly record all
types and not only the named ones.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:44:16 +00:00
Mehdi Amini
4bd62ab489 [ThinLTO] Implement -pass-remarks-output in ThinLTOCodeGenerator
Summary:
This will also be added to the LTO API, right now this will
bring ThinLTO on par with Monolithic LTO on Darwin.

Reviewers: anemet

Subscribers: tejohnson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:20:05 +00:00
Mehdi Amini
1bb4b12315 Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)
Summary:
This makes it explicit that ownership is taken. Also replace all `new`
with make_unique<> at call sites.

Reviewers: anemet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:19:41 +00:00
Simon Pilgrim
23f587bb5d [X86][AVX512] Add avx512vbmi tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:12:48 +00:00
Simon Pilgrim
cee7f67a7d [X86][AVX512] Added some more complex v64i8 shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 17:50:14 +00:00
Craig Topper
aea637329e [X86] Simplify some code a little by removing a dulicate variable and combinining two if statements. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 17:33:17 +00:00
Daniel Sanders
c170429d49 Try again to fix unused variable warning on lld-x86_64-darwin13 after r287439.
The previous attempt didn't work. I assume LLVM_ATTRIBUTE_UNUSED isn't
available on that machine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 14:47:41 +00:00
Daniel Sanders
8417728bfe Try to fix unused variable warning on lld-x86_64-darwin13 after r287439.
Whether the variable is used or not depends on NDEBUG.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 13:50:32 +00:00