Commit Graph

293027 Commits

Author SHA1 Message Date
Simon Pilgrim aab8660e23 [X86][SSE] Support v16i8/v32i8 vector rotations
This uses the same technique as for shifts - split the rotation into 4/2/1-bit partial rotations and select those partials based on the amount bit, making use of PBLENDVB if available. This halves the use of PBLENDVB compared to expanding to shifts, which can be a slow op.

Unfortunately I haven't found a decent way to share much of this code with the shift equivalent.

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

llvm-svn: 335957
2018-06-29 09:36:39 +00:00
Pavel Labath 564a33a6e8 Fix TestLoadUsingPaths on linux
we need to explicitly link the test program with -ldl for the dlopen
function to be available.

llvm-svn: 335956
2018-06-29 09:22:07 +00:00
Pavel Labath e17e9579eb Modernize completion tests
Now that we have gmock, we can use its matchers to better express the
test assertions. The main advantage of this is that when things fail,
the test will now print the expected and actual lists of completed
strings instead of just a not-very-helpful "false is not true" message.

llvm-svn: 335955
2018-06-29 09:06:42 +00:00
George Rimar 11d09fc2f2 [ELF] - Add test case to test 32 bits output.
We had no tests that checked how we print -Map output for
32 bit targets. Though there are at least 2 places where we have the difference.
(between 64 and 32 bits):

https://github.com/llvm-mirror/lld/blob/master/ELF/MapFile.cpp#L52
https://github.com/llvm-mirror/lld/blob/master/ELF/MapFile.cpp#L162

Patch adds just a trivial test to check we do right things in general.

llvm-svn: 335954
2018-06-29 08:54:34 +00:00
Sjoerd Meijer 195e904002 [ARM][AArch64] Armv8.4-A Enablement
Initial patch adding assembly support for Armv8.4-A.

Besides adding v8.4 as a supported architecture to the usual places, this also
adds target features for the different crypto algorithms. Armv8.4-A introduced
new crypto algorithms, made them optional, and allows different combinations:

- none of the v8.4 crypto functions are supported, which is independent of the
  implementation of the Armv8.0 SHA1 and SHA2 instructions.
- the v8.4 SHA512 and SHA3 support is implemented, in this case the Armv8.0
  SHA1 and SHA2 instructions must also be implemented.
- the v8.4 SM3 and SM4 support is implemented, which is independent of the
  implementation of the Armv8.0 SHA1 and SHA2 instructions.
- all of the v8.4 crypto functions are supported, in this case the Armv8.0 SHA1
  and SHA2 instructions must also be implemented.

The v8.4 crypto instructions are added to AArch64 only, and not AArch32,
and are made optional extensions to Armv8.2-A.

The user-facing Clang options will map on these new target features, their
naming will be compatible with GCC and added in follow-up patches.

The Armv8.4-A instruction sets can be downloaded here:
https://developer.arm.com/products/architecture/a-profile/exploration-tools

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

llvm-svn: 335953
2018-06-29 08:43:19 +00:00
Philip Pfaffe 2f3eff86b1 [NFC] Fix formatting to appease builders
llvm-svn: 335952
2018-06-29 08:29:17 +00:00
Philip Pfaffe 52025af1da Implement an iterator for isl maps, basic_maps, sets, basic_sets
Summary:
Provide an iterator to simplify iteration over some isl collections.
Since these types do not natively support iteration, they have to be converted
to an list first by the caller, but can then be used in a ranged for loop:
```
isl::set S;
for (auto SubSet : S.get_basic_set_list ()) {
  // ...
}
```

Reviewers: bollu, Meinersbur, grosser, dexonsmith

Reviewed By: bollu

Subscribers: hfinkel, mgorny, Meinersbur, mehdi_amini, bollu, steven_wu, llvm-commits

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

llvm-svn: 335951
2018-06-29 08:17:03 +00:00
Roman Lebedev 8d081b78e4 SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction
Summary:
An alternative to D48597.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=37936 | PR37936 ]].

