Commit Graph

254742 Commits

Author SHA1 Message Date
Igor Laevsky c11c1ed909 [SCEV] Cache results during GetMinTrailingZeros query
Differential Revision: https://reviews.llvm.org/D29759

llvm-svn: 295060
2017-02-14 15:53:12 +00:00
Simon Pilgrim 5b281d9a5c [X86][SSE] Add shuffle combine tests showing missed opportunities to use UNPCK
Not correctly using UNDEF or ZERO inputs to combine to UNPCK shuffles

llvm-svn: 295059
2017-02-14 15:49:37 +00:00
Simon Pilgrim 8351cf1b6e [X86][SSE] Regenerate intrinsic upgrade tests
Remove excess semicolons

llvm-svn: 295058
2017-02-14 15:29:50 +00:00
Etienne Bergeron 60ce0f667c [compiler-rt][asan|win] Force tls_init test to use dynamic runtime
Summary:
There is no guarantee that the tls_init is executed on the static runtime
(/MT).

On windows 7, this unittest is failing.
On windows 10, I believe it's working because of the new CRT.

On ASAN side, it doesn't matter that the hook point is run or not.
It must be run only if there is other tls_initializer that are registered.

Reviewers: rnk, chrisha

Reviewed By: rnk

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 295057
2017-02-14 15:21:53 +00:00
Alexey Bataev 2a2f35d59c [SLP] Fix for PR31879: vectorize repeated scalar ops that don't get put
back into a vector

Previously the cost of the existing ExtractElement/ExtractValue
instructions was considered as a dead cost only if it was detected that
they have only one use. But these instructions may be considered
dead also if users of the instructions are also going to be vectorized,
like:
```
%x0 = extractelement <2 x float> %x, i32 0
%x1 = extractelement <2 x float> %x, i32 1
%x0x0 = fmul float %x0, %x0
%x1x1 = fmul float %x1, %x1
%add = fadd float %x0x0, %x1x1
```
This can be transformed to
```
%1 = fmul <2 x float> %x, %x
%2 = extractelement <2 x float> %1, i32 0
%3 = extractelement <2 x float> %1, i32 1
%add = fadd float %2, %3
```
because though `%x0` and `%x1` have 2 users each other, these users are
part of the vectorized tree and we can consider these `extractelement`
instructions as dead.

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

llvm-svn: 295056
2017-02-14 15:20:48 +00:00
Artyom Skrobov dc66a82dc7 Removing a redundant assignment
llvm-svn: 295055
2017-02-14 14:44:01 +00:00
Alexander Timofeev 9f61feac4a Revert "[AMDGPU] Fix for SIMachineScheduler crash. SI Scheduler should track"
This reverts commit ce06d9cb99298eb844b66e117f5108a06747c907.

llvm-svn: 295054
2017-02-14 14:29:05 +00:00
Simon Pilgrim a0878dea9e [X86][SSE] Move unary inputs handling inside matchVectorShuffleWithUNPCK.
llvm-svn: 295053
2017-02-14 13:47:17 +00:00
George Rimar bdce4ad21d [ELF] - Do sign extend for addends of R_386_8, R_386_16 relocations
Patch makes addends for addends of R_386_8, R_386_16 relocations
be sign extended.

The same we did earlier for PC ones,
currenly LLD fails to link linux kernel, 
reporting relocation out of range because of this.

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

llvm-svn: 295052
2017-02-14 13:22:03 +00:00
Simon Pilgrim 3efdffcb27 [X86][SSE] Tidyup matchVectorShuffleWithUNPCK helper function call.
Don't bother setting the V1/V2 operands again for unary shuffles.

Don't bother legalizing the value type unless the match succeeds.

llvm-svn: 295051
2017-02-14 12:54:39 +00:00
Alexey Bataev 4ed47342ff [SLP] Additional tests for extractelement cost fix.
llvm-svn: 295050
2017-02-14 12:52:05 +00:00
Benjamin Kramer d1013b44e3 [clang-tidy] Add support for NOLINTNEXTLINE.
Reviewers: alexfh

Subscribers: JDevlieghere, cfe-commits

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

llvm-svn: 295049
2017-02-14 12:47:56 +00:00
Haojian Wu be2588fa7f [clang-tidy] Improve diagnostic message for misc-definitions-in-header.
Summary:
Users might get confused easily when they see the check's message on
full template function speciliations.

