Commit Graph

141843 Commits

Author SHA1 Message Date
Chris Bieneman
746d96524f Fix the apple build issue caused by r288956
Should be checking if HAVE_CRASHREPORTERCLIENT_H is defined not relying on it having a value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:28:22 +00:00
Chris Bieneman
1b5c4be5f4 Revert "[CMake] Use cmakedefine01 instead of cmakedefine"
This reverts commit r288959.

Apparently using cmakedefine01 explodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288961 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:25:38 +00:00
Chris Bieneman
5472e8e69f [CMake] Use cmakedefine01 instead of cmakedefine
Looks like we need a 01 value for HAVE_CRASHREPORTERCLIENT_H.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 19:13:32 +00:00
Sanjay Patel
8b90b13aa1 [InstCombine] add tests for smin+icmp; NFC
The tests that already work are folded in InstSimplify, so those
tests should be redundant and we can remove them if they don't
seem worthwhile for completeness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 18:56:55 +00:00
Chris Bieneman
b7e5e7db85 [CMake] Add a check for HAVE_CRASHREPORTERCLIENT_H
The CMake build has been hardcoding this to undef forever, we shouldn't have been doing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 18:53:04 +00:00
Chris Bieneman
cf24fcb20a [ObjectYAML] Support for DWARF __debug_abbrev section
This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288955 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 18:52:59 +00:00
Simon Pilgrim
aee7c6e2f5 [SelectionDAG] Add knownbits support for vector demandedelts in SMAX/SMIN/UMAX/UMIN opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 17:54:00 +00:00
Simon Pilgrim
7b24dd44c8 [X86] Add knownbits vector UMAX test
In preparation for demandedelts support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 17:21:13 +00:00
Simon Pilgrim
3b9d4a0970 [X86][SSE] Remove AND -> VZEXT combine
This is now performed more generally by the target shuffle combine code.

