Commit Graph

141810 Commits

Author SHA1 Message Date
Chandler Carruth
742805e0ea [LCG] Add basic verification of the parent set and fix bugs it uncovers.
The existing unittests actually cover this now that we verify things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 01:42:40 +00:00
Philip Reames
d0422a4753 [LVI] Remove used return value from markX functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 01:03:56 +00:00
Philip Reames
7e3547c599 [LVI] Simplify mergeIn code
Remove the unused return type, use early return, use assignment operator.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 00:54:21 +00:00
Philip Reames
4825f8a4b9 [LVI] Simplify obfuscated code
It doesn't matter why something is overdefined if it is...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 00:28:28 +00:00
Peter Collingbourne
2af93f18d5 IR: Reduce the amount of boilerplate required for a metadata kind. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 23:53:01 +00:00
Tom Stellard
89ce12495b AMDGPU: Add llvm.amdgcn.interp.mov intrinsic
Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, tony-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 23:52:13 +00:00
Davide Italiano
1e15122076 [llc] Fix -stop-after=consthoist initializing the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 23:49:58 +00:00
Matt Arsenault
9bdddbab7d AMDGPU: Fix crash on i16 constant expression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 23:18:06 +00:00
Peter Collingbourne
0bf16a5969 LowerTypeTests: Improve performance by optimising type metadata queries.
Requesting metadata for a global is a relatively expensive operation as it
involves a map lookup, but it's one that we need to do relatively frequently in
this pass to collect the list of type metadata nodes associated with a global.
This change improves the performance of type metadata queries by prebuilding
data structures that keep the global together with its list of type metadata,
and changing the pass to use that data structure wherever we were previously
passing global references around.

This change also eliminates some O(N^2) behavior by collecting the list of
globals associated with each type identifier during the first pass over the
list of globals rather than visiting each global to compute that list every
time we add a new type identifier.

Reduces pass runtime on a module containing Chrome's vtables from over 60s
to 0.9s.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 23:02:13 +00:00
Simon Pilgrim
8dc8a8bead [X86][XOP] Add test case for PR31296
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 22:50:13 +00:00
Eli Friedman
0e51e5e82d [CodeGen] Fix result type for SMULO/UMULO legalization
On some platforms (like MSP430) the second element of the result
structure for SMULO/UMULO may have a shorter type than the one
returned by SetCC. We need to truncate it to the right type, or
else some incorrect code may be generated later on.

This fixes issue https://github.com/rust-lang/rust/issues/37829

Patch by Vadzim Dambrouski!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 22:49:36 +00:00
Matt Arsenault
6b92e1ac70 AMDGPU: Fix operand name for v_interp_*
Other VOP instructions call the output vdst

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 22:29:43 +00:00
Sanjay Patel
43179a0fbb [InstSimplify] fixed (?) to not mutate icmps
As Eli noted in the post-commit thread for r288833, the use of
swapOperands() may not be allowed in InstSimplify, so I'm 
removing those calls here pending further review. 

The swap mutates the icmp, and there doesn't appear to be precedent
for instruction mutation in InstSimplify.

I didn't actually have any tests for those cases, so I'm adding
a few here. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 22:09:52 +00:00
Eugene Zelenko
e0732bd441 [IR] Fix some Clang-tidy modernize-use-equals-delete and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 22:00:57 +00:00
Tom Stellard
2fff37f710 AMDGPU/SI: Set correct value for amd_kernel_code_t::kernarg_segment_alignment
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 21:53:10 +00:00
Davide Italiano
7f581f5e5f [BDCE/DebugInfo] Preserve llvm.dbg.value's argument.
BDCE has two phases:
1. It asks SimplifyDemandedBits if all the bits of an instruction are dead, and if so,
replaces all its uses with the constant zero.
2. Then, it asks SimplifyDemandedBits again if the instruction is really dead
(no side effects etc..) and if so, eliminates it.

Now, in 1) if all the bits of an instruction are dead, we may end up replacing a dbg use:
  %call = tail call i32 (...) @g() #4, !dbg !15
  tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !8, metadata !16), !dbg !17
->
  %call = tail call i32 (...) @g() #4, !dbg !15
  tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !8, metadata !16), !dbg !17