The problem is as follows:
1. `indvars` marks `%dec` as `NUW`.
2. `loop-instsimplify` runs `instsimplify`, which constant-folds `%dec` to -1 (D47908)
3. `loop-reduce` tries to do some further modification, but crashes
    with an type assertion in cast, because `%dec` is no longer an `Instruction`,

If the runline is split into two, i.e. you first run `-indvars -loop-instsimplify`,
store that into a file, and then run `-loop-reduce`, there is no crash.

So it looks like the problem is due to `-loop-instsimplify` not discarding SCEV.
But in this case we can just not crash if it's not an `Instruction`.
This is just a local fix, unlike D48597, so there may very well be other problems.

Reviewers: mkazantsev, uabelho, sanjoy, silviu.baranga, wmi

Reviewed By: mkazantsev

Subscribers: evstupac, javed.absar, spatel, llvm-commits

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

llvm-svn: 335950
2018-06-29 07:44:20 +00:00
Philip Pfaffe ec1a3048a3 [ScopHelper] Provide support for recognising collective invariant loads
Summary: This patch aims to provide support for detecting load patterns which are collectively invariant but right now `isHoistableLoad()` is checking each load instruction individually which cannot detect the load pattern as a whole.

Patch by: Sahil Girish Yerawar

Reviewers: bollu, philip.pfaffe, Meinersbur

Reviewed By: philip.pfaffe, Meinersbur

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

llvm-svn: 335949
2018-06-29 07:29:45 +00:00
Kristof Beyls 63e68acbc3 Make email options of find_interesting_reviews more flexible.
This enables a few requested improvements on the original review of this
script at https://reviews.llvm.org/D46192.

This introduces 2 new command line options:

* --email-report: This option enables specifying who to email the generated
  report to. This also enables not sending any email and only printing out
  the report on stdout by not specifying this option on the command line.
* --sender: this allows specifying the email address that will be used in
  the "From" email header.

I believe that with these options the script starts having the basic
features needed to run it well on a regular basis for a group of
developers.

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

llvm-svn: 335948
2018-06-29 07:16:27 +00:00
Martin Storsjo c0826745cf [MinGW] Implement the GNU ld options -S/--strip-debug
In this mode, we retain the symbol table, but skip the actual debug
information.

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

llvm-svn: 335947
2018-06-29 06:08:31 +00:00
Martin Storsjo 3a7905b2aa [COFF] Add an LLD specific option -debug:symbtab
With this set, we retain the symbol table, but skip the actual debug
information.

This is meant to be used by the MinGW frontend.

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

llvm-svn: 335946
2018-06-29 06:08:25 +00:00
Craig Topper 8bf793fb35 [X86] Remove masking from the avx512 packed sqrt builtins. Use select builtins instead.
llvm-svn: 335945
2018-06-29 05:43:33 +00:00
Craig Topper 875e9f8fa4 [X86] Remove masking from the avx512 packed sqrt intrinsics. Use select in IR instead.
While there improve the coverage of the intrinsic testing and add fast-isel tests.

llvm-svn: 335944
2018-06-29 05:43:26 +00:00
Evgeniy Stepanov 6d310651a2 [cfi] Reset i-cache after copying code in test.
Fixes intermittent crashes on Android.
Also add PROT_READ to the code mapping for no real reason.

llvm-svn: 335943
2018-06-29 00:38:26 +00:00
Tom Stellard c5a154db48 AMDGPU: Separate R600 and GCN TableGen files
Summary:
We now have two sets of generated TableGen files, one for R600 and one
for GCN, so each sub-target now has its own tables of instructions,
registers, ISel patterns, etc.  This should help reduce compile time
since each sub-target now only has to consider information that
is specific to itself.  This will also help prevent the R600
sub-target from slowing down new features for GCN, like disassembler
support, GlobalISel, etc.

