Commit Graph

255557 Commits

Author SHA1 Message Date
Anna Thomas ec36f3b79a [InstCombine] Do not exercise nested max/min pattern on abs
Summary:
This is a fix for assertion failure in
`getInverseMinMaxSelectPattern` when ABS is passed in as a select pattern.

We should not be invoking the simplification rule for
ABS(MIN(~ x,y))) or ABS(MAX(~x,y)) combinations.

Added a test case which would cause an assertion failure without the patch.

Reviewers: sanjoy, majnemer

Subscribers: llvm-commits

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

llvm-svn: 295719
2017-02-21 14:40:28 +00:00
Igor Breger 812f319794 [AVX512] Fix EXTRACT_VECTOR_ELT for v2i1/v4i1/v32i1/v64i1 with variable index.
Differential Revision: https://reviews.llvm.org/D30189

llvm-svn: 295718
2017-02-21 14:01:25 +00:00
Alexey Bataev 64da79424e [SLP] Tests for shuffle/blending operations.
llvm-svn: 295717
2017-02-21 13:40:55 +00:00
Diana Picus 613b65696a [ARM] GlobalISel: Lower calls to void() functions
For now, we hardcode a BLX instruction, and generate an ADJCALLSTACKDOWN/UP pair
with amount 0.

llvm-svn: 295716
2017-02-21 11:33:59 +00:00
Benjamin Kramer ba5df6dea5 [clang-tidy] Reword the "code outside header guard" warning.
The check doesn't really know if the code it is warning about came before
or after the header guard, so phrase it more neutral instead of complaining
about code before the header guard. The location for the warning is still
not optimal, but I don't think fixing that is worth the effort, the
preprocessor doesn't give us a better location.

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

llvm-svn: 295715
2017-02-21 11:25:45 +00:00
Krasimir Georgiev 4b15922838 [clang-format] Remove unused member variables from BreakableToken
llvm-svn: 295714
2017-02-21 10:54:50 +00:00
Michael Kruse 9e52c39f0a [DeLICM] Map values hoisted by LICM back to the array.
Implement the -polly-delicm pass. The pass intends to undo the
effects of LoopInvariantCodeMotion (LICM) which adds additional scalar
dependencies into SCoPs. DeLICM will try to map those scalars back to
the array elements they were promoted from, as long as the array
element is unused.

The is the main patch from the DeLICM/DePRE patch series. It does not
yet undo GVN PRE for which additional information about known values
is needed and does not handle PHI write accesses that have have no
target. As such its usefulness is limited. Patches for these issues
including regression tests for error situatons will follow.

Reviewers: grosser

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

llvm-svn: 295713
2017-02-21 10:20:54 +00:00
Pavel Labath ba95a28c18 Log: Fix race in accessing the stream variable
Summary:
The code was attempting to copy the shared pointer member in order to
guarantee atomicity, but this is not enough. Instead, protect the
pointer with a proper read-write mutex.

This bug was present here for a long time, but my recent refactors must
have altered the timings slightly, such that now this fails fairly often
when running the tests: the test runner runs the "log disable" command
just as the thread monitoring the lldb-server child is about to report
that the server has exited.

I add a test case for this. It's not possible to reproduce the race
deterministically in normal circumstances, but I have verified that
before the fix, the test failed when run under tsan, and was running
fine afterwards.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 295712
2017-02-21 09:58:23 +00:00
Pavel Labath 52a82e2ec6 tablegen: Fix android build
use llvm::to_string instead of std:: version.

llvm-svn: 295711
2017-02-21 09:19:41 +00:00
Richard Smith 0cd9c0491e Fix lookup through injected-class-names in implicit deduction guides in the
case where the class template has a parameter pack.

Checking of the template arguments expects an "as-written" template argument
list, which in particular does not have any parameter packs. So flatten the
packs into separate arguments before passing them in.

llvm-svn: 295710
2017-02-21 08:42:39 +00:00
Craig Topper fe78d95a49 [X86] Remove ssse3 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSSE3 intrinsics test with SSSE3, AVX, and AVX512 command lines.

