Commit Graph

141939 Commits

Author SHA1 Message Date
Benjamin Kramer
eae8838603 Fix memory leak in unit test.
The StringPool entries are destroyed with the allocator, the string pool
itself is not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 13:12:30 +00:00
NAKAMURA Takumi
f6da5c09fa llvm/test/Object/archive-thin-create.test: Make sure that %t is empty to stabilize the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 11:44:57 +00:00
Dylan McKay
5aeda31aad [AVR] Remove a set of redundant tests
This fixes the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 11:22:26 +00:00
Simon Pilgrim
ce7af2b725 [SelectionDAG] Add partial BITCAST support to computeKnownBits
Adds support for bitcasting a little endian 'small element' vector to 'large element' scalar/vector (e.g. v16i8 to v4i32 or v2i32 to i64), which is required for PR30845. We extract the knownbits for each 'small element' part and concatenate the results together.

We can add support for big endian and 'large element' scalar/vector to 'small element' vector bitcasting once we have test cases for them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 10:13:45 +00:00
Malcolm Parsons
b483e9e9a2 Update Doxygen comment in StringSaver (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 09:33:33 +00:00
Daniel Jasper
a47587665f Revert "[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes"
This reverts commit r288916 as it is currently causing a crasher in
Halide. Reproducer on llvm.org/PR31323. While it might be that halide is
generating invalid IR, llc shouldn't crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 09:04:51 +00:00
Craig Topper
ff96f08e32 [X86] Modify patterns from memory form of RCP/RSQRT/SQRT intrinsics to only allow (scalar_to_vector (loadf32/load64)) instead of anything that sse_load_f32/f64 can match.
sse_load_f32/f64 can also match loads that are zero extended to vectors. We shouldn't match that because we wouldn't be able to get the instruction to zero the upper bits like the intrinsic semantics would require for such a case.

There is a test case that does depend on this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 07:57:21 +00:00
Dylan McKay
3e9ee5f060 [AVR] Use a more appropriate integer type for wide IN/OUT instructions
We could previously select an integer which would hit an assertion error
in pseudo expansion.

The new type will also generate the appropriate fixups if needed, which
wasn't done beforehand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 07:49:14 +00:00
Dylan McKay
153fa865c6 [AVR] Add tests for a large number of pseudo instructions
This adds MIR tests for 24 pseudo instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 07:49:04 +00:00
Craig Topper
b2d19fd116 [AVX-512] Correctly preserve the passthru semantics of the FMA scalar intrinsics
Summary:
Scalar intrinsics have specific semantics about the which input's upper bits are passed through to the output. The same input is also supposed to be the input we use for the lower element when the mask bit is 0 in a masked operation. We aren't currently keeping these semantics with instruction selection.

This patch corrects this by introducing new scalar FMA ISD nodes that indicate whether operand 1(one of the multiply inputs) or operand 3(the additon/subtraction input) should pass thru its upper bits.

We use this information to select 213/132 form for the operand 1 version and the 231 form for the operand 3 version.

We also use this information to suppress combining FNEG operations on the passthru input since semantically the passthru bits aren't negated. This is stronger than the earlier check added for a user being SELECTS so we can remove that.

This fixes PR30913.

Reviewers: delena, zvi, v_klochkov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 06:42:28 +00:00
Matt Arsenault
d5f7f7449e AMDGPU: Select i16 instructions to VOP3 forms
These were selecting directly to the VOP2 form instead
of VOP3 like the i32 instructions. Fixes regressions in
future commits where an immediate isn't folded because it was
initially used for the second operand.

Because uniform 16-bit operations are promoted to i32, it's
difficult to get a simple testcase where this matters. Fold
failures in SIFoldOperands here tend to be hidden by commute
and fold in SIShrinkInstructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 06:19:12 +00:00
Peter Collingbourne
4b3d007c4d Re-commit r289184, "Support: Use a 64-bit seek in raw_fd_ostream::seek()." with a configure-time check for lseek64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 05:20:43 +00:00
Craig Topper
4c603b39c6 [X86] Add masked versions of VPERMT2* and VPERMI2* to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 05:20:11 +00:00
Peter Collingbourne
50e5aca640 Revert r289184, we need more configury for Darwin and *BSD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 05:04:30 +00:00
Peter Collingbourne
85ea24d6da Support: Use a 64-bit seek in raw_fd_ostream::seek().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 04:57:19 +00:00
Davide Italiano
11200e161b [SCCP] Make the test added in r289175 more meaningful.
Add a comment while here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 03:49:20 +00:00
Davide Italiano
45b7e0e48d [SCCP] Teach the pass about mul %x 0 even if %x is overdefined.
The motivating example is:

extern int patatino;
int goo() {
    int x = 0;
    for (int i = 0; i < 1000000; ++i) {
        x *= patatino;
    }
    return x;
}

Currently SCCP will not realize that this function returns always zero,
therefore will try to unroll and vectorize the loop at -O3 producing an
awful lot of (useless) code. With this change, it will just produce:

0000000000000000 <g>:
   xor    %eax,%eax
   retq

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 03:08:42 +00:00
Craig Topper
54d8245b23 [AVX-512] Add vpermilps/pd to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 02:18:11 +00:00
Craig Topper
d80aa69605 [AVX-512] Move some floating point stack folding test cases out of the integer test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 02:18:07 +00:00
Craig Topper
c341071db3 [Analysis] Fix typo in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 02:18:04 +00:00
Kostya Serebryany
a3def13005 [libFuzzer] implement crash-resistant merge (https://github.com/google/sanitizers/issues/722). This is a first experimental variant that needs some more testing, thus not yet adding a lit test (but there are unit tests).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289166 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 01:17:24 +00:00
Peter Collingbourne
c8e39ef801 WholeProgramDevirt: Teach the pass to handle structs of arrays.
This will become necessary in some cases once D22296 lands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 01:10:11 +00:00
Chandler Carruth
410e7953c3 [LCG] Minor cleanup to the LCG walk over a function, NFC.
This just hoists the check for declarations up a layer which allows
various sets used in the walk to be smaller. Also moves the relevant
comments to match, and catches a few other cleanups in this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 00:46:44 +00:00
Peter Collingbourne
5ecad331e4 Make WholeProgramDevirt understand ConstStruct vtables.
Based on a patch by LemonBoy!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 00:33:27 +00:00
Chris Bieneman
18245f6cf7 [ObjectYAML] Support for DWARF debug_aranges
This patch adds support for round tripping DWARF debug_aranges in and out of YAML.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-09 00:26:44 +00:00
Sanjay Patel
c828f5b04a [InstCombine] add tests for umin+icmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 23:44:58 +00:00
Sanjay Patel
d0dc2aae8c [InstCombine] add tests for umax+icmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 23:36:57 +00:00
Zia Ansari
ea5455c788 [InstSimplify] Add "X / 1.0" to SimplifyFDivInst.
Differential Revision: https://reviews.llvm.org/D27587


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 23:27:40 +00:00
Sanjay Patel
0261b12fff [InstCombine] add tests for smax+icmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 23:16:06 +00:00
Tim Northover
a6b6846c2f GlobalISel: fall back gracefully for debug intrinsics.
Supporting them properly is a reasonably complex chunk of work, so to allow bot
testing before then we should at least be able to fall back to DAG ISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:44:13 +00:00
Tim Northover
8fd7b713cc GlobalISel: factor overflow handling into separate function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:44:00 +00:00
Davide Italiano
a47129de89 [SCCP] Make sure SCCP and ConstantFolding agree on undef >> a.
Currently SCCP folds the value to -1, while ConstantProp folds to
0. This changes SCCP to do what ConstantFolding does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:28:53 +00:00
Simon Atanasyan
b99cfea378 [mips] Make the test case more specific and provide OS component of a triple. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:10:52 +00:00
Simon Atanasyan
8133f26e49 [mips] Change instruction s/daddiu/addiu/ since O32 prohibits the use of 64-bit GPRs. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:10:48 +00:00
Simon Atanasyan
f375f74c8a [mips] Change gnueabi to gnu in the triple because EABI has been removed recently. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:10:44 +00:00
Simon Atanasyan
52fccbe647 [mips] Remove N32 Android test because Android does not support N32 ABI. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 22:10:38 +00:00
Reid Kleckner
477e64915f Don't emit .seh_handler directives for any cleanup funclets
We were falsely claiming that we had an LSDA for the relevant EH
personality before this change, which could lead to the EH machinery
interpreting random adjacent data as an LSDA.

Fixes PR31317

This change is safe because cleanups can't contain exception handlers
today. We do these things to maintain that invariant:
- C++ destructors are naturally out-of-line
- __finally blocks are outlined in clang
- LLVM's inliner will not inline EH constructs into cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289101 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 20:38:46 +00:00
Krzysztof Parzyszek
73a6d5ba6a [RDF] Fix incorrect lane mask calculation
This was exposed by some code that used more than one level of sub-
registers. There is no testcase, because there is no such code in the
Hexagon backend.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 20:33:45 +00:00
Sanjay Patel
328a9cb5c6 [InstSimplify] add fdiv x/1.0 test and update checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 20:23:56 +00:00
Matt Arsenault
beec226db5 AMDGPU: Make f16 ConstantFP legal
Not having this legal led to combine failures, resulting
in dumb things like bitcasts of constants not being folded
away.

The only reason I'm leaving the v_mov_b32 hack that f32
already uses is to avoid madak formation test regressions.
PeepholeOptimizer has an ordering issue where the immediate
fold attempt is into the sgpr->vgpr copy instead of the actual
use. Running it twice avoids that problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289096 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 20:14:46 +00:00
Stanislav Mekhanoshin
00f1f5a961 [AMDGPU] Fix number of reserved SGPRs on CI to reflect flat scratch use
Differential Revision: https://reviews.llvm.org/D27225

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 20:07:23 +00:00
Matt Arsenault
545a46b9c2 AMDGPU: Fix commuting v_sub_u16
The correct commutable opcode was set to itself, so this
was simply swapping the operands to commute instead of also
changing the opcode to v_subrev_u16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 19:52:38 +00:00
Stanislav Mekhanoshin
fcb33c493a [AMDGPU] Add amdgpu-unify-metadata pass
Multiple metadata values for records such as opencl.ocl.version, llvm.ident
and similar are created after linking several modules. For some of them, notably
opencl.ocl.version, this creates semantic problem because we cannot tell which
version of OpenCL the composite module conforms.

Moreover, such repetitions of identical values often create a huge list of
unneeded metadata, which grows bitcode size both in memory and stored on disk.
It can go up to several Mb when linked against our OpenCL library. Lastly, such
long lists obscure reading of dumped IR.

The pass unifies metadata after linking.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 19:46:04 +00:00
Peter Collingbourne
b29976c54b IR, X86: Understand !absolute_symbol metadata on global variables.
Summary:
Attaching !absolute_symbol to a global variable does two things:
1) Marks it as an absolute symbol reference.
2) Specifies the value range of that symbol's address.
Teach the X86 backend to allow absolute symbols to appear in place of
immediates by extending the relocImm and mov64imm32 matchers. Start using
relocImm in more places where it is legal.