Reviewers: arsenm, nhaehnle, jvesely

Reviewed By: arsenm

Subscribers: MatzeB, kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, javed.absar, llvm-commits

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

llvm-svn: 335942
2018-06-28 23:47:12 +00:00
Evgeniy Stepanov 3702f91287 [asan] Change 3 tests from XFAIL to UNSUPPORTED.
The failure in https://github.com/google/sanitizers/issues/981 is flaky.

llvm-svn: 335941
2018-06-28 23:27:55 +00:00
Alex Lorenz 9b1baabc4e [frontend] Don't include the C++ stdlib for -x assembler-with-cpp
The new C++ stdlib warning added in r335081 gets
triggered when compiling an assembly file with -x assembler-with-cpp.
This commit ensures that the C++ stdlib is not included when compiling assembly.
In general, it's not really useful to include the C++ stdlib search path when
compiling assembly source.

rdar://41359632

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

llvm-svn: 335940
2018-06-28 23:23:45 +00:00
Sterling Augustine 0cf1f15e83 Require x86 for this test.
llvm-svn: 335939
2018-06-28 23:22:14 +00:00
David Blaikie cb7b6af30e DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command line
llvm-svn: 335938
2018-06-28 22:58:04 +00:00
Evgeniy Stepanov 730c985d56 [asan] Disable 3 tests on Android O+.
https://github.com/google/sanitizers/issues/981

llvm-svn: 335937
2018-06-28 22:54:55 +00:00
Evgeniy Stepanov e40ae2e3a2 [asan] Fix one more test on Android.
This change makes it pass both on libstdc++ and libc++-based toolchains.

The error was:
error: function-like macro '__GLIBC_PREREQ' is not defined
                               ^

llvm-svn: 335936
2018-06-28 22:54:42 +00:00
Evgeniy Stepanov 59ef3dbbc6 [asan] un-XFAIL one test
NDK r16 provides glob.h, which makes this test pass.
Supporting different test outcomes depending on the version of NDK
add unnecessary complexity to the test harness. IMHO, it's OK to require
the latest stable release.

llvm-svn: 335935
2018-06-28 22:54:30 +00:00
Raphael Isemann 517c22041e Fix path completion test case added in rL335905 on Windows
Summary:
The test fails because we don't rewrite the slash behind `foo` to the OS specific
separator (as the completion API doesn't support this kind of rewriting). However,
we assume that this part of the string is rewritten in the test case, which broke
on Windows.

Reviewers: stella.stamenova

Reviewed By: stella.stamenova

Subscribers: lldb-commits

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

llvm-svn: 335934
2018-06-28 22:40:10 +00:00
Evgeniy Stepanov 71dc39823c [fuzzer] Don't run tests on Android.
Need better build system support.

llvm-svn: 335933
2018-06-28 22:16:59 +00:00
Mikhail R. Gadelha 7f081fb22e [analyzer] fix test case expected warning
After r335814, the constraint manager is no longer generating a false bug report
about the division by zero in the test case.

This patch removes the expected false bug report.

llvm-svn: 335932
2018-06-28 22:08:44 +00:00
Eli Friedman 65d885e376 [ARM] Assert that ARMDAGToDAGISel creates valid UBFX/SBFX nodes.
We don't ever check these again (unless you're using
-fno-integrated-as), so make sure the extracted bits are well-defined.

I don't think it's possible to trigger any of the assertions on trunk,
but it's difficult to prove.  (The first one depends on DAGCombine to
minimize the number of set bits in AND masks; I think the others are
mathematically impossible to hit.)

llvm-svn: 335931
2018-06-28 21:49:41 +00:00
Jessica Paquette 0c5d3ffbb8 [MachineOutliner] Never add the outliner in -O0
This is a recommit of r335879.

We shouldn't add the outliner when compiling at -O0 even if
-enable-machine-outliner is passed in. This makes sure that we
don't add it in this case.