llvm-svn: 295708
2017-02-21 08:06:08 +00:00
Craig Topper 55e2de869d [X86] Remove sse4.2 intrinsic tests from the avx intrinsics test file. Fix some other consistency issues.
They are all covered by the SSE4.2 intrinsics test with SSE4.2, AVX, and AVX512 command lines.

Merge sse42.ll into the other intrinsics test. Rename sse42_64.ll to be named like other intrinsic tests.

llvm-svn: 295707
2017-02-21 08:06:05 +00:00
Craig Topper 25191b4ac3 [X86] Remove sse4.1 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE4.1 intrinsics test with SSE4.1, AVX, and AVX512 command lines.

llvm-svn: 295706
2017-02-21 08:06:02 +00:00
Craig Topper da8e6f1337 [X86] Remove sse3 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE3 intrinsics test with SSE2, AVX, and AVX512 command lines.

llvm-svn: 295705
2017-02-21 08:05:59 +00:00
Evgeny Stupachenko 9909872e30 The patch introduces new way of narrowing complex (>UINT16 variants) solutions.
The new method introduced under "-lsr-exp-narrow" option (currenlty set to true).

Summary:

The method is based on registers number mathematical expectation and should be
 generally closer to optimal solution.
Please see details in comments to
 "LSRInstance::NarrowSearchSpaceByDeletingCostlyFormulas()" function
 (in lib/Transforms/Scalar/LoopStrengthReduce.cpp).

Reviewers: qcolombet

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

From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 295704
2017-02-21 07:34:40 +00:00
George Rimar 60f1fe8438 [ELF] - Make ASSERT() return Dot instead of evaluated value.
Previously ASSERT we implemented returned expression value.
Ex:
. = ASSERT(0x100);
would set Dot value to 0x100

Form of assert when it is assigned to Dot was implemented for 
compatibility with very old GNU ld which required it.
Some scripts in the wild, including linux kernel scripts 
use such ASSERTs at the end for doing different checks.

Currently we fail with "unable to move location counter backward"
for such scripts. Patch changes ASSERT to return location counter 
value to fix that.

Differential revision: https://reviews.llvm.org/D30171

llvm-svn: 295703
2017-02-21 07:33:38 +00:00
Craig Topper 002549b8be [X86] Remove aes intrinsic tests from the avx intrinsics test file.
They are all covered by the AES intrinsics test with a legacy command line and an AVX command line.

llvm-svn: 295702
2017-02-21 07:32:18 +00:00
Craig Topper 2a71fd95e8 [X86] Add an AVX command line and regenerate AES intrinsics test using the update_llc_test_checks.py
llvm-svn: 295701
2017-02-21 07:32:14 +00:00
Craig Topper dbf6f367e9 [X86] Remove sse2 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE2 intrinsics test with SSE2, AVX, and AVX512 command lines.

Also remove an unneeded lfence intrinsic test since it was already covered.

llvm-svn: 295700
2017-02-21 07:32:11 +00:00
Craig Topper 0d47fdcf3f [X86] Remove sse1 intrinsic tests from the avx intrinsics test file.
They are all covered by the SSE intrinsics test with SSE, AVX, and AVX512 command lines.

Also remove an unneeded sfence intrinsic test since it was already covered.

llvm-svn: 295699
2017-02-21 07:32:03 +00:00
Richard Smith 7fa88bb844 When deducing an array bound from the length of an initializer list, don't
assume the bound has a non-dependent integral type.

llvm-svn: 295698
2017-02-21 07:22:31 +00:00
Craig Topper d88389aa7e [X86] Use SHLD with both inputs from the same register to implement rotate on Sandy Bridge and later Intel CPUs
Summary:
Sandy Bridge and later CPUs have better throughput using a SHLD to implement rotate versus the normal rotate instructions. Additionally it saves one uop and avoids a partial flag update dependency.

This patch implements this change on any Sandy Bridge or later processor without BMI2 instructions. With BMI2 we will use RORX as we currently do.

Reviewers: zvi

Reviewed By: zvi

Subscribers: llvm-commits

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