Add a note to the output message, which mentions these kind of function
specializations are treated as regular functions.

Reviewers: alexfh

Reviewed By: alexfh

Subscribers: JDevlieghere, cfe-commits

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

llvm-svn: 295048
2017-02-14 12:39:22 +00:00
Pavel Labath 810b34ab8c XFAIL TestNameLookup for GCC
I think I have a fix for this, but it needs review. This should keep the
bots happy until then.

llvm-svn: 295047
2017-02-14 12:06:54 +00:00
Simon Pilgrim 75dda50ebe [X86][SSE] Test case showing missed PSHUFB target shuffle constant fold opportunity.
It also shows an unnecessary pshufb/broadcast being used - the original pshufb mask only requested the lowest byte.

llvm-svn: 295046
2017-02-14 11:20:11 +00:00
Laszlo Nagy 258ff25bbc [scan-build-py] move function report_directory from report module to analyze module
Differential Revision: https://reviews.llvm.org/D29255

llvm-svn: 295045
2017-02-14 10:43:38 +00:00
Krasimir Georgiev 93a8e9df44 [clang-format] Remove dead code in FormatTestComments, NFC
llvm-svn: 295044
2017-02-14 10:35:42 +00:00
Laszlo Nagy 52c1d7eb11 [scan-build-py] use subprocess wrapper to execute build
llvm-svn: 295043
2017-02-14 10:30:50 +00:00
Karl-Johan Karlsson ec21b769ec Revert "[LoopVectorize] Added address space check when analysing interleaved accesses"
This reverts r295038. The buildbot clang-with-thin-lto-ubuntu failed.
I'm reverting to investigate.

llvm-svn: 295042
2017-02-14 10:06:16 +00:00
Gabor Horvath e647bd59f6 [clang-tidy] Add readability-misleading-indentation check.
Differential Revision: https://reviews.llvm.org/D19586

llvm-svn: 295041
2017-02-14 10:03:27 +00:00
Simon Atanasyan 7a2a1ff37f [ELF][MIPS] Use `InputSectionBase::getOutputSection()` to access output sections from the `MipsGotSection`
Follow-up to r294005. This patch restores handling of MISP GOT
relocations against merge sections.

llvm-svn: 295040
2017-02-14 09:56:16 +00:00
Karl-Johan Karlsson 2ec409cca2 [LoopVectorize] Added address space check when analysing interleaved accesses
Prevent memory objects of different address spaces to be part of
the same load/store groups when analysing interleaved accesses.

This is fixing pr31900.

Reviewers: HaoLiu, mssimpso, mkuper

Reviewed By: mssimpso, mkuper

Subscribers: llvm-commits, efriedma, mzolotukhin

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

llvm-svn: 295038
2017-02-14 08:14:06 +00:00
Karl-Johan Karlsson 38cbf5869d Test commit permission
Removing whitespace.

llvm-svn: 295037
2017-02-14 07:31:36 +00:00
Daniel Jasper 29b46f74f7 Add initializer that was missed in r295009.
llvm-svn: 295036
2017-02-14 07:10:03 +00:00
Craig Topper d2d50cba2a [AVX-512] Add PAVGB/PAVGW to load folding tables.
llvm-svn: 295035
2017-02-14 06:54:57 +00:00
Akira Hatanaka f1b3fc7356 [CodeGen][ObjC] Use the type of the captured field of the enclosing
block or lambda.

This is a follow-up to r281682, which fixed a bug in computeBlockInfo
where the captured VarDecl's type, rather than the captured field type
of the enclosing lambda or block, was used to compute the layout of a
block.

This commit makes similar changes to enterBlockScope. This is necessary
to correctly determine whether a block capture requires cleanup.

rdar://problem/30388124

llvm-svn: 295034
2017-02-14 06:46:55 +00:00
Mikael Holmen ece84cd10c [LSR] Pointers with different address spaces are considered incompatible.
Summary:
Function isCompatibleIVType is already used as a guard before the call to

 SE.getMinusSCEV(OperExpr, PrevExpr);

in LSRInstance::ChainInstruction. getMinusSCEV requires the expressions
to be of the same type, so we now consider two pointers with different
address spaces to be incompatible, since it is possible that the pointers
in fact have different sizes.