but not eliminating the call because it may have arbitrary side effects.
In other words, we lose some debug informations.
This patch fixes the problem making sure that BDCE does nothing with the instruction if
it has side effects and no non-dbg uses.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 21:52:47 +00:00
Tom Stellard
4fae32e28b AMDGPU/SI: Don't move copies of immediates to the VALU
Summary:
If we write an immediate to a VGPR and then copy the VGPR to an
SGPR, we can replace the copy with a S_MOV_B32 sgpr, imm, rather than
moving the copy to the SALU.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 21:13:30 +00:00
Tim Northover
2c23a5b605 GlobalISel: correctly handle small args via memory.
We were rounding size in bits down rather than up, leading to 0-sized slots for
i1 (assert!) and bugs for other types not byte-aligned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 21:02:19 +00:00
Zvi Rackover
42694a3a7e [X86] Prefer reduced width multiplication over pmulld on Silvermont
Summary:
Prefer expansions such as: pmullw,pmulhw,unpacklwd,unpackhwd over pmulld.
On Silvermont [source: Optimization Reference Manual]:
PMULLD has a throughput of 1/11 [instruction/cycles].
PMULHUW/PMULHW/PMULLW have a throughput of 1/2 [instruction/cycles].

Fixes pr31202.

Analysis of this issue was done by Fahana Aleen.

Reviewers: wmi, delena, mkuper

Subscribers: RKSimon, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 19:35:20 +00:00
Simon Pilgrim
6e9255f2d0 [DAGCombine] Add (sext_in_reg (zext x)) -> (sext x) combine
Handle the case where a sign extension has ended up being split into separate stages (typically to get around vector legal ops) and a zext + sext_in_reg gets inserted.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 19:09:37 +00:00
Sanjay Patel
02d83470ab [InstSimplify] add folds for and-of-icmps with same operands
All of these (and a few more) are already handled by InstCombine,
but we shouldn't have to wait until then to simplify these because
they're cheap to deal with here in InstSimplify.

This is the 'and' sibling of the earlier 'or' patch:
https://reviews.llvm.org/rL288833


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 19:05:46 +00:00
Tim Northover
9c3d059fa2 GlobalISel: fall back gracefully when we hit unhandled legalizer default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 19:02:15 +00:00
Simon Pilgrim
3074f79595 [SelectionDAG] We can ignore knownbits from an undef shuffle vector index if we don't actually demand that element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 18:58:25 +00:00
Sanjay Patel
feccc03d8c [InstSimplify] add tests for and-of-icmps; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 18:46:54 +00:00
Tim Northover
3a783f8716 GlobalISel: handle G_SEQUENCE fallbacks gracefully.
There were two problems:
  + AArch64 was reusing random data from its binary op tables, which is
    complete nonsense for G_SEQUENCE.
  + Even when AArch64 gave up and said it couldn't handle G_SEQUENCE,
    the generic code asserted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 18:38:38 +00:00
Tim Northover
22c48aa20e GlobalISel: allow G_SELECT instructions for pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 18:38:34 +00:00
Tim Northover
a5cd8a603e GlobalISel: stop the legalizer from trying to handle oddly-sized types.
It'll almost immediately fail because it always tries to half/double the size
until it finds a legal one. Unfortunately, this triggers an assertion
preventing the DAG fallback from being possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 18:38:29 +00:00
Sanjay Patel
b4824c6afa [InstSimplify] add folds for or-of-icmps with same operands
All of these (and a few more) are already handled by InstCombine,
but we shouldn't have to wait until then to simplify these because
they're cheap to deal with here in InstSimplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 18:09:37 +00:00
George Rimar
1f9118e823 [llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA header
These are OpenBSD specific program headers.

OpenBSD commit:
d39116912b

It is required for fixing PR31288.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 17:55:52 +00:00
Sanjay Patel
b1960d468e [InstSimplify] add tests for or-of-icmps; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 17:49:10 +00:00
Chris Bieneman
461b461526 [CMake] Fixing clang standalone build
I broke this in r288770.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 17:09:29 +00:00
Simon Pilgrim
057100dd3a [X86][SSE] Add knownbits test demonstrating demandedelts not ignoring undef shuffle elements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 17:00:47 +00:00
Simon Pilgrim
06ec4e5b99 [X86][SSE] Added vector sext_in_reg combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 15:57:26 +00:00
George Rimar
614f299a3d Removed trailing whitespaces. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 15:40:02 +00:00
George Rimar
e513e25b57 [Support/ELF] - Add OpenBSD PT_OPENBSD_BOOTDATA constant.
OpenBSD commit for reference:
d39116912b

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 15:38:15 +00:00
Simon Pilgrim
42fe8f58c5 [X86] Improve UMAX/UMIN knownbits test
Test the sequential effect of each op

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 15:17:50 +00:00
Simon Pilgrim
44a9007743 Avoid repeated calls to Op.getOpcode(). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288814 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 14:50:09 +00:00
Daniel Sanders
cef5592d6d [globalisel][aarch64] Fix unintended assumptions about PartialMappingIdx. NFC.
Summary:
This is NFC but prevents assertions when PartialMappingIdx is tablegen-erated.
The assumptions were:
1) FirstGPR is 0
2) FirstGPR is the first of the First* enumerators.