llvm-svn: 295697
2017-02-21 06:39:13 +00:00
Richard Smith b4f9625a7b PR32010: Fix template argument depth mixup when forming implicit constructor
template deduction guides for class template argument deduction.

Ensure that we have a local instantiation scope for tracking the instantiated
parameters. Additionally, unusually, we're substituting at depth 1 and leaving
depth 0 alone; make sure that we don't reduce template parameter depth by 2 for
inner parameters in the process. (This is probably also broken for alias
templates in the case where they're expanded within a dependent context, but
this patch doesn't fix that.)

llvm-svn: 295696
2017-02-21 06:30:38 +00:00
Craig Topper 16d9730b86 [X86] Fix formatting. NFC
llvm-svn: 295695
2017-02-21 06:27:13 +00:00
Jason Molenda 599558e69e Fix spelling mistake.
llvm-svn: 295694
2017-02-21 05:09:26 +00:00
Craig Topper d9fe664868 [AVX-512] Use sse_load_f32/f64 in place of scalar_to_vector and scalar load in some patterns.
llvm-svn: 295693
2017-02-21 04:26:10 +00:00
Craig Topper 63b7d71844 [AVX-512] Add test cases showing failure to fold zero extending scalar loads in scalar intrinsics without the peephole pass.
llvm-svn: 295692
2017-02-21 04:26:07 +00:00
Craig Topper d890db6952 [AVX-512] Fix the ExeDomain for vcmpss/vcmpsd.
llvm-svn: 295691
2017-02-21 04:26:04 +00:00
Sanjoy Das 7b0b408973 [ValueTracking] clang-format a section I'm about to touch; NFC
(Whitespace only change)

llvm-svn: 295690
2017-02-21 02:42:42 +00:00
Richard Smith 1832a028af Add template parameter depth and index to -ast-dump output.
llvm-svn: 295689
2017-02-21 02:04:03 +00:00
Matthias Braun 9ab403942b ScheduleDAG: Cleanup; NFC
- Fix doxygen comments (do not repeat documented name, remove definition
    comment if there is already one at the declaration, add \p, ...)
- Add some const modifiers
- Use range based for

llvm-svn: 295688
2017-02-21 01:27:33 +00:00
Matthias Braun 05e5fd6ba2 SubtargetFeature: Cleanup; NFC
- Fix doxygen comments
- Remove duplicated comments
- Remove section comments (which became wrong over time)
- Use more `const` and references but less `auto`

llvm-svn: 295687
2017-02-21 01:27:29 +00:00
Richard Smith 51ec0cf4aa Factor out function to determine whether we're performing a template
instantiation.

In preparation for converting the template stack to a more general context
stack (so we can include context notes for other kinds of context).

llvm-svn: 295686
2017-02-21 01:17:38 +00:00
Sanjoy Das 90208720e3 Add a wrapper around copy_if in STLExtras; NFC
I will add one more use for this in a later change.

llvm-svn: 295685
2017-02-21 00:38:44 +00:00
Taewook Oh 4cf5c1087c [BranchFolding] Update debug location along with the update of branch instruction.
Summary:
Currently, BranchFolder drops DebugLoc for branch instructions in some places. For example, for the test code attached, the branch instruction of 'entry' block has a DILocation of

```
!12 = !DILocation(line: 6, column: 3, scope: !11)
```

, but this information is gone when then block is lowered because BranchFolder misses it. This patch is a fix for this issue.

Reviewers: qcolombet, aprantl, craig.topper, MatzeB

Reviewed By: aprantl

Subscribers: llvm-commits

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

llvm-svn: 295684
2017-02-21 00:12:38 +00:00
Saleem Abdulrasool b3a2d04edd Sema: use PropertyDecl for property selector
Using the constructed name for the class properties with dot syntax may
yield an inappropriate selector (i.e. if it is specified via property
attributes).  Prefer the declaration for the selector, falling back to
the constructed name otherwise.

Patch by David Herzka!

llvm-svn: 295683
2017-02-20 23:45:49 +00:00
Craig Topper e8beaff021 [X86] Add additonal check lines to one of the rotate tests.
llvm-svn: 295682
2017-02-20 23:38:51 +00:00
Craig Topper a80f90e66b [X86] FileCheckize one of the rotate tests.
llvm-svn: 295681
2017-02-20 23:38:48 +00:00
Sanjoy Das 85cd132068 [IndVars] Add an assert
We've already checked that the loop is in simplify form before, but a
little paranoia never hurt anyone.

llvm-svn: 295680
2017-02-20 23:37:11 +00:00
Davide Italiano a9de0109b3 [IR/Verifier] List the CU we weren't able to find in `llvm.dbg.cu`.
llvm-svn: 295678
2017-02-20 22:51:42 +00:00
Daniel Berlin 78cbd28102 MemorySSA: Add support for renaming uses in the updater.
Summary:
This lets one add aliasing stores to the updater.
(i'm next going to move the creation/etc functions to the updater)

Reviewers: george.burgess.iv

Subscribers: llvm-commits, Prazek

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

llvm-svn: 295677
2017-02-20 22:26:03 +00:00
Craig Topper bb10c0f1ec [X86] FileCheckize one of the rotate tests.
llvm-svn: 295676
2017-02-20 19:44:10 +00:00
Steven Wu abfea28867 Fix use-after-free found by ASAN
DenseMap::lookup returns copy of the value in the map. Returning the
address of the temporary return value will cause use-after-free.

llvm-svn: 295675
2017-02-20 18:33:40 +00:00
Alex Lorenz 51c0128310 [Sema][ObjC] perform-selector ARC check should see @selector in parens
llvm-svn: 295674
2017-02-20 17:55:15 +00:00
Craig Topper 2012dda9a0 [AVX-512] Add a few more patterns for selecting masked vpternlog with broadcast loads where the passthru operand is not operand 0.
llvm-svn: 295673
2017-02-20 17:44:09 +00:00
Michael Kruse d9cdeb453d [Cmake] Bump required cmake version to 3.4.3.
This is currently the minimum required version by LLVM. Since LLVM is
needed to build Polly, we also require at least that version.

Suggested-by: Philip Pfaffe <philip.pfaffe@gmail.com>
llvm-svn: 295672
2017-02-20 17:06:31 +00:00
Michael Kruse 5ab24fdb73 [Cmake] Install the isl headers into the install tree.
isl headers are currently missing in a Polly installation. Because the
Polly headers depend on those, code can't be compiled against an
installed Polly.

This patch installs the isl headers. I left a TODO, as optionally it
should be possible to use a system version of isl instead of the one
shipped with Polly.

When compiling, clients of the installation need to add
-I${PREFIX}/include/polly/ to there include path right now, because
there currently is no way to export this path automatically.

Contributed-by: Philip Pfaffe <philip.pfaffe@gmail.com>

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

llvm-svn: 295671
2017-02-20 16:57:14 +00:00
Simon Pilgrim 2967ed1c7e [X86] Tidyup combineExtractVectorElt. NFCI.
Pull out repeated code for extraction index operand and source vector value type.

Use isNullConstant helper to check for zero extraction index.

llvm-svn: 295670
2017-02-20 16:09:45 +00:00
Simon Pilgrim e9a8145adb [X86][SSE] Regenerate extracted bitcasted constant tests and add 32-bit test target
llvm-svn: 295669
2017-02-20 15:57:14 +00:00
Daniel Sanders e604ef5f55 [globalisel] OperandPredicateMatcher's shouldn't need to generate the MachineOperand expr. NFC
Summary:
Each OperandPredicateMatcher shouldn't need to know how to generate the expression
to reference a MachineOperand. The OperandMatcher should provide it.

In addition to separating responsibilities, this also lays some groundwork for
decoupling source patterns from destination patterns to allow invented operands
or operands provided by GlobalISel's equivalent to the ComplexPattern<> class.

Depends on D29709

Reviewers: t.p.northover, ab, rovka, qcolombet, aditya_nandakumar

Reviewed By: ab

Subscribers: dberris, kristof.beyls, llvm-commits, igorb

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

llvm-svn: 295668
2017-02-20 15:30:43 +00:00