Already covered by tests that were originally added in D7666/rL229480 to support combineVectorZext (or VectorZextCombine as it was known then....).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 17:02:41 +00:00
Simon Pilgrim
def95b9c34 [SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 16:28:21 +00:00
Simon Pilgrim
9b37990fd7 [SelectionDAG] Removed old knownbits TODO comment. NFCI.
EXTRACT_VECTOR_ELT does support demanded elts if the element index is known and in range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:31:12 +00:00
Simon Pilgrim
b23f6fe812 [X86] Add test to show missed opportunities to calculate knownbits in INSERT_VECTOR_ELT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:27:18 +00:00
Simon Pilgrim
5ab68dcc0b [X86][SSE] Fix vpextrd/vpextrq checks
They were testing for the pre-vex versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:10:05 +00:00
Simon Pilgrim
c57b7e50fc [X86][SSE] Force execution domain of 32-bit extractps/pextrd in the stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:06:14 +00:00
Matthew Simpson
b6b20e1aa2 [LV] Scalarize operands of predicated instructions
This patch attempts to scalarize the operand expressions of predicated
instructions if they were conditionally executed in the original loop. After
scalarization, the expressions will be sunk inside the blocks created for the
predicated instructions. The transformation essentially performs
un-if-conversion on the operands.

The cost model has been updated to determine if scalarization is profitable. It
compares the cost of a vectorized instruction, assuming it will be
if-converted, to the cost of the scalarized instruction, assuming that the
instructions corresponding to each vector lane will be sunk inside a predicated
block, possibly avoiding execution. If it's more profitable to scalarize the
entire expression tree feeding the predicated instruction, the expression will
be scalarized; otherwise, it will be vectorized. We only consider the cost of
the entire expression to accurately estimate the cost of the required
insertelement and extractelement instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 15:03:32 +00:00
Benjamin Kramer
1517e2ed72 Try unbreaking the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 13:35:11 +00:00
Simon Pilgrim
03f619110f [X86][SSE] Regenerate test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 13:05:04 +00:00
Dylan McKay
038449d896 [AVR] Expand 'SELECT_CC' nodes whereever possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 12:34:47 +00:00
Benjamin Kramer
fe16faa967 [LowerTypeTests] Use the TrailingObjects infrastructure for trailing objects.
Also avoid allocating ~3x as much memory as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 12:31:45 +00:00
Andrea Di Biagio
4632c8a6b8 When GVN removes a redundant load, it should not modify the debug location of the dominating load.
In the case of a fully redundant load LI dominated by an equivalent load V, GVN
should always preserve the original debug location of V. Otherwise, we risk to
introduce an incorrect stepping.
If V has debug info, then clearly it should not be modified. If V has a null
debugloc, then it is still potentially incorrect to propagate LI's debugloc
because LI may not post-dominate V.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 12:31:36 +00:00
Simon Pilgrim
d2a4d816a1 [X86][SSE] Consistently set MOVD/MOVQ load/store/move instructions to integer domain
We are being inconsistent with these instructions (and all their variants.....) with a random mix of them using the default float domain.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 12:10:49 +00:00
Andrea Di Biagio
dbcb7adb03 [InlineFunction] Refactor code in function `fixupLineNumbers' as suggested by David in D27462. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 12:01:45 +00:00
Simon Dardis
17b733b5ee [mips][rtdyld] Merge code to write relocated values to the section. NFC
Preparation work for implementing N32 support.

Patch By: Daniel Sanders

Reviewers: vkalintiris, atanasyan

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 11:41:23 +00:00
Dylan McKay
f7450dd95f [AVR] Move a pseudo expansion test into a folder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 11:21:45 +00:00
Simon Pilgrim
714162bb4f [X86][XOP] Fix VPERMIL2 non-constant pool shuffle decoding (PR31296)
The non-constant pool version of DecodeVPERMIL2PMask was not offsetting correctly for the second input. I've updated the code to match the implementation in the constant-pool version.

Annoyingly this bug was hidden for so long as it's tricky to combine to useful variable shuffle masks that don't become constant-pool entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 11:19:00 +00:00
Dylan McKay
0007d14057 [AVR] Allow loading from stack slots where src and dest registers are identical
Fixes PR 31256

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 11:08:56 +00:00
Andrea Di Biagio
0736f445e3 [InlineFunction] Do not propagate the callsite debug location to instructions inlined from functions with debug info.
When a function F is inlined, InlineFunction extends the debug location of every
instruction inlined from F by adding an InlinedAt.

However, if an instruction has a 'null' debug location, InlineFunction would
propagate the callsite debug location to it. This behavior existed since
revision 210459.

Revision 210459 was originally committed specifically to workaround the lack of
debug information for instructions inlined from intrinsic functions (which are
usually declared with attributes `__always_inline__, __nodebug__`).

The problem with revision 210459 is that it doesn't make any sort of distinction
between instructions inlined from a 'nodebug' function and instructions which
are inlined from a function built with debug info. This issue may lead to
incorrect stepping in the debugger.

This patch works under the assumption that a nodebug function does not have a
DISubprogram. When a function F is inlined into another function G,
InlineFunction checks if F has debug info associated with it.

For nodebug functions, the InlineFunction logic is unchanged (i.e. it would
still propagate the callsite debugloc to the inlined instructions). Otherwise,
InlineFunction no longer propagates the callsite debug location.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 10:37:26 +00:00
Chandler Carruth
9a9268b704 [PM] Add some more logging to make it more clear when the CGSCC
infrastrucutre is skipping SCCs and RefSCCs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 10:33:15 +00:00
Philip Reames
59d0d38b8d Reintroduce a check accidentally removed in 288873 to fix clang bots
I believe this is the cause of the failure, but have not been able to confirm.  Note that this is a speculative fix; I'm still waiting for a full build to finish as I synced and ended up doing a clean build which takes 20+ minutes on my machine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 04:48:50 +00:00
Philip Reames
315dd3228b Fix a warning introduced in r288874
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 04:11:22 +00:00
Peter Collingbourne
99d6e95c74 LowerTypeTests: Add a test that covers "unsatisfiable" type metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 03:04:34 +00:00
Tom Stellard
c53f76cc0b AMDGPU : Add S_SETREG instructions to fix fdiv precision issues.
Patch By: Wei Ding

Summary: This patch fixes the fdiv precision issues.

Reviewers: b-sumner, cfang, wdng, arsenm

Subscribers: kzhuravl, nhaehnle, yaxunl, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 02:42:15 +00:00
Haicheng Wu
d55bd2eef3 [AArch64] Correct the check of signed 9-bit imm in isLegalAddressingMode()
In the addressing mode, signed 9-bit imm is [-256, 255], not [-512, 511].

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07 01:45:04 +00:00
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