This also removes -O0 from the outliner DWARF test.

llvm-svn: 335930
2018-06-28 21:49:24 +00:00
Mikhail R. Gadelha 95d1605bcb [analyzer] Move test to the correct directory
It was accidentaly pushed in r335926

llvm-svn: 335929
2018-06-28 21:39:41 +00:00
Alex Shlyapnikov fb1644835b [TSan] More detailed error message on failed sahdow memory madvise
Summary:
Report errno value on failed shadow memory madvise attempt and add a
hint message with the possible workaround.

Reviewers: eugenis

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 335928
2018-06-28 21:38:34 +00:00
George Burgess IV 4d45645568 [Parse] Make -Wgcc-compat complain about for loop inits in C89
While clang allows declarations in for loop init statements in c89 and
gnu89, gcc does not. So, we should probably warn if users care about gcc
compatibility.

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

llvm-svn: 335927
2018-06-28 21:36:00 +00:00
Mikhail R. Gadelha 53ac1a2ed4 [analyzer] Fix wrong comparison generation of the ranges generated by the refutation manager
The refutation manager is removing a true bug from the test in this patch.

The problem is that the following constraint:
```
(conj_$1{struct o *}) - (reg_$3<int * r>): [-9223372036854775808, 0]
```
is encoded as:
```
(and (bvuge (bvsub $1 $3) #x8000000000000000)
     (bvule (bvsub $1 $3) #x0000000000000000))
```
The issue is that unsigned comparisons (bvuge and bvule) are being generated instead of signed comparisons (bvsge and bvsle).

When generating the expressions:
```
(conj_$1{p *}) - (reg_$3<int * r>) >= -9223372036854775808
```
and
```
(conj_$1{p *}) - (reg_$3<int * r>) <= 0
```
both -9223372036854775808 and 0 are casted to pointer type and `LTy->isSignedIntegerOrEnumerationType()` in `Z3ConstraintManager::getZ3BinExpr` only checks if the type is signed, not if it's a pointer.

Reviewers: NoQ, george.karpenkov, ddcc

Subscribers: rnkovacs, NoQ, george.karpenkov, ddcc, xazax.hun, szepet, a.sidorin

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

llvm-svn: 335926
2018-06-28 21:26:52 +00:00
Richard Smith aadb254a79 PR37979: integral promotions in C++ treat enum bit-fields like enums,
not like bit-fields.

We used to get this right "by accident", because conversions for the
selected built-in overloaded operator would convert the enum bit-field
to its corresponding underlying type early. But after DR1687 that no
longer happens.

Technically this change should also apply to C, where bit-fields only
have special promotion rules if the bit-field's declared type is
_Bool, int, signed int, or unsigned int, but for GCC compatibility we
only look at the bit-width and not the underlying type when performing
bit-field integral promotions in C.

llvm-svn: 335925
2018-06-28 21:17:55 +00:00
Sanjay Patel 019d3cd3b4 [InstCombine] adjust shuffle tests; NFC
Use xor for the extra uses test because div/rem have other problems.

llvm-svn: 335924
2018-06-28 21:14:02 +00:00
David Carlier a8c5041bdf [UBsan] minimal unit tests removing OpenBSD spacial case
The OpenBSD driver now handles sanitisers with ld.lld automatically.

Reviewers: vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 335923
2018-06-28 21:10:52 +00:00
Jake Ehrlich 0f440d832f [llvm-readobj] Add experimental support for SHT_RELR sections
This change adds experimental support for SHT_RELR sections, proposed
here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. Use with caution!

Author: rahulchaudhry

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

llvm-svn: 335922
2018-06-28 21:07:34 +00:00
Benjamin Kramer a1f629c4cf [SupportTests] Silence -Wsign-compare warnings
llvm-svn: 335921
2018-06-28 21:03:24 +00:00
Sanjay Patel d512853aa3 [InstCombine] fix opcode check in shuffle fold
There's no way to expose this difference currently, 
but we should use the updated variable because the
original opcodes can go stale if we transform into
something new.