Reviewers: qcolombet, eli.friedman

Reviewed By: qcolombet

Subscribers: nhaehnle, Ka-Ka, llvm-commits, mzolotukhin

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

llvm-svn: 295033
2017-02-14 06:37:42 +00:00
George Burgess IV 758cf9da37 Delete useless / in comment. NFC.
llvm-svn: 295032
2017-02-14 05:52:57 +00:00
Rui Ueyama 104e2357de Do not store a computable attributes to Config.
llvm-svn: 295031
2017-02-14 05:45:47 +00:00
Lang Hames f401077c29 [Orc][RPC] Remove lanch policies in favor of async handlers.
Launch policies provided a mechanism for running RPC handlers on a background
thread (unblocking the main RPC receiver thread). Async handlers generalize
this by passing the responder function (the function that sends the RPC return
value) as an argument to the handler. The handler can optionally do its work on
a background thread (the same way launch policies do), but can also (a) can
inspect the call arguments before deciding to run the work on a different
thread, or (b) can use the responder in a subsequent RPC call (e.g. in the
handler of a callAsync), allowing the handler to call back to the originator (or
to a 3rd party) without blocking the listener thread, and without launching a
new thread.

llvm-svn: 295030
2017-02-14 05:40:01 +00:00
George Burgess IV b61bfbd93a Add a destruct-on-exit function to ASTContext.
It looks like the only use of AddDeallocation is to indirectly call the
destructors of objects. In one case I found
(TypeAliasTemplateDecl::Common), the destructor is a nop, so registering
it to run later seems pointless.

All of the other *::Common types have non-trivial dtors, so deleting the
useless AddDeallocation felt somewhat fragile. Happy to kill it + turn
the is_trivial_dtor check into a static_assert if people think that'd be
better.

llvm-svn: 295029
2017-02-14 05:37:36 +00:00
Alex Bradbury e4f731b813 [RISCV] Fix RV32 datalayout string and ensure initAsmInfo is called
llvm-svn: 295028
2017-02-14 05:20:20 +00:00
Alex Bradbury 6be16fbfb8 [RISCV] Pseudo instructions are isCodeGenOnly, have blank asmstr
llvm-svn: 295027
2017-02-14 05:17:23 +00:00
Alex Bradbury d36e04cb6c [RISCV] Fix unused variable in RISCVMCTargetDesc. NFC
Also, for better uniformity use TargetRegistry::RegisterMCAsmInfo rather than 
RegisterMCAsmInfoFn. Again, no functional change.

llvm-svn: 295026
2017-02-14 05:15:24 +00:00
Jason Molenda be227955e2 Before returning a pc value for a stack frame,
run it through the ABI's FixCodeAddress method.
<rdar://problem/29711506> 

llvm-svn: 295025
2017-02-14 04:55:03 +00:00
Rui Ueyama 4c82b4f6fa Add file comments for ScriptParser.cpp.
llvm-svn: 295023
2017-02-14 04:47:24 +00:00
Rui Ueyama 794366a237 Rename ScriptParser.{cpp,h} -> ScriptLexer.{cpp,h}.
These files contain a lexer, so the new names are better.
The parser is in LinkerScript.{cpp,h}.

llvm-svn: 295022
2017-02-14 04:47:05 +00:00
Peter Collingbourne 002c2d5380 ThinLTOBitcodeWriter: Write available_externally copies of VCP eligible functions to merged module.
Differential Revision: https://reviews.llvm.org/D29701

llvm-svn: 295021
2017-02-14 03:42:38 +00:00
NAKAMURA Takumi eb7702e07d clang/test/Parser/cxx1z-class-template-argument-deduction.cpp: Tweak to ignore thiscall.
Line 38: multiple overloads of 'f' instantiate to the same signature 'void (int) __attribute__((thiscall))'

llvm-svn: 295020
2017-02-14 03:18:24 +00:00
Mehdi Amini a0ddb1ed46 [ThinLTO] Make a copy of buffer identifier in ThinLTOCodeGenerator
We can't assume that the `const char *` provided through libLTO has a
lifetime that expands beyond the codegenerator itself.

