Commit Graph

128857 Commits

Author SHA1 Message Date
Marina Yatsina
aa9928a862 [ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + fix bag with curly braces
Until now curly braces could only be used in MS inline assembly to mark block start/end.
All curly braces were removed completely at a very early stage.
This approach caused bugs like:
"m{o}v eax, ebx" turned into "mov eax, ebx" without any error.

In addition, AVX-512 added special operands (e.g., k registers), which are also surrounded by curly braces that mark them as such.
Now, we need to keep the curly braces and identify at a later stage if they are marking block start/end (if so, ignore them), or surrounding special AVX-512 operands (if so, parse them as such).

This patch fixes the bug described above and enables the use of AVX-512 special operands.

This commit is the the llvm part of the patch.
The clang part of the review is: http://reviews.llvm.org/D17766
The llvm part of the review is: http://reviews.llvm.org/D17767

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 18:11:16 +00:00
Adam Nemet
e11fea8823 [ScopedNoAliasAA] Make test basic.ll less confusing
Summary:
This testcase had me confused.  It made me believe that you can use
alias scopes and alias scopes list interchangeably with alias.scope and
noalias.  Both langref and the other testcase use scope lists so I went
looking.

Turns out using scope directly only happens to work by chance.  When
ScopedNoAliasAAResult::mayAliasInScopes traverses this as a scope list:

!1 = !{!1, !0, !"some scope"}

, the first entry is in fact a scope but only because the scope is
happened to be defined self-referentially to make it unique globally.

The remaining elements in the tuple (!0, !"some scope") are considered
as scopes but AliasScopeNode::getDomain will just bail on those without
any error.

This change avoids this ambiguity in the test but I've also been
wondering if we should issue some sort of a diagnostics.

Reviewers: dexonsmith, hfinkel

Subscribers: mssimpso, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 17:49:10 +00:00
Adam Nemet
6b38e591a6 Revert "Enable LoopLoadElimination by default"
This reverts commit r262250.

It causes SPEC2006/gcc to generate wrong result (166.s) in AArch64 when
running with *ref* data set.  The error happens with
"-Ofast -flto -fuse-ld=gold" or "-O3 -fno-strict-aliasing".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 17:38:02 +00:00
Chandler Carruth
0e5929dee0 [memdep] Switch to range based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 15:12:57 +00:00
Chandler Carruth
9daf569e9c [DFSan] Remove an overly aggressive assert reported in PR26068.
This code has been successfully used to bootstrap libc++ in a no-asserts
mode for a very long time, so the code that follows cannot be completely
incorrect. I've added a test that shows the current behavior for this
kind of code with DFSan. If it is desirable for DFSan to do something
special when processing an invoke of a variadic function, it can be
added, but we shouldn't keep an assert that we've been ignoring due to
release builds anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 14:05:09 +00:00
Chandler Carruth
6d15e4501d [memdep] Switch a function to return true on success instead of false.
This is much more clear and less surprising IMO. It also makes things
more consistent with the increasingly large chunk of LLVM code that
assumes true-on-success.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 12:45:07 +00:00
Chandler Carruth
339c492cd0 [memdep] Cleanup the implementation doxygen comments and remove
duplicated comments.

In several cases these had diverged making them especially nice to
canonicalize. I checked to make sure we weren't losing important
information of course.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 12:30:06 +00:00
Chandler Carruth
55d119b9c5 [memdep] Finish cleaning up all of the comments' doxygen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 11:27:56 +00:00
Chandler Carruth
84d0b4a9cd [memdep] Switch from a hacky use of PointerIntPair and poorly chosen
arbitrary integers cast to Instruction pointers to a sum type over
Instruction * and a PointerEmbeddedInt.

No functionality changed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 11:04:46 +00:00
Chandler Carruth
1edc33e7a9 [memdep] Update the comments' doxygen style and place them more clearly.
Just cleaning this up, no functionality changed. Next up will be moving
it to use the sum type instead of arbitrary "pointer"-like enums.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 10:35:02 +00:00
Chandler Carruth
97a88117d2 [memdep] Run clang-format over the header before porting it to
the new pass manager.

The port will involve substantial edits here, and would likely introduce
bad formatting if formatted in isolation, so just get all the formatting
up to snuff. I'll also go through and try to freshen the doxygen here as
well as modernizing some of the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 10:19:30 +00:00
Craig Topper
4016ad20d2 [CodeGen] Add space-optimized EmitMergeInputChains1_2 to the DAG isel matching tables. Shaves about 5100 bytes from the X86 matcher table. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 07:29:12 +00:00
Mehdi Amini
f73f5cd094 Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap
Just like the existing find_as() method, the new insert_as() accepts
an extra parameter which is used as a key to find the bucket in the
map.
When creating a Constant, we want to check the map before actually
creating the object. In this case we have to perform two queries to
the map, and this extra parameter can save recomputing the hash value
for the second query.

This is a reapply of r260458, that was reverted because it was
suspected to be the cause of instability of an internal bot, but
wasn't confirmed.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 00:51:00 +00:00
Mehdi Amini
e47bc8657f Bitcode reader: Inline readAbbreviatedField in readRecord and move the enclosing loop in each case (NFC)
Summary: This make readRecord 20% faster, measured on an LTO build

Reviewers: rafael

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 00:38:09 +00:00
NAKAMURA Takumi
dbdf4107cb Revert r130657, "Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries."
We may assume the type of 1st argument as PCSTR in PENUMLOADED_MODULES_CALLBACK. PSTR was in the ancient mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262810 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 00:13:09 +00:00
Simon Pilgrim
0c5336e71f [X86][AVX512] Fixed VPERMT2* shuffle mask decoding and enabled target shuffle combining.
Patch to add support for target shuffle combining of X86ISD::VPERMV3 nodes, including support for detecting unary shuffles.

This uncovered several issues with the X86ISD::VPERMV3 shuffle mask decoding of non-64 bit shuffle mask elements - the bit masking wasn't being correctly computed.

Removed non-constant pool mask decode path as we have no way of testing it right now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 21:54:52 +00:00
Valery Pykhtin
01c052d64a [AMDGPU] Using table-driven amd_kernel_code_t field parser in assembler.
Engages code from r262804.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 20:25:36 +00:00
Valery Pykhtin
56ec3a463c fix sanitizer-ppc64be-linux failure for r262804
error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]

