Commit Graph

270982 Commits

Author SHA1 Message Date
Kostya Kortchinsky 6bc7b26d18 [scudo] getauxval alternative for Android
Summary:
`getauxval` was introduced with API level 18. In order to get things to work
at lower API levels (for the toolchain itself which is built at 14 for 32-bit),
we introduce an alternative implementation reading directly from
`/proc/self/auxv`.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: srhines, llvm-commits

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

llvm-svn: 312653
2017-09-06 17:51:32 +00:00
Rui Ueyama a353d9cb18 Remove a trailing empty line that didn't end with '\n'.
llvm-svn: 312652
2017-09-06 17:41:29 +00:00
Jonathan Roelofs b780c8ac75 Fix ARM bare metal driver to support atomics
The new bare metal support only supports the single thread model. This causes
the builtin atomic functions (e.g.: __atomic_fetch_add) to not generate
thread-safe assembly for these operations, which breaks our firmware. We target
bare metal, and need to atomically modify variables in our interrupt routines,
and task threads.

Internally, the -mthread-model flag determines whether to lower or expand
atomic operations (see D4984).

This change removes the overridden thread model methods, and instead relies on
the base ToolChain class to validate the thread model (which already includes
logic to validate single thread model support). If the single thread model is
required, the -mthread-model flag will have to be provided.

As a workaround "-mthread-model posix" could be provided, but it only works due
to a bug in the validation of the -mthread-model flag (separate patch coming to
fix this).

https://reviews.llvm.org/D37493

Patch by: Ian Tessier!

llvm-svn: 312651
2017-09-06 17:09:25 +00:00
Craig Topper d548bb9d37 [X86] Actually add the new file that was supposed to go with r312649.
llvm-svn: 312650
2017-09-06 17:06:40 +00:00
Craig Topper cf1d8a55f2 [X86] Introduce a new td file to hold patterns some of the non instruction patterns from SSE and AVX512
This patch moves some of similar non-instruction patterns from X86InstrSSE.td and X86InstrAVX512.td to a common file.

This is intended as a starting point. There are many other optimization patterns that exist in both files that we could move here.

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

llvm-svn: 312649
2017-09-06 16:56:52 +00:00
Nuno Lopes ba1c9f7aee Fix PR33878: BasicAA incorrectly assumes different address spaces don't alias
Remove code that assumed that a nullptr of address space != 0 couldnt alias with a non-null pointer. This is incorrect, since nothing can be concluded about a null pointer in an address space != 0.
This code was written before address spaces were introduced

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

llvm-svn: 312648
2017-09-06 16:55:31 +00:00
Alexander Kornienko 3ad84ee009 Minor style fixes in lib/Support/**/Program.(inc|cpp).
No functional changes intended.

llvm-svn: 312646
2017-09-06 16:28:33 +00:00
Petr Hosek 7d96d46cb7 Revert "[llvm-objcopy] Add support for relocations"
This reverts r312643 because it's failing on llvm-i686-linux-RA.

llvm-svn: 312645
2017-09-06 16:23:15 +00:00
Krzysztof Parzyszek daf1a5f94e [Hexagon] Add option to generate calls to "abort" for "unreachable"
llvm-svn: 312644
2017-09-06 16:22:55 +00:00
Petr Hosek bdc3e61d21 [llvm-objcopy] Add support for relocations
This change adds support for SHT_REL and SHT_RELA sections in
llvm-objcopy.

Patch by Jake Ehrlich

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

llvm-svn: 312643
2017-09-06 16:19:48 +00:00
Alexey Bataev f43f714213 [OPENMP] Fix for PR33922: New ident_t flags for
__kmpc_for_static_fini().

Added special flags for calls of __kmpc_for_static_fini(), like previous
ly for __kmpc_for_static_init(). Added flag OMP_IDENT_WORK_DISTRIBUTE
for distribute cnstruct, OMP_IDENT_WORK_SECTIONS for sections-based
  constructs and OMP_IDENT_WORK_LOOP for loop-based constructs in
  location flags.

llvm-svn: 312642
2017-09-06 16:17:35 +00:00
Wei Mi 818d50a93d [TailCall] Allow llvm.memcpy/memset/memmove to be tail calls when parent
function return the intrinsics's first argument.

llvm.memcpy/memset/memmove return void but they will return the first
argument after they are expanded as libcalls. Now if the parent function
has any return value, llvm.memcpy cannot be turned into tail call after
expansion.

The patch is to handle that case in SelectionDAGBuilder so when caller
function return the same value as the first argument of llvm.memcpy,
tail call is allowed.

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

