Teresa Johnson [Mon, 13 Nov 2017 15:38:33 +0000 (15:38 +0000)]
[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang
Recommit of r317951 and r317951 along with what I believe should fix
the remaining buildbot failures - the target triple should be specified
for both the ThinLTO pre-thinlink compile and backend (post-thinlink)
compile to ensure it is consistent.
Original description:
The LTO Config field wasn't being set when invoking a ThinLTO backend
via clang (i.e. for distributed builds).
llvm-svn: 318042
Omer Paparo Bivas [Mon, 13 Nov 2017 15:02:39 +0000 (15:02 +0000)]
Inserting a base test for X86 performance nops
Change-Id: I69da08b617d7fae8024c5aee04720eb465f39b81
llvm-svn: 318041
Pavel Labath [Mon, 13 Nov 2017 14:26:21 +0000 (14:26 +0000)]
CompilerType: Add ability to retrieve an integral template argument
Summary:
Despite it's name, GetTemplateArgument was only really working for Type
template arguments. This adds the ability to retrieve integral arguments
as well (which I've needed for the std::bitset data formatter).
I've done this by splitting the function into three pieces. The idea is
that one first calls GetTemplateArgumentKind (first function) to
determine the what kind of a parameter this is. Based on that, one can
then use specialized functions to retrieve the correct value. Currently,
I only implement two of these: GetTypeTemplateArgument and
GetIntegralTemplateArgument.
Reviewers: jingham, clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D39844
llvm-svn: 318040
Pavel Labath [Mon, 13 Nov 2017 14:03:17 +0000 (14:03 +0000)]
Revert "[lldb] Use OrcMCJITReplacement rather than MCJIT as the underlying JIT for LLDB"
This commit really did not introduce any functional changes (for most
people) but it turns out it's not for the reason we thought it was.
The reason wasn't that Orc is a perfect drop-in replacement for MCJIT,
but it was because we were never using Orc in the first place, as it was
not initialized.
Orc's initialization relies on a global constructor in the LLVMOrcJIT.a.
Since this archive does not expose any symbols referenced from other
object files, it does not get linked into liblldb when linking against
llvm components statically. However, in an LLVM_LINK_LLVM_DYLIB=On
build, LLVMOrcJit.a is linked into libLLVM.so using --whole-archive, so
the global constructor does end up firing.
The result of using Orc jit is pr34194, where lldb fails to evaluate
even very simple expressions. This bug can be reproduced in
non-LLVM_LINK_LLVM_DYLIB builds by making sure Orc jit is linked into
liblldb, for example by #including
llvm/ExecutionEngine/OrcMCJITReplacement.h in IRExecutionUnit.cpp (and
adding OrcJIT as a dependency to the relevant CMakeLists.txt file). The
bug reproduces (at least) on linux and osx.
The root cause of the bug seems to be related to relocation processing.
It seems Orc processes relocations earlier than the system it is
replacing. This means the relocation processing happens before we have
had a chance to remap section load addresses to reflect their address in
the target process memory, so they end up pointing to locations in the
lldb's address space instead.
I am not sure whether this is a bug in Orc jit, or in how we are using
it from lldb, but in any case it is preventing us from using Orc right
now. Reverting this fixes LLVM_LINK_LLVM_DYLIB build, and makes it clear
that we are in fact *not* using Orc, and we never really were.
This reverts commit r279327.
llvm-svn: 318039
Walter Lee [Mon, 13 Nov 2017 14:02:27 +0000 (14:02 +0000)]
[asan] Add CMake hook to override shadow scale in compiler_rt
Allow user to override shadow scale in compiler_rt by passing
-DCOMPILER_RT_ASAN_SHADOW_SCALE=n to CMake. Propagate the override
shadow scale value via a compiler define to compiler-rt and asan
tests. Tests will use the define to partially disable unsupported
tests. Set "-mllvm -asan-mapping-scale=<n>" for compiler_rt tests.
Differential Revision: https://reviews.llvm.org/D39469
llvm-svn: 318038
Greg Bedwell [Mon, 13 Nov 2017 12:57:54 +0000 (12:57 +0000)]
Allow compiler-rt test targets to work with multi-config CMake generators
Multi-config CMake generators need lit to be able to resolve paths of
artifacts from previous build steps at lit time, rather than expect them
to be fully resolved at CMake time as they may contain the build mode.
Differential Revision: https://reviews.llvm.org/D38471
llvm-svn: 318037
Uriel Korach [Mon, 13 Nov 2017 12:51:18 +0000 (12:51 +0000)]
[X86] test/testn intrinsics lowering to IR. llvm part.
Remove builtins from llvm and add AutoUpgrade support.
Also add fast-isel tests for the TEST and TESTN instructions.
Differential Revision: https://reviews.llvm.org/D38736
llvm-svn: 318036
Uriel Korach [Mon, 13 Nov 2017 12:50:52 +0000 (12:50 +0000)]
[X86] test/testn intrinsics lowering to IR. clang side
Change Header files of the intrinsics for lowering test and testn intrinsics to IR code.
Removed test and testn builtins from clang
Differential Revision: https://reviews.llvm.org/D38737
llvm-svn: 318035
Greg Bedwell [Mon, 13 Nov 2017 12:40:05 +0000 (12:40 +0000)]
Move the setting of LLVM_BUILD_MODE to a macro so that we can re-use it in compiler-rt
Differential Revision: https://reviews.llvm.org/D38470
llvm-svn: 318034
Momchil Velikov [Mon, 13 Nov 2017 11:56:48 +0000 (11:56 +0000)]
[ARM] Place jump table as the first operand in additions
When generating table jump code for switch statements, place the jump
table label as the first operand in the various addition instructions
in order to enable addressing mode selectors to better match index
computation and possibly fold them into the addressing mode of the
table entry load instruction.
Differential revision: https://reviews.llvm.org/D39752
llvm-svn: 318033
Simon Dardis [Mon, 13 Nov 2017 11:47:21 +0000 (11:47 +0000)]
[CodeGenPrepare] Check that erased sunken address are not reused
CodeGenPrepare sinks address computations from one basic block to another
and attempts to reuse address computations that have already been sunk. If
the same address computation appears twice with the first instance as an
operand of a load whose result is an operand to a simplifable select,
CodeGenPrepare simplifies the select and recursively erases the now dead
instructions. CodeGenPrepare then attempts to use the erased address
computation for the second load.
Fix this by erasing the cached address value if it has zero uses before
looking for the address value in the sunken address map.
This partially resolves PR35209.
Thanks to Alexander Richardson for reporting the issue!
Reviewers: john.brawn
Differential Revision: https://reviews.llvm.org/D39841
llvm-svn: 318032
Jina Nahias [Mon, 13 Nov 2017 11:41:41 +0000 (11:41 +0000)]
Change
// CHECK: shufflevector <8 x double> %0, <8 x double> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 8, i32 9>
To
// CHECK: shufflevector <8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 8, i32 9>
for fixing 318025 commit warning
Change-Id: Id48a1fe1f247fe6a0b84e7189f18d2e637678e79
llvm-svn: 318031
Gabor Horvath [Mon, 13 Nov 2017 11:13:02 +0000 (11:13 +0000)]
[analyzer] Document the issue hash debugging facility
Differential Revision: https://reviews.llvm.org/D39543
llvm-svn: 318030
Florian Hahn [Mon, 13 Nov 2017 11:08:47 +0000 (11:08 +0000)]
[CodeExtractor] Add missing AllowVarArgs initialization.
llvm-svn: 318029
Florian Hahn [Mon, 13 Nov 2017 10:35:52 +0000 (10:35 +0000)]
[PartialInliner] Inline vararg functions that forward varargs.
Summary:
This patch extends the partial inliner to support inlining parts of
vararg functions, if the vararg handling is done in the outlined part.
It adds a `ForwardVarArgsTo` argument to InlineFunction. If it is
non-null, all varargs passed to the inlined function will be added to
all calls to `ForwardVarArgsTo`.
The partial inliner takes care to only pass `ForwardVarArgsTo` if the
varargs handing is done in the outlined function. It checks that vastart
is not part of the function to be inlined.
`test/Transforms/CodeExtractor/PartialInlineNoInline.ll` (already part
of the repo) checks we do not do partial inlining if vastart is used in
a basic block that will be inlined.
Reviewers: davide, davidxl, grosser
Reviewed By: davide, davidxl, grosser
Subscribers: gyiu, grosser, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D39607
llvm-svn: 318028
Sander de Smalen [Mon, 13 Nov 2017 09:57:20 +0000 (09:57 +0000)]
Test commit
llvm-svn: 318027
Jina Nahias [Mon, 13 Nov 2017 09:16:39 +0000 (09:16 +0000)]
[x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IR
This patch, together with a matching clang patch (https://reviews.llvm.org/D38672), implements the lowering of X86 shuffle i/f intrinsics to IR.
Differential Revision: https://reviews.llvm.org/D38671
Change-Id: I1e7d359a74743e995ec356237a85214ce55d3661
llvm-svn: 318026
Jina Nahias [Mon, 13 Nov 2017 09:15:31 +0000 (09:15 +0000)]
[x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IR
This patch, together with a matching llvm patch (https://reviews.llvm.org/D38671), implements the lowering of X86 shuffle i/f intrinsics to IR.
Differential Revision: https://reviews.llvm.org/D38672
Change-Id: I9b3c2f2b34323bd9ccb21d0c1832f848b88ec047
llvm-svn: 318025
Gadi Haber [Mon, 13 Nov 2017 08:42:07 +0000 (08:42 +0000)]
[X86][SKX] Adding scheduling info of non-intrinsic + commutable SKX opcodes.
Updated the scheduling information of the SKX subtarget in the file X86SchedSkylakeServer.td under lib/Target/X86 to:
1. add regular opcodes in addition to the suffixed "_Int" opcodes
2. add the (V)MAXCPD/MAXCPS/MAXCSD/MAXCSS/MINCPD/MINCPS/MINCSD/MINCSS
instructions that are equivalent to their counterparts without the 'C' as they are part of a hack to
make floating point min/max commutable under fast math.
Reviewers: zvi, RKSimon, craig.topper
Differential Revision: https://reviews.llvm.org/D39833
Change-Id: Ie13702a5ce1b1a08af91ca637a52b6962881e7d6
llvm-svn: 318024
Craig Topper [Mon, 13 Nov 2017 08:17:30 +0000 (08:17 +0000)]
[X86] Limit NOPs to 7 bytes when 'slm' is spelled 'silvermont'.
We support 2 spelling for silvermont and we should accept both here.
llvm-svn: 318023
Craig Topper [Mon, 13 Nov 2017 08:07:33 +0000 (08:07 +0000)]
[X86] Use sse_load_f32/f64 to improve load folding of scalar vfscalefss/sd, vrcp14ss/sd, rsqrt14ss/sd instructions.
llvm-svn: 318022
Craig Topper [Mon, 13 Nov 2017 08:07:31 +0000 (08:07 +0000)]
[X86] Regenerate test. NFC
llvm-svn: 318021
Matt Arsenault [Mon, 13 Nov 2017 07:09:20 +0000 (07:09 +0000)]
MI: Print ranges on MMO
llvm-svn: 318020
Craig Topper [Mon, 13 Nov 2017 06:46:48 +0000 (06:46 +0000)]
[X86] Use sse_load_f32/f64 to improve load folding for scalar VFPCLASS intrinsics.
llvm-svn: 318019
Craig Topper [Mon, 13 Nov 2017 06:46:46 +0000 (06:46 +0000)]
[X86] Add tests for missed opportunities to fold a 128-bit vector load into vfpclassss and vpfpclasssd.
llvm-svn: 318018
Matt Arsenault [Mon, 13 Nov 2017 05:33:35 +0000 (05:33 +0000)]
AMDGPU: Preserve nuw in shl add ptr combine
llvm-svn: 318017
Craig Topper [Mon, 13 Nov 2017 05:25:24 +0000 (05:25 +0000)]
[X86] Fix SQRTSS/SQRTSD/RCPSS/RCPSD intrinsics to use sse_load_f32/sse_load_f64 to increase load folding opportunities.
llvm-svn: 318016
Craig Topper [Mon, 13 Nov 2017 05:25:23 +0000 (05:25 +0000)]
[X86] Add tests for full vector loads to fold-load-unops.ll.
We should be able to fold a full vector load into a scalar intrinsic. Since it's legal to narrow a load.
llvm-svn: 318015
Craig Topper [Mon, 13 Nov 2017 05:25:21 +0000 (05:25 +0000)]
[X86] Regenerate fold-load-unops.ll and add and avx512f command line.
llvm-svn: 318014
Matt Arsenault [Mon, 13 Nov 2017 05:11:54 +0000 (05:11 +0000)]
AMDGPU: Fix multi-use shl/add combine
This was using a custom function that didn't handle the
addressing modes properly for private. Use
isLegalAddressingMode to avoid duplicating this.
Additionally, skip the combine if there is only one use
since the standard combine will handle it.
llvm-svn: 318013
Marshall Clow [Mon, 13 Nov 2017 04:15:39 +0000 (04:15 +0000)]
Put the status in the wrong column
llvm-svn: 318012
Marshall Clow [Mon, 13 Nov 2017 03:59:22 +0000 (03:59 +0000)]
Implement P0550R2: Transformation Trait remove_cvref
llvm-svn: 318011
Craig Topper [Mon, 13 Nov 2017 02:19:13 +0000 (02:19 +0000)]
[X86] Attempt to fix signed and unsigned comparison warning.
llvm-svn: 318010
Craig Topper [Mon, 13 Nov 2017 02:03:01 +0000 (02:03 +0000)]
[X86] Use sse_load_f32/f64 in patterns for the memory forms of VRNDSCALESS/SD.
llvm-svn: 318009
Craig Topper [Mon, 13 Nov 2017 02:03:00 +0000 (02:03 +0000)]
[X86] Use EVEX encoded VRNDSCALE instructions to implement the legacy round intrinsics.
The VRNDSCALE instructions implement a superset of the (V)ROUND instructions. They are equivalent if the upper 4-bits of the immediate are 0.
This patch lowers the legacy intrinsics to the VRNDSCALE ISD node and masks the upper bits of the immediate to 0. This allows us to take advantage of the larger register encoding space.
We should maybe consider converting VRNDSCALE back to VROUND in the EVEX to VEX pass if the extended registers are not being used.
I notice some load folding opportunities being missed for the VRNDSCALESS/SD instructions that I'll try to fix in future patches.
llvm-svn: 318008
Craig Topper [Mon, 13 Nov 2017 02:02:58 +0000 (02:02 +0000)]
[X86] Split VRNDSCALE/VREDUCE/VGETMANT/VRANGE ISD nodes into versions with and without the rounding operand. NFCI
I want to reuse the VRNDSCALE node for the legacy SSE rounding intrinsics so that those intrinsics can use EVEX instructions. All of these nodes share tablegen multiclasses so I split them all so that they all remain similar in their implementations.
llvm-svn: 318007
Matt Arsenault [Mon, 13 Nov 2017 01:47:52 +0000 (01:47 +0000)]
Fix some misc. -enable-var-scope violations
llvm-svn: 318006
Matt Arsenault [Mon, 13 Nov 2017 00:22:09 +0000 (00:22 +0000)]
AMDGPU: Select d16 loads into low component of register
llvm-svn: 318005
Matt Arsenault [Sun, 12 Nov 2017 23:53:44 +0000 (23:53 +0000)]
AMDGPU: Fix -enable-var-scope violations
llvm-svn: 318004
Matt Arsenault [Sun, 12 Nov 2017 23:40:12 +0000 (23:40 +0000)]
AMDGPU: Fix missing gfx9 atomic inc/dec tests
The global instructions weren't tested. Plus there
were also some -enable-var-scope violations and
broken check prefixes.
llvm-svn: 318003
Vitaly Buka [Sun, 12 Nov 2017 21:15:19 +0000 (21:15 +0000)]
[sanitizer] Simplify stack check in accert.cc
Somehow on arm bots stack does not include main.
llvm-svn: 318002
Vitaly Buka [Sun, 12 Nov 2017 20:25:14 +0000 (20:25 +0000)]
[sanitizer] Try to see test output on armv7
llvm-svn: 318001
Marshall Clow [Sun, 12 Nov 2017 18:52:16 +0000 (18:52 +0000)]
Two more papers from Albuquerque
llvm-svn: 318000
Craig Topper [Sun, 12 Nov 2017 18:51:09 +0000 (18:51 +0000)]
[X86] Add an X86ISD::RANGES opcode to use for the scalar intrinsics.
This fixes a bug where we selected packed instructions for scalar intrinsics.
llvm-svn: 317999
Craig Topper [Sun, 12 Nov 2017 18:51:08 +0000 (18:51 +0000)]
[X86] Add test cases and command lines demonstrating how we accidentally select vrangeps/vrangepd from vrangess/vrangesd instrinsics when the rounding mode is CUR_DIRECTION
llvm-svn: 317998
Craig Topper [Sun, 12 Nov 2017 18:51:06 +0000 (18:51 +0000)]
[X86] Remove some no longer needed intrinsic lowering code.
llvm-svn: 317997
Marshall Clow [Sun, 12 Nov 2017 18:48:42 +0000 (18:48 +0000)]
Updated C++2a status page with new features/defects approved in Albuquerque.
llvm-svn: 317996
Mandeep Singh Grang [Sun, 12 Nov 2017 03:47:50 +0000 (03:47 +0000)]
[llvm] Remove redundant return [NFC]
Reviewers: davidxl, olista01, Eugene.Zelenko
Reviewed By: Eugene.Zelenko
Subscribers: sdardis, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D39917
llvm-svn: 317995
Craig Topper [Sun, 12 Nov 2017 02:28:21 +0000 (02:28 +0000)]
[InstCombine] Teach visitICmpInst to not break integer absolute value idioms
Summary:
This patch adds an early out to visitICmpInst if we are looking at a compare as part of an integer absolute value idiom. Similar is already done for min/max.
In the particular case I observed in a benchmark we had an absolute value of a load from an indexed global. We simplified the compare using foldCmpLoadFromIndexedGlobal into a magic bit vector, a shift, and an and. But the load result was still used for the select and the negate part of the absolute valute idiom. So we overcomplicated the code and lost the ability to recognize it as an absolute value.
I've chosen a simpler case for the test here.
Reviewers: spatel, davide, majnemer
Reviewed By: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39766
llvm-svn: 317994
Dave Lee [Sat, 11 Nov 2017 23:53:27 +0000 (23:53 +0000)]
Fix AST matcher documentation typo
llvm-svn: 317993
Dave Lee [Sat, 11 Nov 2017 22:46:15 +0000 (22:46 +0000)]
Add ObjC exception statement AST matchers
Summary: Add AST matchers for Objective-C @throw, @try, @catch and @finally.
Reviewers: aaron.ballman, malcolm.parsons, alexshap, compnerd
Reviewed By: aaron.ballman
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D39940
llvm-svn: 317992
Craig Topper [Sat, 11 Nov 2017 21:44:51 +0000 (21:44 +0000)]
[X86] Use vrndscaleps/pd for 128/256 ffloor/ftrunc/fceil/fnearbyint/frint when avx512vl is enabled.
This matches what we do for scalar and 512-bit types.
llvm-svn: 317991
Craig Topper [Sat, 11 Nov 2017 21:44:50 +0000 (21:44 +0000)]
[X86] Remove avx512-round.ll. The 512-bit rounding tests are now in vec_floor.ll with 128/256 sizes.
llvm-svn: 317990
Craig Topper [Sat, 11 Nov 2017 21:44:49 +0000 (21:44 +0000)]
[X86] Add avx512vl command line to vec_floor.ll. Add 512-bit test cases.
llvm-svn: 317989
Craig Topper [Sat, 11 Nov 2017 21:44:48 +0000 (21:44 +0000)]
[X86] Add avx512f command line to rounding-ops.ll
llvm-svn: 317988
Craig Topper [Sat, 11 Nov 2017 21:44:47 +0000 (21:44 +0000)]
[X86] Regenerate rounding-ops.ll with update_llc_test_checks.py
llvm-svn: 317987
Michal Gorny [Sat, 11 Nov 2017 20:01:41 +0000 (20:01 +0000)]
[python] [tests] Fix test_linkage for unique external linkage
Starting with r314037, anonymous namespaces no longer give
unique-external linkage to variables. However, this linkage can still be
achieved by using a type which is not exterally visible,
e.g. through being declared in an anonymous namespace but used outside
it. Fix the test to take advantage of that.
Differential Revision: https://reviews.llvm.org/D39810
llvm-svn: 317986
Simon Pilgrim [Sat, 11 Nov 2017 18:16:55 +0000 (18:16 +0000)]
[X86] Attempt to match multiple binary reduction ops at once. NFCI
matchBinOpReduction currently matches against a single opcode, but we already have a case where we repeat calls to try to match against AND/OR and I'll be shortly adding another case for SMAX/SMIN/UMAX/UMIN (D39729).
This NFCI patch alters matchBinOpReduction to try and pattern match against any of the provided list of candidate bin ops at once to save time.
Differential Revision: https://reviews.llvm.org/D39726
llvm-svn: 317985
Faisal Vali [Sat, 11 Nov 2017 18:02:29 +0000 (18:02 +0000)]
Adjust r316292 - remove the anonymous union for sharing a bitfield in FunctionDecl.
The anonymous union did NOT save us storage, but instead behaved as if we added an additional integer data member to FunctionDecl.
For additional context, the anonymous union renders the bit fields as non-adjacent and prevents them from sharing the same 'memory location' (i.e. bit-storage) by requiring the anonymous union object to be appropriately aligned.
This was confirmed through discussion with Richard Smith in Albuquerque (ISO C++ Meeting)
https://reviews.llvm.org/rL316292
llvm-svn: 317984
Richard Smith [Sat, 11 Nov 2017 18:00:16 +0000 (18:00 +0000)]
[cxx_status] Add resolution of CWG issue 1581, since it's an important, visible change.
llvm-svn: 317983
Richard Smith [Sat, 11 Nov 2017 17:54:46 +0000 (17:54 +0000)]
[cxx_status] Update for moved Albuquerque papers.
llvm-svn: 317982
Gor Nishanov [Sat, 11 Nov 2017 17:00:43 +0000 (17:00 +0000)]
[coroutines] Promote cleanup.dest.slot allocas to registers to avoid storing it in the coroutine frame
Summary:
We don't want to store cleanup dest slot saved into the coroutine frame (as some of the cleanup code may
access them after coroutine frame destroyed).
This is an alternative to https://reviews.llvm.org/D37093
It is possible to do this for all functions, but, cursory check showed that in -O0, we get slightly longer function (by 1-3 instructions), thus, we are only limiting cleanup.dest.slot elimination to coroutines.
Reviewers: rjmccall, hfinkel, eric_niebler
Reviewed By: eric_niebler
Subscribers: EricWF, cfe-commits
Differential Revision: https://reviews.llvm.org/D39768
llvm-svn: 317981
Jonas Hahnfeld [Sat, 11 Nov 2017 13:59:48 +0000 (13:59 +0000)]
[OMPT] Provide initialization for Mac OS X
Traditionally, the library had a weak symbol for ompt_start_tool()
that served as fallback and disabled OMPT if called. Tools could
provide their own version and replace the default implementation
to register callbacks and lookup functions. This mechanism has
worked reasonably well on Linux systems where this interface was
initially developed.
On Darwin / Mac OS X the situation is a bit more complicated and
the weak symbol doesn't work out-of-the-box. In my tests, the
library with the tool needed to link against the OpenMP runtime
to make the process work. This would effectively mean that a tool
needed to choose a runtime library whereas one design goal of the
interface was to allow tools that are agnostic of the runtime.
The solution is to use dlsym() with the argument RTLD_DEFAULT so
that static implementations of ompt_start_tool() are found in the
main executable. This works because the linker on Mac OS X includes
all symbols of an executable in the global symbol table by default.
To use the same code path on Linux, the application would need to
be built with -Wl,--export-dynamic. To avoid this restriction, we
continue to use weak symbols on Linux systems as before.
Finally this patch extends the existing test to cover all possible
ways of initializing the tool as described by the standard. It
also fixes ompt_finalize() to not call omp_get_thread_num() when
the library is shut down which resulted in hangs on Darwin.
The changes have been tested on Linux to make sure that it passes
the current tests as well as the newly extended one.
Differential Revision: https://reviews.llvm.org/D39801
llvm-svn: 317980
Jonas Hahnfeld [Sat, 11 Nov 2017 13:59:45 +0000 (13:59 +0000)]
[libomptarget] Build all libraries in libomptarget/
In standalone build, plugins where previously built in their
subdirectory in plugins/ and tests couldn't find them.
Differential Revision: https://reviews.llvm.org/D39920
llvm-svn: 317979
Kamil Rytarowski [Sat, 11 Nov 2017 09:29:21 +0000 (09:29 +0000)]
Correct NetBSD build issue
Cast SIG_IGN to (uptr).
SIG_IGN is defined on NetBSD as a function pointer and cannot be
assigned to an integer as it is.
sys/signal.h:#define SIG_IGN ((void (*)(int)) 1)
llvm-svn: 317978
Craig Topper [Sat, 11 Nov 2017 08:24:15 +0000 (08:24 +0000)]
[X86] Add scalar register class versions of VRNDSCALE instructions and rename the existing versions to _Int.
This is consistent with out normal implementation of scalar instructions.
While there disable load folding for the patterns with IMPLICIT_DEF unless optimizing for size which is also our standard practice.
llvm-svn: 317977
Craig Topper [Sat, 11 Nov 2017 08:24:13 +0000 (08:24 +0000)]
[X86] Regenerate avx512-round.ll test.
llvm-svn: 317976
Craig Topper [Sat, 11 Nov 2017 08:24:12 +0000 (08:24 +0000)]
[X86] Inline some SDNode operand multiclass operands that don't vary. NFC
llvm-svn: 317975
Craig Topper [Sat, 11 Nov 2017 06:57:44 +0000 (06:57 +0000)]
[X86] Set the execution domain for VFPCLASS to SSEPackedSingle/Double.
llvm-svn: 317974
Craig Topper [Sat, 11 Nov 2017 06:19:12 +0000 (06:19 +0000)]
[X86] Set the execution domain for vptest instruction to the integer domain.
llvm-svn: 317973
Daniel Sanders [Sat, 11 Nov 2017 03:23:44 +0000 (03:23 +0000)]
[globalisel][tablegen] Import signextload and zeroextload.
Allow a pattern rewriter to be installed in CodeGenDAGPatterns and use it to
correct situations where SelectionDAG and GlobalISel disagree on
representation. For example, it would rewrite:
(sextload:i32 $ptr)<<unindexedload>><<sextload>><<sextloadi16>
to:
(sext:i32 (load:i16 $ptr)<<unindexedload>>)
I'd have preferred to replace the fragments and have the expansion happen
naturally as part of PatFrag expansion but the type inferencing system can't
cope with loads of types narrower than those mentioned in register classes.
This is because the SDTCisInt's on the sext constrain both the result and
operand to the 'legal' integer types (where legal is defined as 'a register
class can contain the type') which immediately rules the narrower types out.
Several targets (those with only one legal integer type) would then go on to
crash on the SDTCisOpSmallerThanOp<> when it removes all the possible types
for the result of the extend.
Also, improve isObviouslySafeToFold() slightly to automatically return true for
neighbouring instructions. There can't be any re-ordering problems if
re-ordering isn't happenning. We'll need to improve it further to handle
sign/zero-extending loads when the extend and load aren't immediate neighbours
though.
llvm-svn: 317971
Vitaly Buka [Sat, 11 Nov 2017 03:03:34 +0000 (03:03 +0000)]
[msan] Fix signal chaining
Return internally stored handlers only if handlers is set to wrapper
llvm-svn: 317970
Evgeniy Stepanov [Sat, 11 Nov 2017 02:32:02 +0000 (02:32 +0000)]
[ubsan-minimal] Get rid of the libc++ dependency.
Summary:
Use -nodefaultlibs.
Replace std:atomic with sanitizer atomics.
Reviewers: vitalybuka, kongyi, EricWF
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39934
llvm-svn: 317969
Craig Topper [Sat, 11 Nov 2017 02:26:05 +0000 (02:26 +0000)]
[X86] Correct the execution domain on ROUND/VROUND instructions.
llvm-svn: 317968
Craig Topper [Sat, 11 Nov 2017 02:26:02 +0000 (02:26 +0000)]
[X86] Remove the default for one of the arguments to some tablegen multiclasses. NFC
No one ever uses this default and probably shouldn't since it sets the execution domain to generic.
llvm-svn: 317967
NAKAMURA Takumi [Sat, 11 Nov 2017 02:05:47 +0000 (02:05 +0000)]
llvm/Support/TargetParser.h: Fix -fmodules build in rL317900.
llvm-svn: 317966
Rafael Espindola [Sat, 11 Nov 2017 01:59:47 +0000 (01:59 +0000)]
Simplify. NFC.
copyFrom doesn't copy the Binding, so this was a nop.
llvm-svn: 317965
Rafael Espindola [Sat, 11 Nov 2017 01:56:45 +0000 (01:56 +0000)]
Remove unused argument from RUN line.
llvm-svn: 317964
Vitaly Buka [Sat, 11 Nov 2017 01:30:03 +0000 (01:30 +0000)]
[sanitizer] Include stack trace check into signal tests
llvm-svn: 317963
Justin Lebar [Sat, 11 Nov 2017 01:25:44 +0000 (01:25 +0000)]
[CUDA] Fix std::min on device side to return the min, not the max.
Summary:
How embarrassing.
This is tested in the test-suite -- fix to come there in a separate
patch.
Reviewers: tra
Subscribers: sanjoy, cfe-commits
Differential Revision: https://reviews.llvm.org/D39817
llvm-svn: 317961
Jake Ehrlich [Sat, 11 Nov 2017 01:15:41 +0000 (01:15 +0000)]
Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fission
llvm-objcopy is getting to where it can be used in non-trivial ways
(such as for dwarf fission in clang). It now supports dwarf fission but
this feature hasn't been thoroughly tested yet. This change allows
people to optionally build clang to use llvm-objcopy rather than GNU
objcopy. By default GNU objcopy is still used so nothing should change.
Differential Revision: https://reviews.llvm.org/D39029
llvm-svn: 317960
Teresa Johnson [Sat, 11 Nov 2017 01:06:41 +0000 (01:06 +0000)]
Revert "[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang"
This reverts commit r317951 and r317952. The new test is aborting on
some bots and I'll need to investigate later.
llvm-svn: 317959
Vitaly Buka [Sat, 11 Nov 2017 01:01:09 +0000 (01:01 +0000)]
[ubsan] Fix ubsan tests broken by linking as C instead of C++
llvm-svn: 317958
Richard Trieu [Sat, 11 Nov 2017 00:54:25 +0000 (00:54 +0000)]
Handle lambda captures of variable length arrays in profiling and printing.
From http://reviews.llvm.org/D4368 these cases were thought to not be reachable
and the checks removed before the rest of the code was committed in r216649.
However, these cases are reachable and the checks are added back.
llvm-svn: 317957
Rafael Espindola [Sat, 11 Nov 2017 00:53:52 +0000 (00:53 +0000)]
Don't produce a duplicated __wrap_foo if there is no __real_foo.
This fixes a regression from r317426.
llvm-svn: 317956
Tony Tye [Sat, 11 Nov 2017 00:50:32 +0000 (00:50 +0000)]
[AMDGPU] Correct targets that support XNACK
Differential Revision: https://reviews.llvm.org/D39887
llvm-svn: 317955
Rafael Espindola [Sat, 11 Nov 2017 00:39:32 +0000 (00:39 +0000)]
Remove unused option in test. NFC.
llvm-svn: 317954
Eugene Zelenko [Sat, 11 Nov 2017 00:08:50 +0000 (00:08 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317953
Teresa Johnson [Sat, 11 Nov 2017 00:05:39 +0000 (00:05 +0000)]
Add x86-registered-target to REQUIRES for new test
Should fix test added in r317951.
llvm-svn: 317952
Teresa Johnson [Fri, 10 Nov 2017 23:37:39 +0000 (23:37 +0000)]
[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang
Summary:
The LTO Config field wasn't being set when invoking a ThinLTO backend
via clang (i.e. for distributed builds).
Reviewers: danielcdh
Subscribers: mehdi_amini, inglorion, eraman, cfe-commits
Differential Revision: https://reviews.llvm.org/D39923
llvm-svn: 317951
Craig Topper [Fri, 10 Nov 2017 23:36:56 +0000 (23:36 +0000)]
[SelectionDAG] Make getUniformBase in SelectionDAGBuilder fail if any of the middle GEP indices are non-constant.
This is a fix for a bug in r317947. We were supposed to check that all the indices are are constant 0, but instead we're only make sure that indices that are constant are 0. Non-constant indices are being ignored.
llvm-svn: 317950
Zachary Turner [Fri, 10 Nov 2017 23:13:14 +0000 (23:13 +0000)]
Update test_debuginfo.pl script to point to new tree location.
llvm-svn: 317949
Evgeniy Stepanov [Fri, 10 Nov 2017 22:52:44 +0000 (22:52 +0000)]
[sanitizer] Remove unnecessary attribute hidden.
This should fix windows build of compiler-rt broken in r317943.
The attribute is unnecessary because since GetMaxVirtualAddress was split in two,
we no longer use common_flags() in the ifunc resolver context.
llvm-svn: 317948
Craig Topper [Fri, 10 Nov 2017 22:50:50 +0000 (22:50 +0000)]
[SelectionDAG] Teach SelectionDAGBuilder's getUniformBase for gather/scatter handling to accept GEPs with more than 2 operands if the middle operands are all 0s
Currently we can only get a uniform base from a simple GEP with 2 operands. This causes us to miss address folding opportunities for simple global array accesses as the test case shows.
This patch adds support for larger GEPs if the other indices are 0 since those don't require any additional computations to be inserted.
We may also want to handle constant splats of zero here, but I'm leaving that for future work when I have a real world example.
Differential Revision: https://reviews.llvm.org/D39911
llvm-svn: 317947
Vitaly Buka [Fri, 10 Nov 2017 22:41:52 +0000 (22:41 +0000)]
[tsan] Move out more types to sanitizer_common
https://github.com/google/sanitizers/issues/637
llvm-svn: 317946
Greg Clayton [Fri, 10 Nov 2017 22:39:07 +0000 (22:39 +0000)]
Added a way to dump the full paths to all source files in a module that has debug info.
llvm-svn: 317945
Hans Wennborg [Fri, 10 Nov 2017 22:34:23 +0000 (22:34 +0000)]
Remove declaration of EmitMCountInstrumentation(). NFC
The definition was removed in r280355.
llvm-svn: 317944
Evgeniy Stepanov [Fri, 10 Nov 2017 22:27:48 +0000 (22:27 +0000)]
[asan] Use dynamic shadow on 32-bit Android.
Summary:
The following kernel change has moved ET_DYN base to 0x4000000 on arm32:
https://marc.info/?l=linux-kernel&m=
149825162606848&w=2
Switch to dynamic shadow base to avoid such conflicts in the future.
Reserve shadow memory in an ifunc resolver, but don't use it in the instrumentation
until PR35221 is fixed. This will eventually let use save one load per function.
Reviewers: kcc
Subscribers: aemerson, srhines, kubamracek, kristof.beyls, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D39393
llvm-svn: 317943
Martin Storsjo [Fri, 10 Nov 2017 22:27:41 +0000 (22:27 +0000)]
[llvm-cvtres] Add support for ARM64
Also change some default cases into llvm_unreachable in
WindowsResourceCOFFWriter, to make it easier to find if they
are triggerd from within e.g. lld, which supported ARM64 earlier
than llvm-cvtres did.
Differential Revision: https://reviews.llvm.org/D39892
llvm-svn: 317942
Jan Vesely [Fri, 10 Nov 2017 22:16:41 +0000 (22:16 +0000)]
native_exp10: Switch implementation to llvm intrinsic
v2: Use native_log2 instead of wrong constant
Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 317941