http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/930

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 15:13:54 +00:00
Valery Pykhtin
4a407fb86e [AMDGPU] table-driven parser/printer for amd_kernel_code_t structure fields
Differential Revision: http://reviews.llvm.org/D17150

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 13:27:13 +00:00
Igor Breger
c3bc454e83 AVX512BW: Support llvm intrinsic masked vector load/store for i8/i16 element types on SKX
Differential Revision: http://reviews.llvm.org/D17913

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 12:38:58 +00:00
Wilfred Hughes
5949d69774 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 12:37:34 +00:00
Valery Pykhtin
8f2541d9b6 [AMDGPU] SOPxx instructions operand naming fixed in td files.
dst -> sdst
ssrcN -> srcN

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 10:31:44 +00:00
Craig Topper
4f67b9a99e [X86] Use high bits of return value from getEncoding instead of predicate functions to populate the REX and VEX prefix bits that extend register encodings. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 08:12:47 +00:00
Craig Topper
2018f22d6e [X86] Remove unnecessary masking. The assert above it already guaranteed it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 08:12:44 +00:00
Craig Topper
9be4b732cf [X86] Use uint8_t instead of unsigned char as it shortens the code and more explicitly reflects the desired size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 08:12:42 +00:00
Igor Breger
64fd08f76f AVX512: Remove VSHRI kmask patterns from TD file. It is incorrect to use kshiftw to implement VSHRI v4i1 , bits 15-4 is undef so the upper bits of v4i1 may not be zeroed. v4i1 should be zero_extend to v16i1 ( or any natively supported vector).
Differential Revision: http://reviews.llvm.org/D17763

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 07:46:03 +00:00
Saleem Abdulrasool
88e2967579 unitests: add some ARM TargetParser tests
The ARM TargetParser would construct invalid StringRefs.  This would cause
asserts to trigger.  Add some tests in LLVM to ensure that we dont regress on
this in the future.  Although there is a test for this in clang, this ensures
that the changes would get caught in the same repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 04:50:55 +00:00
Alexander Kornienko
41664c2aeb [docs] Updated docs to work with Doxygen 1.8.11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06 03:50:08 +00:00
Simon Pilgrim
c5c4d22d26 [X86][AVX] Improved VPERMILPS variable shuffle mask decoding.
Added support for decoding VPERMILPS variable shuffle masks that aren't in the constant pool.

Added target shuffle mask decoding for SCALAR_TO_VECTOR+VZEXT_MOVL cases - these can happen for v2i64 constant re-materialization