llvm-svn: 312641
2017-09-06 16:05:17 +00:00
Stanislav Mekhanoshin 949fac9e40 [AMDGPU] Fix shouldClusterMemOps to process flat loads
Flat loads do not have vdata operand but have vdst instead.

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

llvm-svn: 312640
2017-09-06 15:31:30 +00:00
Aaron Ballman 8816a87064 Replacing "or" with "||" to appease MSVC.
llvm-svn: 312639
2017-09-06 15:12:05 +00:00
Alexey Bataev 070f43aee7 [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime in
move constructor.

Previously user-defined reduction initializer was considered as an
assignment expression, not as initializer. Fixed this by treating the
initializer expression as an initializer.

llvm-svn: 312638
2017-09-06 14:49:58 +00:00
Peter Smith 1d5a070386 [ELF][AArch64] Add alignment checks for the LDST<N>_ABS_LO12_NC relocations
The R_AARCH64_LDST<N>_ABS LO12_NC relocations where N is 8, 16, 32, 64 or
128 have a scaled immediate. For example R_AARCH64_LDST32_ABS_LO12_NC
shifts the calculated value right by 4. If the target symbol + relocation
addend is not aligned properly then bits of the answer will be lost.

This change adds an alignment check to the relocations to make sure the
target of the relocation is aligned properly. This matches the behavior of
GNU ld. The motivation is to catch ODR violations such as a declaration of
extern int foo, but a definition of bool foo as the compiler may use
R_AARCH64_LDST32_ABS_LO12_NC for the former, but not align the destination.

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

llvm-svn: 312637
2017-09-06 14:23:06 +00:00
Peter Smith 3ef89b0fc7 [ELF] Move fixSectionAlignments() before first call to assignAddresses()
The fixSectionAlignments() function may alter the alignment of some
OutputSections, this is likely to alter the addresses calculated earlier
in assignAddresses(). By moving the call to fixSectionAlignments() we
make sure that assignAddresses() is consistent with the early calculation
used for RangeThunks and the final call just before writing the image.

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

llvm-svn: 312636
2017-09-06 14:02:14 +00:00
Nicolai Haehnle 523827145b AMDGPU: Make worst-case assumption about the wait states in inline assembly
Summary:
Mesa still uses a hack where empty inline assembly is used as a kind of
optimization barrier. This exposed a problem where not enough wait states
were inserted, because the hazard recognizer implicitly assumed that each
inline assembly "instruction" has at least one wait state.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

llvm-svn: 312635
2017-09-06 13:50:13 +00:00
Johannes Altmanninger 1509da083a [AST] Add TableGen for StmtDataCollectors
Summary:
This adds an option "-gen-clang-data-collectors" to the Clang TableGen
that is used to generate StmtDataCollectors.inc.

Reviewers: arphaman, teemperor!

Subscribers: mgorny, cfe-commits

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

llvm-svn: 312634
2017-09-06 13:20:51 +00:00
Johannes Altmanninger d614a1c15a [AST] Traverse CXXOperatorCallExpr in LexicallyOrderedRecursiveASTVisitor
Summary:
This affects overloaded operators, which are represented by a
CXXOperatorCallExpr whose first child is always a DeclRefExpr referring to the
operator. For infix, postfix and call operators we want the first argument
to be traversed before the operator.

Reviewers: arphaman

Subscribers: klimek, cfe-commits

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

llvm-svn: 312633
2017-09-06 13:12:11 +00:00
Michael Kruse 48c726f925 [test] Add forgotten REQUIRES: line.
llvm-svn: 312632
2017-09-06 13:11:24 +00:00
Johannes Altmanninger 0a755162be [AST] Traverse templates in LexicallyOrderedRecursiveASTVisitor
Summary:
We need to specialize this because RecursiveASTVisitor visits template
template parameters after the templated declaration, unlike the order in
which they appear in the source code.

Reviewers: arphaman

Reviewed By: arphaman

Subscribers: klimek, cfe-commits

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

llvm-svn: 312631
2017-09-06 13:11:13 +00:00
Michael Kruse bd84ce8931 [ZoneAlgo] Handle non-StoreInst/LoadInst MemoryAccesses including memset.
Up to now ZoneAlgo considered array elements access by something else
than a LoadInst or StoreInst as not analyzable. This patch removes that
restriction by using the unknown ValInst to describe the written
content, repectively the element type's null value in case of memset.

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

llvm-svn: 312630
2017-09-06 12:40:55 +00:00
Simon Pilgrim 05710a8b4f [X86][X87] Ensure x87 instructions are tagged as altering the FPSW reg
As noted in PR34080, a lot of x87 instructions alter the FPSW status register (or leave it in an undefined state) but aren't tagged as such in the tablegen.

This patch tags the control word, stack, wait and math instructions as altering FPSW, which matches what the AMD APMs suggests happens.

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

llvm-svn: 312629
2017-09-06 10:23:12 +00:00
Simon Dardis 10d0ae85dd [compiler-rt][xray][mips] Mark some tests as unsupported.
Thesee tests require the integrated assembler which is still in
development / testing for MIPS64. GAS doesn't understand the
section directives produced by XRay, so marking the relevant
tests as unsupported.

llvm-svn: 312628
2017-09-06 10:17:29 +00:00
Karl-Johan Karlsson 32e5273491 Corrected testcase to work with release build
The fault was introduced in r312623

llvm-svn: 312627
2017-09-06 10:12:32 +00:00
James Henderson 1304e8dd6e [ELF] Rewrite --symbol-ordering-file path in reproducer
The --symbol-ordering-file path was not being rewritten in the response file when
using --reproduce. This patch adds this to the list of switches that are rewritten,
so that the path is somewhere within the reproducer directory tree.

Reviewers: ruiu

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

llvm-svn: 312626
2017-09-06 10:10:49 +00:00
George Rimar c2dffe3aa0 [ELF] - Linkerscript: set load address correctly if MEMORY command used.
Previously LLD did not calculate LMAOffset correctly when
AT and MEMORY were used together.

Patch fixes PR34407.

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

llvm-svn: 312625
2017-09-06 09:35:09 +00:00
Alex Bradbury 4f7f0da574 [RISCV][NFC] Fix sorting of includes in lib/Target/RISCV
llvm-svn: 312624
2017-09-06 09:21:21 +00:00
Karl-Johan Karlsson 33e205a40f Debug info: Fixed faulty debug locations for attributed statements
Summary:
As the attributed statements are considered simple statements no
stoppoint was generated before emitting attributed do/while/for/range-
statement. This lead to faulty debug locations.

Reviewers: echristo, aaron.ballman, dblaikie

Reviewed By: dblaikie

Subscribers: bjope, aprantl, cfe-commits

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

llvm-svn: 312623
2017-09-06 08:47:18 +00:00
Jonathan Coe f3ecda6057 Fix __repr__ for Diagnostic in clang.cindex
Summary: Also move misplaced tests for exception specification to fix failing Python tests.

Reviewers: hans, compnerd

Reviewed By: compnerd

Subscribers: cfe-commits

Tags: #clang-c

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

llvm-svn: 312622
2017-09-06 07:33:32 +00:00
Craig Topper 761bb1b53d [DAGCombiner] When combining EXTRACT_SUBVECTOR of a BUILD_VECTOR, make sure we don't create a BUILD_VECTOR with an illegal type after type legalization.
llvm-svn: 312621
2017-09-06 06:50:03 +00:00
Chandler Carruth 585bfc8443 [x86] Fix PR34377 by disabling cmov conversion when we relied on it
performing a zext of a register.

On the PR there is discussion of how to more effectively handle this,
but this patch prevents us from miscompiling code.

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

llvm-svn: 312620
2017-09-06 06:28:08 +00:00
Zvi Rackover 5ebe94a84d X86 Tests: Tidy up AVX512 conversion tests. NFC.
Rename functions to a consistent format to make it easier to track coverage.

llvm-svn: 312619
2017-09-06 05:33:04 +00:00
Saleem Abdulrasool 6bf6a9a124 Driver: delete some dead code (NFC)
This code has been `#if 0`'ed out for a very long time.  After speaking
with Duncan, opt to remove it even if it is something which should be
fixed.  If the underlying issue is still valid, this can be restored
with proper explanation and tests.

llvm-svn: 312618
2017-09-06 05:11:19 +00:00
Martin Storsjo f8689b1be1 Redirect strftime_l to the locale-ignorant strftime on mingw
_strftime_l is only available in the numbered msvcrt versions
(starting from msvcr80.dll). In the default configuration, mingw
targets the unversioned msvcrt.dll - and there, _strftime_l is
not available (not even on windows 10).

If __MSVCRT_VERSION__ is set to a higher value (indicating a
non-default target and wanting to link to msvcrXX.dll), use the
correct function.

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

llvm-svn: 312617
2017-09-06 05:07:25 +00:00
Saleem Abdulrasool c2320add83 Driver: remove unused variable (NFC)
Remove `IsHosted` which is no longer needed in `RenderSSPOptions` after
SVN r312595.  The single use can now be inlined.  NFC

llvm-svn: 312616
2017-09-06 04:56:23 +00:00
Jatin Bhateja 80b5e38c4e Updating a test reference for rL312608.
Differential Revision: https://reviews.llvm.org/D37501

llvm-svn: 312614
2017-09-06 03:58:14 +00:00
Craig Topper eec768b5c4 [X86] Add more FMA3 patterns to cover a load in all 3 possible positions.
This matches what we already do for AVX512. The peephole pass makes up for this in most if not all cases. But this makes isel behavior for these consistent with every other instruction.

llvm-svn: 312613
2017-09-06 03:35:58 +00:00
Hal Finkel 112a6bac72 [PowerPC] Don't use xscvdpspn on the P7
xscvdpspn was not introduced until the P8, so don't use it on the P7. Fixes a
regression introduced in r288152.

llvm-svn: 312612
2017-09-06 03:08:26 +00:00
Petr Hosek a69a3a3f62 Revert "[libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return"
This reverts commit r312606 because it's causing an error on
libcxx-libcxxabi-x86_64-linux-ubuntu-asan bot.

llvm-svn: 312609
2017-09-06 03:00:42 +00:00
Jatin Bhateja 2c139f77c7 [X86] Allow cross-lane permutations for sub targets supporting AVX2.
Summary:
Most instructions in AVX work “in-lane”, that is, each source element is applied only to other
elements of the same lane, thus a cross lane permutation is costly and needs more than one instrution.
AVX2 includes instructions to perform any-to-any permutation of words over a 256-bit register
and vectorized table lookup.

This should also Fix PR34369

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

llvm-svn: 312608
2017-09-06 02:58:47 +00:00
Lang Hames 6dbf0876c1 [ORC] Fix some comments in JITSymbol.
Patch by Breckin Loggins. Thanks Breckin!

llvm-svn: 312607
2017-09-06 02:53:37 +00:00
Petr Hosek 53335d6d86 [libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return
The ASan runtime on many systems intercepts cxa_throw just so it
can call asan_handle_no_return first. Some newer systems such as
Fuchsia don't use interceptors on standard library functions at all,
but instead use sanitizer-instrumented versions of the standard
libraries. When libc++abi is built with ASan, cxa_throw can just
call asan_handle_no_return itself so no interceptor is required.

This is a re-land of r311045, which has become safe after r311869
changed compiler-rt to declare __asan_handle_no_return.

Patch by Roland McGrath

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

llvm-svn: 312606
2017-09-06 02:43:54 +00:00
Eric Beckmann 0aa4b7d4c5 Fix crbug 759265 by suppressing llvm mt warnings.
Summary:
Previous would throw warning whenever libxml2 is not installed.  Now
only give this warning if merging manifest fails.

Subscribers: llvm-commits

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

llvm-svn: 312604
2017-09-06 01:50:36 +00:00
Rafael Espindola dc8b7a96bd Use the section name if a STT_SECTION symbol has empty name.
Without this we would have multiple relocations pointing to symbols
with the same name: the empty string. There was no way for yaml2obj to
be able to handle that.

A more general solution would be to unique symbol names in a similar
way to how we unique section names.  In practice I think this covers
all common cases and is a bit more user friendly than using names like
sym1, sym2, sym3, etc.

llvm-svn: 312603
2017-09-06 00:57:53 +00:00
Bruno Cardoso Lopes bad2c4a000 Fix indentation mistake from r312595
llvm-svn: 312599
2017-09-06 00:44:10 +00:00
Yaxun Liu fc5121a722 [AMDGPU] Transform __read_pipe_* and __write_pipe_*
When packet size equals packet align and is power of 2, transform
__read_pipe* and __write_pipe* to specialized library function.

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

llvm-svn: 312598
2017-09-06 00:30:27 +00:00
Evgeniy Stepanov 9566d28997 [msan] Remove a stale fixme (NFC).
It was fixed in 312576.

llvm-svn: 312597
2017-09-06 00:28:52 +00:00
Petr Hosek 4f4bdc3c20 [sanitizer_common][Fuchsia] Update Fuchsia sanitizer markup
Include URLs to the markup format specification in code comments.
Use sanitizer markup in the sancov message about a dump just produced.

Patch by Roland McGrath

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

llvm-svn: 312596
2017-09-06 00:00:46 +00:00