As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 19:01:00 +00:00
Chris Bieneman
4d6c7e915f [ObjectYAML] Remove DWARF from class names
Since all the DWARF classes are in a DWARFYAML namespace having every class start with DWARF seems like a bit of overkill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 17:46:57 +00:00
Alexander Timofeev
9ae2b48b84 [AMDGPU] Scalarization of global uniform loads.
Summary:
LC can currently select scalar load for uniform memory access
basing on readonly memory address space only. This restriction
originated from the fact that in HW prior to VI vector and scalar caches
are not coherent. With MemoryDependenceAnalysis we can check that the
memory location corresponding to the memory operand of the LOAD is not
clobbered along the all paths from the function entry.

Reviewers: rampitec, tstellarAMD, arsenm

Subscribers: wdng, arsenm, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 17:28:47 +00:00
Keno Fischer
83dc06334f ConstantFolding: Don't crash when encountering vector GEP
ConstantFolding tried to cast one of the scalar indices to a vector
type. Instead, use the vector type only for the first index (which
is the only one allowed to be a vector) and use its scalar type
otherwise.

Fixes PR31250.

Reviewers: majnemer
Differential Revision: https://reviews.llvm.org/D27389

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 17:22:35 +00:00
Greg Clayton
23e3fe93ac Fix ASAN buildbots by fixing a double free crash.
The dwarfgen::Generator::StringPool was in a unique_ptr but it was owned by the Allocator member variable so it was being free twice.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 16:57:04 +00:00
NAKAMURA Takumi
c3e85bfe21 Prune unused libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 15:28:02 +00:00
NAKAMURA Takumi
806f05a329 Prune unused \param(s) in r289050. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 15:00:12 +00:00