Followup to D17681

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 22:53:31 +00:00
Simon Pilgrim
000c5fbea4 [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE
btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 22:00:50 +00:00
Saleem Abdulrasool
2954f99f46 Support: catch invalid accesses
It is possible to invoke these methods on an invalid input resulting in an
invalid substring construction.  It seems that we do not have unit tests for
these methods.  Tests to ensure that the invalid call is caught to follow in
clang.

Resolves PR26839.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 20:00:44 +00:00
Saleem Abdulrasool
99bd86dbd5 ExecutionEngine: tweak debug log
Add a newline to separate the log message.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 20:00:41 +00:00
Yaron Keren
c60ddf6cea Replace GlobalScopeAsm[GlobalScopeAsm.size()-1] with GlobalScopeAsm.back(), NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 16:02:09 +00:00
Krzysztof Parzyszek
0c79dd7f42 Add DAG mutation interface to the post-RA scheduler
Differential Revision: http://reviews.llvm.org/D17868


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 15:45:23 +00:00
Chandler Carruth
dbe4385ab6 [aa-eval] Enhance the comments to better describe the overview of why
this pass exists.

This is based on feedback received when moving this comment from the source
file to a new header file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 08:20:15 +00:00
Matthias Braun
35ea41f3e7 RegisterCoalescer: Remap subregister lanemasks before exchanging operands
Rematerializing and merging into a bigger register class at the same
time, requires the subregister range lanemasks getting remapped to the
new register class.

This fixes http://llvm.org/PR26805

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 04:36:13 +00:00
Matthias Braun
817178adc7 RegisterCoalescer: Need to check DstReg+SrcReg for missing undef flags
copy coalescing with enabled subregister liveness can reveal undef uses,
previously this was only checked for the SrcReg in updateRegDefsUses()
but we need to check DstReg as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 04:36:10 +00:00
Matthias Braun
7f61887009 RegisterPressure: Small cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 04:36:08 +00:00
Quentin Colombet
cb15f707e8 [X86] Fix the lowering of setjmp intrinsic on i386.
When the lowering of the setjmp intrinsic requires
a global base pointer to be set, make sure such pointer
gets defined by the CGBR pass.

This fixes PR26742.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05 00:31:04 +00:00
Quentin Colombet
c9f13a80db Add missing triple in my previous commit!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 23:36:32 +00:00
Quentin Colombet
ed81b643c7 [X86] Do not use cmpxchgXXb when we need the base pointer (RBX).
cmpxchgXXb uses RBX as one of its implicit argument. I.e., when
we use that instruction we need to clobber RBX. This is generally
fine, expect when RBX is a reserved register because in that case,
the register allocator will not track its value and will not
save and restore it when interferences occur.

rdar://problem/24851412


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 23:29:39 +00:00
Sanjay Patel
a6cab8c59e [x86] add tests for masked loads with constant masks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 23:28:07 +00:00
Mike Aizatsky
c0d25bf9b8 [libfuzzer] adding std:string to allowed adaptable argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 23:18:01 +00:00
David Majnemer
8c8e0a684b Fix build breakage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 23:02:15 +00:00
David Majnemer
029ad727ae [X86] Support cleaning more than 2**16 bytes of stack
The x86 ret instruction has a 16 bit immediate indicating how many bytes
to pop off of the stack beyond the return address.

There is a problem when extremely large structs are passed by value: we
might not be able to fit the number of bytes to pop into the return
instruction.

To fix this, expand RET_FLAG a little later and use a special sequence
to clean the stack:

pop  %ecx     ; return address is now in %ecx
add  $n, %esp ; clean the stack
push %ecx     ; bring the return address back on the stack
ret           ; pop the return address and jmp to it's value

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 22:56:17 +00:00
Kostya Serebryany
2c1ecb8c48 [libFuzzer] log less when re-loading files; fix a silly bug: when running single files actually run all of them, not just the first one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 22:35:40 +00:00
Philip Reames
1758dd66cc [LVI] Fix a bug which prevented use of !range metadata within a query
The diff is relatively large since I took a chance to rearrange the code I had to touch in a more obvious way, but the key bit is merely using the !range metadata when we can't analyze the instruction further.  The previous !range metadata code was essentially just dead since no binary operator or cast will have !range metadata (per Verifier) and it was otherwise dropped on the floor.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 22:27:39 +00:00
Rong Xu
5aa1e72861 [PGO] Add a commandline option to control number of the VP annotation metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 22:08:44 +00:00
Michael Kuperstein
2005a3f20e [DAGCombine] Fix divrem combine not to assume div/rem type is simple.
The divrem combine assumed the type of the div/rem is simple, which isn't
necessarily true. This probably worked fine until r250825, since it only
saw legal types, but now breaks when it runs as a pre-type-legalization 
combine.

This fixes PR26835.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 21:23:29 +00:00
Teresa Johnson
9bafe9607a Fix new gold test to specify emulation mode.
The thinlto_linkonceresolution.ll gold linker test introduced in r262727
included a target triple, but didn't set the emulation mode, which is
necessary since the default linker target may be different.

Patch by H.J. Lu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262745 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04 21:19:08 +00:00