Dehao Chen [Tue, 21 Mar 2017 19:55:46 +0000 (19:55 +0000)]
Clang change: Do not inline hot callsites for samplepgo in thinlto compile phase.
Summary:
Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro
file, thus we do not want to inline hot callsites in the first phase.
Reviewers: tejohnson, eraman
Reviewed By: tejohnson
Subscribers: mehdi_amini, cfe-commits, Prazek
Differential Revision: https://reviews.llvm.org/D31202
llvm-svn: 298429
Dehao Chen [Tue, 21 Mar 2017 19:55:36 +0000 (19:55 +0000)]
Do not inline hot callsites for samplepgo in thinlto compile phase.
Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in profile, thus we do not want to inline hot callsites in the first phase.
Reviewers: tejohnson, eraman
Reviewed By: tejohnson
Subscribers: mehdi_amini, llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D31201
llvm-svn: 298428
Zachary Turner [Tue, 21 Mar 2017 19:35:05 +0000 (19:35 +0000)]
[ADT] Add a version of llvm::join() that takes a range.
llvm-svn: 298427
Coby Tayree [Tue, 21 Mar 2017 19:33:32 +0000 (19:33 +0000)]
[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a compound expression
This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions.
Currently - only supported as a stand alone Operand, e.g.:
"TYPE X"
now allowed :
"4 + TYPE X * 128"
LLVM side: https://reviews.llvm.org/D31173
Differential Revision: https://reviews.llvm.org/D31174
llvm-svn: 298426
Coby Tayree [Tue, 21 Mar 2017 19:31:55 +0000 (19:31 +0000)]
[X86][MS-compatability][llvm] allow MS TYPE/SIZE/LENGTH operators as a part of a compound expression
This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions.
Currently - only supported as a stand alone Operand, e.g.:
"TYPE X"
now allowed :
"4 + TYPE X * 128"
Clang side: https://reviews.llvm.org/D31174
Differential Revision: https://reviews.llvm.org/D31173
llvm-svn: 298425
Guillaume Papin [Tue, 21 Mar 2017 19:17:53 +0000 (19:17 +0000)]
[CMake] fix CLANG_INCLUDE_DIRS CMake export
Summary:
This change should fixes the export of CLANG_INCLUDE_DIRS variable in ClangConfig.cmake.
Unlike for the other variables, CLANG_INSTALL_PREFIX wasn't escaped meaning CLANG_INCLUDE_DIRS
resulting in the path "/include" instead of "${CLANG_INSTALL_PREFIX}/include".
Reviewers: beanz
Subscribers: mgorny
Differential Revision: https://reviews.llvm.org/D30911
llvm-svn: 298424
Davide Italiano [Tue, 21 Mar 2017 19:17:23 +0000 (19:17 +0000)]
[X86] Remove extra semicolon to placate GCC. NFCI.
llvm-svn: 298423
Marshall Clow [Tue, 21 Mar 2017 19:12:21 +0000 (19:12 +0000)]
Fix a couple of 'C++11'-isms from the last checkin, which broke the '03 bot.
llvm-svn: 298422
Aaron Ballman [Tue, 21 Mar 2017 19:01:17 +0000 (19:01 +0000)]
Prevent cppcoreguidelines-pro-bounds-array-to-pointer-decay from diagnosing array to pointer decay stemming from system macros.
Patch by Breno Rodrigues Guimaraes.
llvm-svn: 298421
Konstantin Zhuravlyov [Tue, 21 Mar 2017 18:55:39 +0000 (18:55 +0000)]
Fix array sizes where address space is not yet known
For variables in generic address spaces, for example:
```
unsigned char V[
6442450944];
...
```
the address space is not yet known when we get into
*getConstantArrayType*, it is 0. AMDGCN target's
address space 0 has 32 bits pointers, so when we
call *getPointerWidth* with 0, the array size is
trimmed to 32 bits, which is not right.
Differential Revision: https://reviews.llvm.org/D30845
llvm-svn: 298420
Zachary Turner [Tue, 21 Mar 2017 18:45:42 +0000 (18:45 +0000)]
Fix build broken by StringList move.
llvm-svn: 298419
Marshall Clow [Tue, 21 Mar 2017 18:40:46 +0000 (18:40 +0000)]
Add a bit more to one of the chrono tests
llvm-svn: 298418
Artyom Skrobov [Tue, 21 Mar 2017 18:39:41 +0000 (18:39 +0000)]
[ARM] Recommit the glueless lowering of addc/adde in Thumb1,
including the amended (no UB anymore) fix for adding/subtracting -
2147483648.
This reverts r298328 "[ARM] Revert r297443 and r297820."
and partially reverts r297842 "Revert "[Thumb1] Fix the bug when adding/subtracting -
2147483648""
llvm-svn: 298417
Marshall Clow [Tue, 21 Mar 2017 18:38:57 +0000 (18:38 +0000)]
Implement P0548: 'common_type and duration' This involves a subtle change in the return type of the unary +/- operators for std::chrono::duration, though I expect that no one will notice.
llvm-svn: 298416
Zachary Turner [Tue, 21 Mar 2017 18:31:08 +0000 (18:31 +0000)]
Delete eol-style:native SVN property.
llvm-svn: 298415
Duncan P. N. Exon Smith [Tue, 21 Mar 2017 18:26:18 +0000 (18:26 +0000)]
Modules: Remove an invalid check in unit tests for r298278
This is a fixup for the unit tests from r298278 (originally r298165).
Since the buffer that RawB2 pointed at was later deleted, a new call to
getBuffer may very well return a buffer at the same/old address. Which is
fine. Just delete the spurious check.
A Windows bot was occasionally hitting this in practice:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7086
llvm-svn: 298414
Bob Haarman [Tue, 21 Mar 2017 18:25:35 +0000 (18:25 +0000)]
[compiler-rt] respect CMAKE_EXE_LINKER_FLAGS in compiler and library tests
Summary: check_cxx_compiler_flag and check_library_exists could fail because they ignored CMAKE_EXE_LINKER_FLAGS and therefore would always fail to produce executables. Cmake policy CMP0056 fixes this, but was explicitly set to OLD in our CMakeLists because it caused problems with test_target_arch. This change sets the policy to NEW to fix the problem with the compiler and library tests, and temporarily clears CMAKE_EXE_LINKER_FLAGS inside test_target_arch to emulate the old behavior there. This allows, for example, LTO builds that require lld to succeed.
Reviewers: davidxl, beanz
Reviewed By: beanz
Subscribers: fjricci, dberris, mgorny, mehdi_amini, tejohnson, rnk, llvm-commits
Differential Revision: https://reviews.llvm.org/D31098
llvm-svn: 298413
Zachary Turner [Tue, 21 Mar 2017 18:25:04 +0000 (18:25 +0000)]
Move StringList from Core -> Utility.
llvm-svn: 298412
George Rokos [Tue, 21 Mar 2017 18:19:09 +0000 (18:19 +0000)]
[OpenMP] libomptarget: Disable on MacOS X
Disable compilation of libomptarget on MacOS X.
Differential Revision: https://reviews.llvm.org/D31055
llvm-svn: 298411
Erich Keane [Tue, 21 Mar 2017 17:49:17 +0000 (17:49 +0000)]
Correct class-template deprecation behavior
Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;
This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.
Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.
Differential Revision: https://reviews.llvm.org/D27486
llvm-svn: 298410
Kamil Rytarowski [Tue, 21 Mar 2017 17:39:15 +0000 (17:39 +0000)]
Create instance of DynamicLoaderPOSIXDYLD on NetBSD
Summary:
NetBSD is a modern ELF UNIX-like system.
There is requires DynamicLoaderPOSIXDYLD e.g. for ELF AUXV reading from the client.
Sponsored by <The NetBSD Foundation>
Reviewers: labath, joerg, kettenis
Reviewed By: labath
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31192
llvm-svn: 298409
Kamil Rytarowski [Tue, 21 Mar 2017 17:30:47 +0000 (17:30 +0000)]
Add stub for PluginProcessNetBSD
Summary:
This is the base for introduction of further features to support Process Tracing on NetBSD, in local and remote setup.
This code is also a starting point to synchronize the development with other BSDs. Currently NetBSD is ahead and other systems can catch up.
Sponsored by <The NetBSD Foundation>
Reviewers: emaste, joerg, kettenis, labath
Reviewed By: labath
Subscribers: mgorny, #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31138
llvm-svn: 298408
Kamil Rytarowski [Tue, 21 Mar 2017 17:27:59 +0000 (17:27 +0000)]
Enable AUXV and QPassSignals in gdb-remote for NetBSD
Summary:
NetBSD is an ELF platform and it uses Elf Auxiliary Vector like Linux and other modern BSDs.
While there enable QPassSignals for the NetBSD port as well.
Sponsored by <The NetBSD Foundation>
Reviewers: labath, kettenis, joerg, emaste
Reviewed By: labath
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31146
llvm-svn: 298407
Kamil Rytarowski [Tue, 21 Mar 2017 17:26:55 +0000 (17:26 +0000)]
Enable ProcessPOSIXLog on NetBSD
Summary:
NetBSD can share the same logging functionality with Linux and FreeBSD.
Sponsored by <The NetBSD Foundation>
Reviewers: labath, emaste, joerg, kettenis
Reviewed By: labath, emaste
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31191
llvm-svn: 298406
Kamil Rytarowski [Tue, 21 Mar 2017 17:25:47 +0000 (17:25 +0000)]
Add NetBSD case in Entry::Type::ThreadID
Summary:
NetBSD native threads are printed as 64-bit unsigned integers.
The underlying system type of a thread identity is lwpid_t of type int32_t. For consistency with Linux and FreeBSD share the 64-bit unsigned integer type.
Sponsored by <The NetBSD Foundation>
Reviewers: labath, kettenis, joerg, emaste
Reviewed By: labath, emaste
Subscribers: #lldb
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31132
llvm-svn: 298405
Dehao Chen [Tue, 21 Mar 2017 17:22:35 +0000 (17:22 +0000)]
Use ProfileSummary:getProfileCount to get ScaledCount for ModuleSummary
Summary: ModuleSummary should use the standard interface of ProfileSummary::getProfileCount.
Reviewers: eraman, tejohnson
Reviewed By: tejohnson
Subscribers: tejohnson, mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D31154
llvm-svn: 298404
Rui Ueyama [Tue, 21 Mar 2017 17:22:13 +0000 (17:22 +0000)]
Update comment.
llvm-svn: 298403
Reid Kleckner [Tue, 21 Mar 2017 17:15:50 +0000 (17:15 +0000)]
Remove stray paren that got in while attempting to fix the build for AttributeList
llvm-svn: 298402
Adrian Prantl [Tue, 21 Mar 2017 17:14:30 +0000 (17:14 +0000)]
Revert 298388 and 298389 because they broke some AMDGPU tests.
llvm-svn: 298401
Krzysztof Parzyszek [Tue, 21 Mar 2017 17:09:27 +0000 (17:09 +0000)]
Recommit r298282 with fixes for memory allocation/deallocation
[Hexagon] Recognize polynomial-modulo loop idiom again
Regain the ability to recognize loops calculating polynomial modulo
operation. This ability has been lost due to some changes in the
preceding optimizations. Add code to preprocess the IR to a form
that the pattern matching code can recognize.
llvm-svn: 298400
Reid Kleckner [Tue, 21 Mar 2017 17:09:20 +0000 (17:09 +0000)]
Update for LLVM API rename of AttributeSet -> AttributeList
llvm-svn: 298399
Reid Kleckner [Tue, 21 Mar 2017 17:05:00 +0000 (17:05 +0000)]
Fix RST docs AttributeList heading underline
llvm-svn: 298398
Marek Olsak [Tue, 21 Mar 2017 17:00:39 +0000 (17:00 +0000)]
AMDGPU: Buffer descriptor changes for GFX9
Reviewers: arsenm
Subscribers: qcolombet, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, dstuttard, tpr
Differential Revision: https://reviews.llvm.org/D31158
llvm-svn: 298397
Marek Olsak [Tue, 21 Mar 2017 17:00:32 +0000 (17:00 +0000)]
AMDGPU: Always use VGPR indexing on GFX9
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, dstuttard, tpr
Differential Revision: https://reviews.llvm.org/D31157
llvm-svn: 298396
Krzysztof Parzyszek [Tue, 21 Mar 2017 16:59:40 +0000 (16:59 +0000)]
[Hexagon] Add -march=hexagon to a testcase
llvm-svn: 298395
Reid Kleckner [Tue, 21 Mar 2017 16:57:30 +0000 (16:57 +0000)]
Update Clang for LLVM rename AttributeSet -> AttributeList
llvm-svn: 298394
Reid Kleckner [Tue, 21 Mar 2017 16:57:19 +0000 (16:57 +0000)]
Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.
Rename AttributeSetImpl to AttributeListImpl to follow suit.
It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.
Reviewers: sanjoy, javed.absar, chandlerc, pete
Reviewed By: pete
Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits
Differential Revision: https://reviews.llvm.org/D31102
llvm-svn: 298393
Argyrios Kyrtzidis [Tue, 21 Mar 2017 16:56:02 +0000 (16:56 +0000)]
[index/AST] Determine if a typedef shares a name and spelling location with its underlying tag type
In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent',
meaning we treat its references as symbols of the underlying tag symbol.
Also provide a libclang API to check for such typedefs.
llvm-svn: 298392
Bruno Cardoso Lopes [Tue, 21 Mar 2017 16:43:51 +0000 (16:43 +0000)]
[Modules] Find PrivateHeaders when looking into subframeworks
Fix the current parsing of subframeworks in modulemaps to lookup for
headers based on whether they are frameworks.
rdar://problem/
30563982
llvm-svn: 298391
Matt Arsenault [Tue, 21 Mar 2017 16:42:50 +0000 (16:42 +0000)]
AMDGPU: Fix not including v2i16/v2f16 in register class
llvm-svn: 298390
Adrian Prantl [Tue, 21 Mar 2017 16:37:39 +0000 (16:37 +0000)]
Don't compose DWARF expressions with multiple subregisters.
If a register location can only be described by a complex expression
(i.e., multiple subregisters) it doesn't safely compose with another
complex expression. For example, it is not possible to apply a
DW_OP_deref operation to multiple DW_OP_pieces.
llvm-svn: 298389
Adrian Prantl [Tue, 21 Mar 2017 16:37:35 +0000 (16:37 +0000)]
DwarfExpression: Defer emitting DWARF register operations
until the rest of the expression is known.
This is still an NFC refactoring in preparation of a subsequent bugfix.
llvm-svn: 298388
Matt Arsenault [Tue, 21 Mar 2017 16:32:17 +0000 (16:32 +0000)]
AMDGPU: Fix asserting on 0 dmask for image intrinsics
Fold these to undef during lowering so users get eliminated.
llvm-svn: 298387
Matt Arsenault [Tue, 21 Mar 2017 16:24:12 +0000 (16:24 +0000)]
AMDGPU: Convert image intrinsic uses in tests
llvm-svn: 298386
Matt Arsenault [Tue, 21 Mar 2017 16:20:16 +0000 (16:20 +0000)]
DAG: Fold bitcast/extract_vector_elt of undef to undef
Fixes not eliminating store when intrinsic is lowered to undef.
llvm-svn: 298385
Dmitry Vyukov [Tue, 21 Mar 2017 15:37:48 +0000 (15:37 +0000)]
tsan: fix pie_no_aslr test
It failed on clang-cmake-aarch64-39vma.
Restrict it to x86_64 only.
llvm-svn: 298383
Chandler Carruth [Tue, 21 Mar 2017 15:31:15 +0000 (15:31 +0000)]
Revert r298274: "Use pthreads for thread-local lsan allocator cache on darwin"
This fixes a failure currently present on the upstream linux boxes (and
reproduces for me as well):
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/1130/steps/64-bit%20check-asan-dynamic/logs/stdio
llvm-svn: 298382
Simon Pilgrim [Tue, 21 Mar 2017 15:12:53 +0000 (15:12 +0000)]
Fix shufpd test name.
llvm-svn: 298381
Sanne Wouda [Tue, 21 Mar 2017 14:59:17 +0000 (14:59 +0000)]
[ARM] [Assembler] Support negative immediates for A32, T32 and T16
Summary:
To support negative immediates for certain arithmetic instructions, the
instruction is converted to the inverse instruction with a negated (or inverted)
immediate. For example, "ADD r0, r1, #
FFFFFFFF" cannot be encoded as an ADD
instruction. However, "SUB r0, r1, #1" is equivalent.
These conversions are different from instruction aliases. An alias maps
several assembler instructions onto one encoding. A conversion, however, maps
an *invalid* instruction--e.g. with an immediate that cannot be represented in
the encoding--to a different (but equivalent) instruction.
Several instructions with negative immediates were being converted already, but
this was not systematically tested, nor did it cover all instructions.
This patch implements all possible substitutions for ARM, Thumb1 and
Thumb2 assembler and adds tests. It also adds a feature flag
(-mattr=+no-neg-immediates) to turn these substitutions off. This is
helpful for users who want their code to assemble to exactly what they
wrote.
Reviewers: t.p.northover, rovka, samparker, javed.absar, peter.smith, rengolin
Reviewed By: javed.absar
Subscribers: aadg, aemerson, llvm-commits
Differential Revision: https://reviews.llvm.org/D30571
llvm-svn: 298380
Yi Kong [Tue, 21 Mar 2017 14:49:19 +0000 (14:49 +0000)]
Test commit access
Remove some trailing whitespaces.
llvm-svn: 298379
Dmitry Vyukov [Tue, 21 Mar 2017 14:28:55 +0000 (14:28 +0000)]
tsan: support __ATOMIC_HLE_ACQUIRE/RELEASE flags
HLE flags can be combined with memory order in atomic operations.
Currently tsan runtime crashes on e.g. IsStoreOrder(mo) in atomic store
if any of these additional flags are specified.
Filter these flags out.
See the comment as to why it is safe.
llvm-svn: 298378
Sanjay Patel [Tue, 21 Mar 2017 14:04:44 +0000 (14:04 +0000)]
[InstCombine] auto-generate better checks; NFC
llvm-svn: 298377
Sanjay Patel [Tue, 21 Mar 2017 13:50:33 +0000 (13:50 +0000)]
[x86] use PMOVMSK for vector-sized equality comparisons
We could do better by splitting any oversized type into whatever vector size the target supports,
but I left that for future work if it ever comes up. The motivating case is memcmp() calls on 16-byte
structs, so I think we can wire that up with a TLI hook that feeds into this.
Differential Revision: https://reviews.llvm.org/D31156
llvm-svn: 298376
Pavel Labath [Tue, 21 Mar 2017 13:49:50 +0000 (13:49 +0000)]
Replace std::ofstream with llvm::raw_fd_ostream
Summary:
ofstream does not handle paths with non-ascii characters correctly on
windows, so I am switching these to llvm streams to fix that.
Reviewers: zturner, eugene
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D31079
llvm-svn: 298375
Pavel Labath [Tue, 21 Mar 2017 13:49:45 +0000 (13:49 +0000)]
Remove ProcFileReader
This removes the last usage of ProcFileReader from NativeProcessLinux
and then deletes the class itself.
llvm-svn: 298374
Andrey Churbanov [Tue, 21 Mar 2017 13:48:52 +0000 (13:48 +0000)]
Fixed intermittent hang on tests with "target teams if(0)" construct with no parallel inside.
Differential Revision: https://reviews.llvm.org/D29597
llvm-svn: 298373
Dmitry Vyukov [Tue, 21 Mar 2017 13:44:01 +0000 (13:44 +0000)]
tsan: add test for pie/no aslr
Just ensure that such combination works.
llvm-svn: 298372
Ekaterina Romanova [Tue, 21 Mar 2017 13:34:06 +0000 (13:34 +0000)]
[DOXYGEN] Improvements to smmintrin.h and emmintrin.h intrinsics.
I made some small changes in smmintrin.h and emmintrin.h intrinsics.
- changed some regular comments '//' into doxygen-style comments '///' where necessary
- removed some trailing spaces in doxygen comments.
I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.
llvm-svn: 298371
Simon Pilgrim [Tue, 21 Mar 2017 13:30:40 +0000 (13:30 +0000)]
[X86][AVX] Tests showing missing SHUFPD + ZERO lowering
This lowers to SHUFPD if the input is zeroinitializer but not with a demanded elts optimized build vector.
llvm-svn: 298370
Egor Churaev [Tue, 21 Mar 2017 13:20:57 +0000 (13:20 +0000)]
[OpenCL] Added diagnostic for checking length of vector
Reviewers: Anastasia, cfe-commits
Reviewed By: Anastasia
Subscribers: bader, yaxunl
Differential Revision: https://reviews.llvm.org/D30937
llvm-svn: 298369
Valery Pykhtin [Tue, 21 Mar 2017 13:15:46 +0000 (13:15 +0000)]
[AMDGPU] Iterative scheduling infrastructure + minimal registry scheduler
Differential revision: https://reviews.llvm.org/D31046
llvm-svn: 298368
Volkan Keles [Tue, 21 Mar 2017 13:12:59 +0000 (13:12 +0000)]
[GlobalISel] Fix shufflevector tests
clang-lld-x86_64-2stage fails because of the order
of the instructions. `CHECK-DAG` directives should
fix the problem.
llvm-svn: 298367
Egor Churaev [Tue, 21 Mar 2017 12:55:55 +0000 (12:55 +0000)]
[OpenCL] Added implicit conversion rank for overloading functions with vector data type in OpenCL
Summary: I added a new rank to ImplicitConversionRank enum to resolve the function overload ambiguity with vector types. Rank of scalar types conversion is lower than vector splat. So, we can choose which function should we call. See test for more details.
Reviewers: Anastasia, cfe-commits
Reviewed By: Anastasia
Subscribers: bader, yaxunl
Differential Revision: https://reviews.llvm.org/D30816
llvm-svn: 298366
Sam Kolton [Tue, 21 Mar 2017 12:51:34 +0000 (12:51 +0000)]
[ADMGPU] SDWA peephole optimization pass.
Summary:
First iteration of SDWA peephole.
This pass tries to combine several instruction into one SDWA instruction. E.g. it converts:
'''
V_LSHRREV_B32_e32 %vreg0, 16, %vreg1
V_ADD_I32_e32 %vreg2, %vreg0, %vreg3
V_LSHLREV_B32_e32 %vreg4, 16, %vreg2
'''
Into:
'''
V_ADD_I32_sdwa %vreg4, %vreg1, %vreg3 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
'''
Pass structure:
1. Iterate over machine instruction in basic block and try to apply "SDWA patterns" to each of them. SDWA patterns match machine instruction into either source or destination SDWA operand. E.g. ''' V_LSHRREV_B32_e32 %vreg0, 16, %vreg1''' is matched to source SDWA operand '''%vreg1 src_sel:WORD_1'''.
2. Iterate over found SDWA operands and find instruction that could be potentially coverted into SDWA. E.g. for source SDWA operand potential instruction are all instruction in this basic block that uses '''%vreg0'''
3. Iterate over all potential instructions and check if they can be converted into SDWA.
4. Convert instructions to SDWA.
This review contains basic implementation of SDWA peephole pass. This pass requires additional testing fot both correctness and performance (no performance testing done).
There are several ways this pass can be improved:
1. Make this pass work on whole function not only basic block. As I can see this can be done right now without changes to pass.
2. Introduce more SDWA patterns
3. Introduce mnemonics to limit when SDWA patterns should apply
Reviewers: vpykhtin, alex-t, arsenm, rampitec
Subscribers: wdng, nhaehnle, mgorny
Differential Revision: https://reviews.llvm.org/D30038
llvm-svn: 298365
Simon Pilgrim [Tue, 21 Mar 2017 12:46:13 +0000 (12:46 +0000)]
[X86][AVX512] Add _mm512_cvtsd_f64 and _mm512_cvtss_f32 intrinsics (PR32305)
Differential Revision: https://reviews.llvm.org/D31155
llvm-svn: 298364
Eric Liu [Tue, 21 Mar 2017 12:41:59 +0000 (12:41 +0000)]
[change-namespace] avoid adding leading '::' when possible.
Summary:
When changing namespaces, the tool adds leading "::" to references that need to
be fully-qualified, which would affect readability.
We avoid adding "::" when the symbol name does not conflict with the new
namespace name. For example, a symbol name "na::nb::X" conflicts with "ns::na"
since it would be resolved to "ns::na::nb::X" in the new namespace.
Reviewers: hokein
Reviewed By: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D30493
llvm-svn: 298363
Andrey Churbanov [Tue, 21 Mar 2017 12:17:22 +0000 (12:17 +0000)]
Stride in distribute parallel for loops with no chunk size.
Patch by George Rokos.
Differential Revision: https://reviews.llvm.org/D24486
llvm-svn: 298362
Siddharth Bhat [Tue, 21 Mar 2017 11:54:08 +0000 (11:54 +0000)]
[DependenceInfo] change name Write to MustWrite to remove ambiguity [NFC]
"Write" is an overloaded term. In collectInfo() till buildFlow(), it is
used to mean "must writes". However, within the memory based analysis,
it is used to mean "both may and must writes". Renaming the Write
variable helps clarify this difference.
Reviewers: grosser
Tags: #polly
Differential Revision: https://reviews.llvm.org/D31181
llvm-svn: 298361
Andrea Di Biagio [Tue, 21 Mar 2017 11:36:21 +0000 (11:36 +0000)]
[DebugInfo][X86] Teach Optimize LEAs pass to handle debug values
This patch fixes an issue in the Optimize LEAs pass where redundant LEAs were
not removed because they were being used by debug values. The debug values are
now ignored when determining whether LEAs are redundant.
For now the debug values for the redundant LEAs are marked as undefined,
effectively lost. The intention is for a follow up patch which will attempt to
preserve the debug values where possible.
Patch by Andrew Ng.
Differential Revision: https://reviews.llvm.org/D30835
llvm-svn: 298360
Artur Pilipenko [Tue, 21 Mar 2017 11:32:15 +0000 (11:32 +0000)]
NFC. InstCombiner::visitFAdd extract LHSIntVal/RHSIntVal local variables
llvm-svn: 298359
Volkan Keles [Tue, 21 Mar 2017 10:47:35 +0000 (10:47 +0000)]
[GlobalISel] Move isTriviallyDead to Utils. NFC.
Make it accessible by the targets to avoid code duplication.
llvm-svn: 298358
Jonas Paulsson [Tue, 21 Mar 2017 10:24:14 +0000 (10:24 +0000)]
[DAGTypeLegalizer] Handle widening truncate to vector of i1.
Previously, PromoteIntRes_TRUNCATE() did not handle the case where
the operand needs widening, which resulted in llvm_unreachable().
This patch adds the needed handling, along with a test case.
Review: Eli Friedman, Simon Pilgrim.
https://reviews.llvm.org/D31077
llvm-svn: 298357
David Green [Tue, 21 Mar 2017 10:17:39 +0000 (10:17 +0000)]
[ConstantFolding] Fix to prevent constant folding having to repeatedly scan operands. NFCI
After the loop unroll threshold was increased in r295538, very
large constant expressions can be created. This prevents them
from having to be recursively scanned, leading to a compile
time blow-up.
Differential Revision: https://reviews.llvm.org/D30689
llvm-svn: 298356
Laszlo Nagy [Tue, 21 Mar 2017 10:15:18 +0000 (10:15 +0000)]
[scan-build-py] reuse command line output parameter for report directory
Differential Revision: https://reviews.llvm.org/D30861
llvm-svn: 298355
George Rimar [Tue, 21 Mar 2017 09:13:27 +0000 (09:13 +0000)]
[ELF] - Detemplate InputSection::getRelocatedSection(). NFC.
llvm-svn: 298353
Tobias Grosser [Tue, 21 Mar 2017 09:12:11 +0000 (09:12 +0000)]
Update isl to isl-0.18-395-g77701b3
This is a normal maintenance update.
llvm-svn: 298352
George Rimar [Tue, 21 Mar 2017 09:08:58 +0000 (09:08 +0000)]
[ELF] - Detemplate InputSectionBase::uncompress(). NFC
llvm-svn: 298351
George Rimar [Tue, 21 Mar 2017 09:01:39 +0000 (09:01 +0000)]
[ELF] - Detemplate ARMExidxSentinelSection. NFC.
llvm-svn: 298350
George Rimar [Tue, 21 Mar 2017 08:57:13 +0000 (08:57 +0000)]
[ELF] - Fix one more access to Sections member.
That finally should linux BB after r298345.
llvm-svn: 298349
George Rimar [Tue, 21 Mar 2017 08:44:25 +0000 (08:44 +0000)]
[ELF] Follow-up to r298345 "[ELF] - Detemplate GdbIndexSection."
Fix for linux build bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/8144/steps/build/logs/stdio
llvm-svn: 298348
Volkan Keles [Tue, 21 Mar 2017 08:44:13 +0000 (08:44 +0000)]
[GlobalISel] Translate shufflevector
Reviewers: qcolombet, aditya_nandakumar, t.p.northover, javed.absar, ab, dsanders
Reviewed By: javed.absar
Subscribers: dberris, rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D30962
llvm-svn: 298347
George Rimar [Tue, 21 Mar 2017 08:29:48 +0000 (08:29 +0000)]
[ELF] - Detemplate InputSectionBase::getLinkOrderDep(). NFC.
llvm-svn: 298346
George Rimar [Tue, 21 Mar 2017 08:19:34 +0000 (08:19 +0000)]
[ELF] - Detemplate GdbIndexSection.
Patch moves Sections array to
InputFile (root class for input files).
That allows to detemplate GdbIndexSection.
Differential revision: https://reviews.llvm.org/D30976
llvm-svn: 298345
Craig Topper [Tue, 21 Mar 2017 07:18:00 +0000 (07:18 +0000)]
[APFloat] Tag the fltSemantic getter functions with LLVM_READNONE.
This gives about an 8k reduction in the size of the opt binary on my local x86-64 build.
llvm-svn: 298344
Vitaly Buka [Tue, 21 Mar 2017 06:55:32 +0000 (06:55 +0000)]
Revert "Bypass potential libc's sysconf wrappers for sysconf(_SC_PAGESIZE) call"
Bot can't find <sys/auxv.h>
This reverts commit r298305.
llvm-svn: 298343
Craig Topper [Tue, 21 Mar 2017 06:19:46 +0000 (06:19 +0000)]
[APInt] Add LLVM_READONLY to some methods.
llvm-svn: 298342
Jonas Paulsson [Tue, 21 Mar 2017 05:49:40 +0000 (05:49 +0000)]
[SystemZ] Don't drop MO flags in foldMemoryOperandImpl()
The def operand of the new LG/LD should have the old def operands
flags and subreg index.
New test: test/CodeGen/SystemZ/fold-memory-op-impl.ll
Review: Ulrich Weigand
llvm-svn: 298341
Zachary Turner [Tue, 21 Mar 2017 05:47:57 +0000 (05:47 +0000)]
Resubmit r298334 after fixing OSX build errors.
Hopefully this works, I can't test since I don't have Mac
hardware, however.
llvm-svn: 298340
Weiming Zhao [Tue, 21 Mar 2017 05:32:51 +0000 (05:32 +0000)]
[Builtin] Implement lit-test support (part 1 of 2: test cases update)
Original r297566 is splitted into two parts.
This is part one, which adds "RUN" command for test cases.
Unit/arm/call_apsr.S is updated to support thumb1.
It also fixes a bug in arm/aeabi_uldivmod_test.c
gcc_personality_test is XFAILED as the framework cannot handle it so far.
cpu_model_test is also XFAILED for now as it is expected to return non-zero.
TODO: A few tests are XFAILed for armhf and aarch64.
We need further investigating. [1,2] Tracks the issue.
[1] https://bugs.llvm.org//show_bug.cgi?id=32260
[2] https://bugs.llvm.org//show_bug.cgi?id=32261
Reviewers: rengolin, compnerd, jroelofs, erik.pilkington, arphaman
Reviewed By: jroelofs
Subscribers: jroelofs, aemerson, srhines, nemanjai, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D30802
llvm-svn: 298339
Jason Molenda [Tue, 21 Mar 2017 04:45:10 +0000 (04:45 +0000)]
Revert r298334 until Zachary has a chance to fix the buildbot failure
on macosx.
llvm-svn: 298338
Jason Molenda [Tue, 21 Mar 2017 04:34:17 +0000 (04:34 +0000)]
Fix two places where an arm instruction emulation method
can dereference misaligned memory.
<rdar://problem/
31106315>, <rdar://problem/
31106337>
llvm-svn: 298337
Serge Pavlov [Tue, 21 Mar 2017 04:03:24 +0000 (04:03 +0000)]
Fix evaluation of LLVM_DEFINITIONS
CMake variable LLVM_DEFINITIONS collects preprocessor definitions provided
for host compiler that builds llvm components. A function
add_llvm_definitions was introduced in AddLLVMDefinitions.cmake to keep
track of these definitions and was intended to be a replacement for CMake
command add_definitions. Actually in many cases add_definitions is still
used and the content of LLVM_DEFINITIONS is not actual now. On the other
hand the current version of CMake allows getting set of definitions in a
more convenient way. This fix implements evaluation of the variable by
reading corresponding cmake property.
Differential Revision: https://reviews.llvm.org/D31125
llvm-svn: 298336
Zachary Turner [Tue, 21 Mar 2017 04:01:59 +0000 (04:01 +0000)]
Delete some dead code in HostInfo.
llvm-svn: 298335
Zachary Turner [Tue, 21 Mar 2017 04:01:04 +0000 (04:01 +0000)]
Delete various lldb FileSystem functions.
Use LLVM's equivalent versions instead.
Differential Revision: https://reviews.llvm.org/D31111
llvm-svn: 298334
Jason Molenda [Tue, 21 Mar 2017 02:59:15 +0000 (02:59 +0000)]
Initialize m_allow_cxx, m_allow_objc. These ivars in the base class are not
initialized in the ctor and they're only initialized to 'true' in ClangUserExpression.cpp
when specific languages are detected so we can use uninitialized values. This
bug has been present since the ivars were added in r144042.
<rdar://problem/
31105864>
llvm-svn: 298333
Akira Hatanaka [Tue, 21 Mar 2017 02:23:00 +0000 (02:23 +0000)]
Add support for attribute enum_extensibility.
This commit adds support for a new attribute that will be used to
distinguish between extensible and inextensible enums. There are three
main purposes of this attribute:
1. Give better control over when enum-related warnings are issued.
For example, in the code below, clang will not issue a -Wassign-enum
warning if the enum is marked "open":
enum __attribute__((enum_extensibility(closed))) EnumClosed {
B0 = 1, B1 = 10
};
enum __attribute__((enum_extensibility(open))) EnumOpen {
C0 = 1, C1 = 10
};
enum EnumClosed ec = 100; // warning issued
enum EnumOpen eo = 100; // no warning
2. Enable code-completion and debugging tools to offer better
suggestions.
3. Make it easier for swift's clang importer to determine which swift
type an enum should be mapped to.
For more details, see the discussion I started on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2017-February/052748.html
rdar://problem/
12764379
rdar://problem/
23145650
Differential Revision: https://reviews.llvm.org/D30766
llvm-svn: 298332
Jim Ingham [Tue, 21 Mar 2017 02:13:50 +0000 (02:13 +0000)]
FindTypes should find "struct TypeName" as well as "TypeName".
This fixes a bug introduced by r291559. The Module's FindType was
passing the original name not the basename in the case where it didn't
find any separators. I also added a testcase for this.
<rdar://problem/
31159173>
llvm-svn: 298331
Peter Collingbourne [Tue, 21 Mar 2017 02:02:41 +0000 (02:02 +0000)]
IRGen: Do not set dllexport on declarations.
Setting dllexport on a declaration has no effect, as we do not emit export
directives for declarations.
Part of the fix for PR32334.
Differential Revision: https://reviews.llvm.org/D31162
llvm-svn: 298330
Vitaly Buka [Tue, 21 Mar 2017 00:59:51 +0000 (00:59 +0000)]
Revert "[Hexagon] Recognize polynomial-modulo loop idiom again"
Fix memory leaks on check-llvm tests detected by Asan.
This reverts commit r298282.
llvm-svn: 298329
Eli Friedman [Tue, 21 Mar 2017 00:26:39 +0000 (00:26 +0000)]
[ARM] Revert r297443 and r297820.
The glueless lowering of addc/adde in Thumb1 has known serious
miscompiles (see https://reviews.llvm.org/D31081), and r297820
causes an infinite loop for certain constructs. It's not
clear when they will be fixed, so let's just take them out
of the tree for now.
(I resolved a small conflict with r297453.)
llvm-svn: 298328