llvm-svn: 295018
2017-02-14 02:20:51 +00:00
Tim Shen b94588eb88 Re-commit r294826 and r294781, with a fix on the cmake file to only
compile on powerpc64le.

I cannot locally reproduce this test failure:
http://lab.llvm.org:8011/builders/sanitizer-ppc64le-linux/builds/1363/steps/test%20standalone%20compiler-rt/logs/stdio

Let's see how the buildbot goes.

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

llvm-svn: 295017
2017-02-14 02:05:47 +00:00
Richard Smith c27b3d7623 Canonicalize implicit deduction guide parameter types when forming a deduction
guide from a constructor.

The purpose of this change is to avoid triggering instantiation of the class
when substituting back into the deduction guide if it uses a typedef member.
We will still instantiate the class if the constructor (explicitly or
implicitly, directly or indirectly) uses the current instantiation in a way
that we can't canonicalize out, but that seems unavoidable.

llvm-svn: 295016
2017-02-14 01:49:59 +00:00
Philip Reames b2bca7e309 [LICM] Make store promotion work in the face of unordered atomics
Extend our store promotion code to deal with unordered atomic accesses. Ordered atomics continue to be unhandled.

Most of the change is straight-forward, the only complicated bit is in the reasoning around mixing of atomic and non-atomic memory access. Rather than trying to reason about the complex semantics in these cases, I simply disallowed promotion when both atomic and non-atomic accesses are present. This is conservatively correct.

It seems really tempting to just promote all access to atomics, but the original accesses might have been conditional. Since we can't lower an arbitrary atomic type, it might not be safe to promote all access to atomic. Consider a loop like the following:
while(b) {
  load i128 ...
  if (can lower i128 atomic)
    store atomic i128 ...
  else
    store i128
}

It could be there's no race on the location and thus the code is perfectly well defined even if we can't lower a i128 atomically. 

It's not clear we need to be this conservative - arguably the program above is brocken since it can't be lowered unless the branch is folded - but I didn't want to have to fix any fallout which might result.

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

llvm-svn: 295015
2017-02-14 01:38:31 +00:00
Reid Kleckner e2fa5492b2 Undef MemoryFence, which is defined to _mm_mfence by winnt.h
llvm-svn: 295014
2017-02-14 01:38:14 +00:00
Reid Kleckner a7661c842f Use std::call_once on Windows
Previously we could not use it because std::once_flag's default
constructor was not constexpr. Today, all supported versions of VS
correctly mark it constexpr. I confirmed that MSVC 2015 does not emit
any problematic racy dynamic initialization code, so we should be safe
to use this now.

llvm-svn: 295013
2017-02-14 01:21:39 +00:00
Francis Ricci 8187c7b06b Add cmake build support for lsan on OS X
Summary:
Adds a new cmake flag 'COMPILER_RT_ENABLE_LSAN_OSX', which enables lsan
compilation and is turned off by default. Patches to fix build errors
when this flag is enabled will be uploaded soon.

This is part of an effort to port LSan to OS X, but LSan on OS X does not
currently work or pass tests currently.

Reviewers: kubamracek, kcc, glider, alekseyshl

Reviewed By: kubamracek

Subscribers: danalbert, srhines, mgorny, llvm-commits

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

llvm-svn: 295012
2017-02-14 00:56:53 +00:00
Richard Smith cbe079321e [c++1z] Add some more tests for class template argument deduction, add
feature-test macro, and mark feature as done on status page.

llvm-svn: 295011
2017-02-14 00:55:25 +00:00
David Majnemer dc169759ca [MS ABI] Correctly mangling vbase destructors
They are a little bit of a special case in the mangling. They are always
mangled without taking into account their virtual-ness of the
destructor. They are also mangled to return void, unlike the actual
destructor.

This fixes PR31931.

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

llvm-svn: 295010
2017-02-14 00:54:11 +00:00
Eugene Zelenko d96089b248 [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
Same changes in files affected by reduced MC headers dependencies.

llvm-svn: 295009
2017-02-14 00:33:36 +00:00
Peter Collingbourne c45f7f3eb4 FunctionAttrs: Factor out a function for querying memory access of a specific copy of a function. NFC.
This will later be used by ThinLTOBitcodeWriter to add copies of readnone
functions to the regular LTO module.

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

llvm-svn: 295008
2017-02-14 00:28:13 +00:00