GPR32 is changed to 1 to demonstrate that assumption #1 is fixed. #2 will
be covered by a subsequent patch that tablegen-erates information and swaps
the order of GPR and FPR as a side effect.

Depends on D27336

Reviewers: ab, t.p.northover, qcolombet

Subscribers: aemerson, rengolin, vkalintiris, dberris, rovka, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 14:39:57 +00:00
Daniel Sanders
462ab869ac [globalisel][aarch64] Replace magic numbers with corresponding enumerators in ValMappings. NFC
Reviewers: ab, t.p.northover, qcolombet

Subscribers: aemerson, rengolin, vkalintiris, dberris, llvm-commits, rovka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 13:55:01 +00:00
Daniel Sanders
10ef691126 [globalisel][aarch64] Correct argument names in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 13:48:58 +00:00
Simon Pilgrim
8c88727b77 [SLPVectorizer][X86] Tests to show missed buildvector sitofp/fptosi vectorizations
e.g.
buildvector(sitofp(i32), sitofp(i32), sitofp(i32), sitofp(i32)) --> sitofp(buildvector(i32, i32, i32, i32))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 13:29:55 +00:00
Oliver Stannard
91bc1bbfb2 [ARM] Better error message for invalid flag-preserving Thumb1 insts
When we see a non flag-setting instruction for which only the flag-setting
version is available in Thumb1, we should give a better error message than
"invalid instruction".

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 12:59:08 +00:00
Ayman Musa
c700b40b54 [X86][AVX512] Detect repeated constant patterns in BUILD_VECTOR suitable for broadcasting.
Check if a build_vector node includes a repeated constant pattern and replace it with a broadcast of that pattern.
For example:
"build_vector <0, 1, 2, 3, 0, 1, 2, 3>" would be replaced by "broadcast <0, 1, 2, 3>"

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 12:24:14 +00:00
Simon Pilgrim
01544ba3a3 [X86] Add tests to show missed opportunities to calculate knownbits in SMAX/SMIN/UMAX/UMIN
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 12:12:20 +00:00
Nemanja Ivanovic
3d641da82e [PowerPC] Improvements for BUILD_VECTOR Vol. 4
This is the final patch in the series of patches that improves
BUILD_VECTOR handling on PowerPC. This adds a few peephole optimizations
to remove redundant instructions. It also adds a large test case which
encompasses a large set of code patterns that build vectors - this test
case was the motivator for this series of patches.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 11:47:14 +00:00
Daniel Sanders
a0010d9f6b [globalisel][aarch64] Prefix PartialMappingIdx enumerators with 'PMI_' to fit coding standards.
This also stops things like 'None' polluting the llvm::AArch64 namespace.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 11:33:04 +00:00
Simon Pilgrim
975669a6b6 Fix MSVC -Wmicrosoft-enum-value 'enumerator value is not representable' warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 11:27:19 +00:00
Simon Pilgrim
7b48d47c58 Fix MSVC bool to uint64_t promotion warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 11:12:53 +00:00
Chandler Carruth
04d64487f9 [LCG] Add some much needed asserts and verify runs to uncover
a hilarious bug and fix it.

We somehow were never verifying the RefSCCs newly formed when
splitting an existing one apart, and when verifying them we weren't
really checking the SCC indices mapping effectively.

If we had been, it would have been blindingly obvious that right after
putting something int `RC.SCCs` we should update `RC.SCCIndices` instead
of `SCCIndices` which we were about to clear and rebuild anyways. =[

Anyways, this is thoroughly covered by existing tests now that we
actually verify things properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 10:29:23 +00:00
Florian Hahn
c153f037fe [framelowering] Improve tracking of first CS pop instruction.
Summary: This patch makes sure FirstCSPop and MBBI never point to DBG_VALUE instructions, which affected the code generated.

Reviewers: mkuper, aprantl, MatzeB

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-06 10:24:55 +00:00