llvm-svn: 335920
2018-06-28 20:52:43 +00:00
Petr Hosek 0b9629b286 [CMake] Don't build Linux targets on Darwin in Fuchsia toolchain
This is currently breaking because Linux target sysroots rely on
case sensitive filesystem which is not by default enabled on macOS.

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

llvm-svn: 335919
2018-06-28 20:33:18 +00:00
Martin Storsjo 2a9bd7b756 [COFF] Fix constant sharing regression for MinGW
This fixes a regression since SVN r334523, where the object files
built targeting MinGW were rejected by GNU binutils tools. Prior to
that commit, we only put constants in comdat for MSVC configurations.

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

llvm-svn: 335918
2018-06-28 20:28:29 +00:00
Petr Hosek e52b752973 [CMake] Build static runtimes for host in Fuchsia first stage
First stage build is only a minimal build where we don't need
a complete multiarch support, but we need enough to build the
second stage.

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

llvm-svn: 335917
2018-06-28 20:19:11 +00:00
Pirama Arumuga Nainar c83bbf55d7 Configure ELAST for MinGW
Summary:
Use _LIBCPP_MSVCRT_LIKE while configuring ELAST, so MinGW gets the same
configuration as MSVC.

Reviewers: compnerd, srhines, danalbert, mstorsjo

Subscribers: christof, ldionne, cfe-commits

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

llvm-svn: 335916
2018-06-28 20:16:45 +00:00
Zachary Turner 402ab4964e Fix padding with custom character in formatv.
The format string for formatv allows to specify a custom padding
character instead of the default space.  This custom character was
parsed correctly, but not passed on to the formatter.

Patch by Marcel Köppe
Differential Revision: https://reviews.llvm.org/D48140

llvm-svn: 335915
2018-06-28 20:09:37 +00:00
Teresa Johnson e87868b7e9 [ThinLTO] Port InlinerFunctionImportStats handling to new PM
Summary:
The InlinerFunctionImportStats will collect and dump stats regarding how
many function inlined into the module were imported by ThinLTO.

Reviewers: wmi, dexonsmith

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

llvm-svn: 335914
2018-06-28 20:07:47 +00:00
Benjamin Kramer 23d8282047 [NVPTX] Delete dead code
No functionality change.

llvm-svn: 335913
2018-06-28 20:05:35 +00:00
Jim Ingham 0d231f7161 Add a way to load an image using a library name and list of paths.
This provides an efficient (at least on Posix platforms) way to offload to the
target process the search & loading of a library when all we have are the 
library name and a set of potential candidate locations.

<rdar://problem/40905971>

llvm-svn: 335912
2018-06-28 20:02:11 +00:00
Joel E. Denny 3cabf73270 [OPENMP] Fix incomplete type check for array reductions
A reduction for an incomplete array type used to produce an assert
fail during codegen.  Now it produces a diagnostic.

Reviewed By: ABataev

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

llvm-svn: 335911
2018-06-28 19:54:49 +00:00
Joel E. Denny e0e7a8ae58 Revert r335907: [OPENMP] Fix incomplete type check for array reductions
Sorry, forgot to add commit log attributes again.

llvm-svn: 335910
2018-06-28 19:54:27 +00:00
Eli Friedman 6613efbd4e [ARM] Add missing Thumb2 assembler diagnostics.
Mostly just adding checks for Thumb2 instructions which correspond to
ARM instructions which already had diagnostics. While I'm here, also fix
ARM-mode strd to check the input registers correctly.

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

llvm-svn: 335909
2018-06-28 19:53:12 +00:00
Sterling Augustine 052ce120d5 Some targets don't have lld built, so just use a binary copy
of the input file.

llvm-svn: 335908
2018-06-28 19:47:23 +00:00