platform/upstream/llvm.git
6 years ago[SLP] Test for PR35047, NFC.
Alexey Bataev [Mon, 6 Nov 2017 14:52:57 +0000 (14:52 +0000)]
[SLP] Test for PR35047, NFC.

llvm-svn: 317482

6 years ago[X86][SSE] Combine EXTRACT_VECTOR_ELT with combineExtractWithShuffle before XFormVExt...
Simon Pilgrim [Mon, 6 Nov 2017 14:34:19 +0000 (14:34 +0000)]
[X86][SSE] Combine EXTRACT_VECTOR_ELT with combineExtractWithShuffle before XFormVExtractWithShuffleIntoLoad

combineExtractWithShuffle can handle more complex shuffles/bitcasts than we can with the equivalent code in XFormVExtractWithShuffleIntoLoad.

Mainly a compile time improvement now (combineExtractWithShuffle combines will have always failed late on inside XFormVExtractWithShuffleIntoLoad), and will let us merge combineExtractVectorElt_SSE in a future commit.

llvm-svn: 317481

6 years ago[OMPT] Improve cast that was lost on commit, NFC.
Jonas Hahnfeld [Mon, 6 Nov 2017 14:33:09 +0000 (14:33 +0000)]
[OMPT] Improve cast that was lost on commit, NFC.

llvm-svn: 317480

6 years ago[AMDGPU] Change alloca addr space of r600 to 5 for amdgiz environment
Yaxun Liu [Mon, 6 Nov 2017 14:32:33 +0000 (14:32 +0000)]
[AMDGPU] Change alloca addr space of r600 to 5 for amdgiz environment

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

llvm-svn: 317479

6 years ago[Polly] Fix using order, as this caused a test failure (NFC)
Florian Hahn [Mon, 6 Nov 2017 14:26:04 +0000 (14:26 +0000)]
[Polly] Fix using order, as this caused a test failure (NFC)

Summary:
Without this patch, clang-format in check-polly fails for me, with current master:

```
FAILED: cd build/tools/polly && build/bin/clang-format -sort-includes -style=llvm llvm/tools/polly/include/polly/ScopPass.h | diff -u llvm/tools/polly/include/polly/ScopPass.h -
--- llvm/tools/polly/include/polly/ScopPass.h 2017-11-06 14:05:49.885345000 +0000
+++ - 2017-11-06 14:07:24.956241758 +0000
@@ -40,12 +40,12 @@
 } // namespace polly

 namespace llvm {
+using polly::SPMUpdater;
 using polly::Scop;
 using polly::ScopAnalysisManager;
 using polly::ScopAnalysisManagerFunctionProxy;
 using polly::ScopInfo;
 using polly::ScopStandardAnalysisResults;
-using polly::SPMUpdater;

 template <>
 class InnerAnalysisManagerProxy<ScopAnalysisManager, Function>::Result {
```

Reviewers: grosser, Meinersbur, bollu

Reviewed By: Meinersbur

Subscribers: llvm-commits, pollydev

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

llvm-svn: 317478

6 years ago[SystemZ] implement hasDivRemOp()
Jonas Paulsson [Mon, 6 Nov 2017 13:10:31 +0000 (13:10 +0000)]
[SystemZ]  implement hasDivRemOp()

SystemZ can do division and remainder in a single instruction for scalar
integer types, which are now reflected by returning true in this hook for
those cases.

Review: Ulrich Weigand
llvm-svn: 317477

6 years ago[AMDGPU] Fix assertion due to assuming pointer in default addr space is 32 bit
Yaxun Liu [Mon, 6 Nov 2017 13:01:33 +0000 (13:01 +0000)]
[AMDGPU] Fix assertion due to assuming pointer in default addr space is 32 bit

The backend assumes pointer in default addr space is 32 bit, which is not
true for the new addr space mapping and causes assertion for unresolved
functions.

This patch fixes that.

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

llvm-svn: 317476

6 years ago[mips] Add movep for microMIPS32R6 and fix microMIPS32r3 version
Simon Dardis [Mon, 6 Nov 2017 12:59:53 +0000 (12:59 +0000)]
[mips] Add movep for microMIPS32R6 and fix microMIPS32r3 version

Previously, the 'movep' instruction was defined for microMIPS32r3 and
shared that definition with microMIPS32R6. 'movep' was re-encoded for
microMIPS32r6, so this patch provides the correct encoding.

Secondly, correct the encoding of the 'rs' and 'rt' operands which have
an instruction specific encoding for the registers those operands accept.

Finally, correct the decoding of the 'dst_regs' operand which was extracting
the relevant field from the instruction, but was actually extracting the
field from the alreadly extracted field.

Reviewers: atanasyan

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

llvm-svn: 317475

6 years agoExtend android xfail in TestTopLevelExprs
Pavel Labath [Mon, 6 Nov 2017 12:34:27 +0000 (12:34 +0000)]
Extend android xfail in TestTopLevelExprs

The test fails on API level 19 as well. I'm going to assume that it
fails on every API level below 23.

llvm-svn: 317474

6 years ago[clang-format] Handle unary operator overload with arguments and specifiers
Daniel Jasper [Mon, 6 Nov 2017 12:11:51 +0000 (12:11 +0000)]
[clang-format] Handle unary operator overload with arguments and specifiers

Before:
  int operator++(int)noexcept;

After:
  int operator++(int) noexcept;

Patch by Igor Sugak. Thank you!

llvm-svn: 317473

6 years ago[docs] Update code block for compatibility with Sphinx 1.5.1
Jonas Devlieghere [Mon, 6 Nov 2017 11:47:24 +0000 (11:47 +0000)]
[docs] Update code block for compatibility with Sphinx 1.5.1

It is currently not possible to build the documentation with cmake and
the same version of Sphinx (1.5.1) used to generate the public facing
documentation on llvm.org. When code blocks cannot be parsed by
Pygments, it generates a warning which is treated as an error.

In addition to being annoying and confusing for developers, this
needlessly increases the bar for newcomers that want to get involved.

This patch removes the language specifier from the affected block. The
result is the same as when parsing fails: the block are not highlighted.

llvm-svn: 317472

6 years ago[LV][X86] update the cost of interleaving mem. access of floats
Mohammed Agabaria [Mon, 6 Nov 2017 10:56:20 +0000 (10:56 +0000)]
[LV][X86] update the cost of interleaving mem. access of floats

Recommit:
This patch contains update of the costs of interleaved loads of v8f32 of stride 3 and 8.
fixed the location of the lit test it works with make check-all.

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

llvm-svn: 317471

6 years ago[mips] Fix PR35140
Simon Dardis [Mon, 6 Nov 2017 10:50:04 +0000 (10:50 +0000)]
[mips] Fix PR35140

Mark all symbols involved with TLS relocations as being TLS symbols.

This resolves PR35140.

Thanks to Alex Crichton for reporting the issue!

Reviewers: atanasyan

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

llvm-svn: 317470

6 years ago[ELF] Fix typo in comment for getISDThunkSec [NFC]
Peter Smith [Mon, 6 Nov 2017 10:36:18 +0000 (10:36 +0000)]
[ELF] Fix typo in comment for getISDThunkSec [NFC]

The ISR in the comment should read ISD for InputSectionDescription. The use
of ISR (InputSectionRange) was from the original implementation that did not
use the sections from InputSectionDescription directly.

llvm-svn: 317469

6 years ago[clang-tidy] Support relative paths in run-clang-tidy.py
Gabor Horvath [Mon, 6 Nov 2017 10:36:02 +0000 (10:36 +0000)]
[clang-tidy] Support relative paths in run-clang-tidy.py

Unfortunately, these python scripts are not tested currently. I did the testing
manually on LLVM by editing the CMake generated compilation database to
contain relative paths for some of the files.

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

llvm-svn: 317468

6 years agoFixed dead links in WritingAnLLVMPass.rst
Raphael Isemann [Mon, 6 Nov 2017 09:51:39 +0000 (09:51 +0000)]
Fixed dead links in WritingAnLLVMPass.rst

llvm-svn: 317467

6 years ago[Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of the wrapper.
Eric Liu [Mon, 6 Nov 2017 09:29:09 +0000 (09:29 +0000)]
[Tooling] Test internal::createExecutorFromCommandLineArgsImpl instead of the wrapper.

llvm-svn: 317466

6 years ago[X86][AVX512] Improve lowering of AVX512 test intrinsics
Uriel Korach [Mon, 6 Nov 2017 09:22:38 +0000 (09:22 +0000)]
[X86][AVX512] Improve lowering of AVX512 test intrinsics

Added TESTM and TESTNM to the list of instructions that already zeroing unused upper bits
and does not need the redundant shift left and shift right instructions afterwards.
Added a pattern for TESTM and TESTNM in iselLowering, so now icmp(neq,and(X,Y), 0) goes folds into TESTM
and icmp(eq,and(X,Y), 0) goes folds into TESTNM
This commit is a preparation for lowering the test and testn X86 intrinsics to IR.

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

llvm-svn: 317465

6 years ago[X86] Replace duplicate function call with variable. NFC
Uriel Korach [Mon, 6 Nov 2017 08:32:45 +0000 (08:32 +0000)]
[X86] Replace duplicate function call with variable. NFC

Change from:
if (N->getOperand(0).getValueType() == MVT::v8i32 ||
    N->getOperand(0).getValueType() == MVT::v8f32)

to:
EVT OpVT = N->getOperand(0).getValueType();
if (OpVT == MVT::v8i32 || OpVT == MVT::v8f32)

Change-Id: I5a105f8710b73a828e6cfcd55fac2eae6153ce25
llvm-svn: 317464

6 years agoX86 ISel: Basic support for variable-index vector permutations
Zvi Rackover [Mon, 6 Nov 2017 08:25:46 +0000 (08:25 +0000)]
X86 ISel: Basic support for variable-index vector permutations

Summary:
Try to lower a BUILD_VECTOR composed of extract-extract chains that can be
reasoned to be a permutation of a vector by indices in a non-constant vector.

We saw this pattern created by ISPC, which resolts to creating it due to the
requirement that shufflevector's mask operand be a *constant* vector.
I didn't check this but we could possibly use this pattern for lowering the X86 permute
C-instrinsics instead of llvm.x86 instrinsics.

This change can be followed by more improvements:
1. Handle vectors with undef elements.
2. Utilize pshufb and zero-mask-blending to support more effiecient
   construction of vectors with constant-0 elements.
3. Use smaller-element vectors of same width, and "interpolate" the indices,
   when no native operation available.

Reviewers: RKSimon, craig.topper

Reviewed By: RKSimon

Subscribers: chandlerc, DavidKreitzer

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

llvm-svn: 317463

6 years agoRevert "adding a pattern for broadcastm"
Jina Nahias [Mon, 6 Nov 2017 07:48:58 +0000 (07:48 +0000)]
Revert "adding a pattern for broadcastm"

This reverts commit r317457.

Change-Id: If07f1fca1e3453d16c1dac906e87768661384e91
llvm-svn: 317462

6 years ago[test] Add test files that were missed from SVN r317459
Martin Storsjo [Mon, 6 Nov 2017 07:36:17 +0000 (07:36 +0000)]
[test] Add test files that were missed from SVN r317459

llvm-svn: 317461

6 years agoUpdate tests for ARMNT/ARM64 reloc names
Martin Storsjo [Mon, 6 Nov 2017 07:22:17 +0000 (07:22 +0000)]
Update tests for ARMNT/ARM64 reloc names

After ObjectYAML learnt the proper enum names for ARMNT/ARM64
relocations, it no longer accepts the numerical values.

This fixes LLD tests after SVN r317459 in LLVM.

llvm-svn: 317460

6 years ago[ObjectYAML] Map relocation types for COFF ARMNT and ARM64
Martin Storsjo [Mon, 6 Nov 2017 07:20:58 +0000 (07:20 +0000)]
[ObjectYAML] Map relocation types for COFF ARMNT and ARM64

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

llvm-svn: 317459

6 years ago[x86][AVX512] Lowering Broadcastm intrinsics to LLVM IR
Jina Nahias [Mon, 6 Nov 2017 07:09:24 +0000 (07:09 +0000)]
[x86][AVX512] Lowering Broadcastm intrinsics to LLVM IR

This patch, together with a matching clang patch (https://reviews.llvm.org/D38683), implements the lowering of X86 broadcastm intrinsics to IR.

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

Change-Id: I709ac0b34641095397e994c8ff7e15d1315b3540
llvm-svn: 317458

6 years agoadding a pattern for broadcastm
Jina Nahias [Mon, 6 Nov 2017 07:09:09 +0000 (07:09 +0000)]
adding a pattern for broadcastm

Change-Id: I6551fb13879e098aed74de410e29815cf37d9ab5
llvm-svn: 317457

6 years agolowering broadcastm
Jina Nahias [Mon, 6 Nov 2017 07:04:12 +0000 (07:04 +0000)]
lowering broadcastm

Change-Id: I0661abea3e3742860e0a03ff9e4fcdc367eff7db
llvm-svn: 317456

6 years ago[COFF] Handle ARM64 in getDefaultType
Martin Storsjo [Mon, 6 Nov 2017 07:02:33 +0000 (07:02 +0000)]
[COFF] Handle ARM64 in getDefaultType

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

llvm-svn: 317455

6 years ago[X86] Use EVEX encoded intrinsics for legacy FMA intrinsics when possible.
Craig Topper [Mon, 6 Nov 2017 05:48:26 +0000 (05:48 +0000)]
[X86] Use EVEX encoded intrinsics for legacy FMA intrinsics when possible.

llvm-svn: 317454

6 years ago[X86] Add scalar FMA ISD nodes without rounding mode. NFC
Craig Topper [Mon, 6 Nov 2017 05:48:25 +0000 (05:48 +0000)]
[X86] Add scalar FMA ISD nodes without rounding mode. NFC

Next step is to use them for the legacy FMA scalar intrinsics as well. This will enable the legacy intrinsics to use EVEX encoded opcodes and the extended registers.

llvm-svn: 317453

6 years ago[X86] Add avx512vl command line to fma-instrinsics-x86.ll
Craig Topper [Mon, 6 Nov 2017 05:48:24 +0000 (05:48 +0000)]
[X86] Add avx512vl command line to fma-instrinsics-x86.ll

Some of these demonstrate a missed EVEX to VEX compression because we aren't prefering EVEX instructions during isel.

llvm-svn: 317452

6 years ago[X86] Simplify command lines on the fma-instrinsics-x86.ll test and add -show-mc...
Craig Topper [Mon, 6 Nov 2017 05:48:23 +0000 (05:48 +0000)]
[X86] Simplify command lines on the fma-instrinsics-x86.ll test and add -show-mc-encoding.

Use feature names instead of CPU names.

A future commit will add avx512vl command lines to demonstrate missed use of EVEX instructions.

llvm-svn: 317451

6 years agoELF: Remove SymbolTable::SymIndex class.
Peter Collingbourne [Mon, 6 Nov 2017 04:58:04 +0000 (04:58 +0000)]
ELF: Remove SymbolTable::SymIndex class.

The Traced flag is unnecessary because we only need to set the index
to -1 to mark a symbol for tracing.

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

llvm-svn: 317450

6 years agoELF: Remove function Symbol::isInCurrentOutput().
Peter Collingbourne [Mon, 6 Nov 2017 04:39:07 +0000 (04:39 +0000)]
ELF: Remove function Symbol::isInCurrentOutput().

This function is now equivalent to isDefined().

llvm-svn: 317449

6 years agoELF: Merge DefinedRegular and Defined.
Peter Collingbourne [Mon, 6 Nov 2017 04:35:31 +0000 (04:35 +0000)]
ELF: Merge DefinedRegular and Defined.

Now that DefinedRegular is the only remaining derived class of
Defined, we can merge the two classes.

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

llvm-svn: 317448

6 years agoELF: Remove DefinedCommon.
Peter Collingbourne [Mon, 6 Nov 2017 04:33:58 +0000 (04:33 +0000)]
ELF: Remove DefinedCommon.

Common symbols are now represented with a DefinedRegular that points
to a BssSection, even during symbol resolution.

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

llvm-svn: 317447

6 years agoDo not consider Shared symbols as defined symbols.
Rui Ueyama [Mon, 6 Nov 2017 04:13:24 +0000 (04:13 +0000)]
Do not consider Shared symbols as defined symbols.

I don't remember why I made shared symbols one type of defined symbols.
Shared symbols aren't undefined, so it could be considered defined, but
categorizing three symbols as:

 - defined
   - really defined
   - shared
 - undefined

is not as intuitive as

 - defined
 - shared
 - undefined

to me. So, in this patch, I made a change to stop handling shared
symbols as defined symbols.

Surprisingly, I didn't have to update any tests for this change.

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

llvm-svn: 317446

6 years ago[X86] Use EVEX encoded instructions for legacy scalar sqrt intrinsics.
Craig Topper [Mon, 6 Nov 2017 04:04:01 +0000 (04:04 +0000)]
[X86] Use EVEX encoded instructions for legacy scalar sqrt intrinsics.

Fixes PR35161.

llvm-svn: 317445

6 years ago[PassManager, SimplifyCFG] Revert r316908 and r316869.
David L. Jones [Mon, 6 Nov 2017 00:32:01 +0000 (00:32 +0000)]
[PassManager, SimplifyCFG] Revert r316908 and r316869.

These cause Clang to crash with a segfault. See PR35210 for details.

llvm-svn: 317444

6 years agoRemove \brief from doxygen comments in PrettyPrinter.h
Adrian Prantl [Sun, 5 Nov 2017 21:52:36 +0000 (21:52 +0000)]
Remove \brief from doxygen comments in PrettyPrinter.h

Patch by @xsga!

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

llvm-svn: 317443

6 years ago[X86] Add missing predicate to a pattern. NFC
Craig Topper [Sun, 5 Nov 2017 21:14:06 +0000 (21:14 +0000)]
[X86] Add missing predicate to a pattern. NFC

Other patterns had higher priority so this wasn't noticed. But we shouldn't be dependent on pattern order.

llvm-svn: 317442

6 years ago[X86] Remove some more RCP and RSQRT patterns from InstrAVX512.td that I missed in...
Craig Topper [Sun, 5 Nov 2017 21:14:05 +0000 (21:14 +0000)]
[X86] Remove some more RCP and RSQRT patterns from InstrAVX512.td that I missed in r317413.

llvm-svn: 317441

6 years ago[X86] Fix outdated comment. NFC
Craig Topper [Sun, 5 Nov 2017 21:14:04 +0000 (21:14 +0000)]
[X86] Fix outdated comment. NFC

llvm-svn: 317440

6 years ago[X86][SSE] Tests for integer min/max horizontal reductions
Simon Pilgrim [Sun, 5 Nov 2017 19:48:24 +0000 (19:48 +0000)]
[X86][SSE] Tests for integer min/max horizontal reductions

Matching patterns that vectorizers should have created for us.

The experimental intrinsics should probably be added as well.

llvm-svn: 317439

6 years ago[LV/LAA] Avoid specializing a loop for stride=1 when this predicate implies a
Dorit Nuzman [Sun, 5 Nov 2017 16:53:15 +0000 (16:53 +0000)]
[LV/LAA] Avoid specializing a loop for stride=1 when this predicate implies a
single-iteration loop

This fixes PR34681. Avoid adding the "Stride == 1" predicate when we know that
Stride >= Trip-Count. Such a predicate will effectively optimize a single
or zero iteration loop, as Trip-Count <= Stride == 1.

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

llvm-svn: 317438

6 years ago[SLPVectorizer] minimize tests and auto-generate full checks; NFC
Sanjay Patel [Sun, 5 Nov 2017 16:11:01 +0000 (16:11 +0000)]
[SLPVectorizer] minimize tests and auto-generate full checks; NFC

llvm-svn: 317437

6 years agoUpdating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)
Joachim Protze [Sun, 5 Nov 2017 14:11:19 +0000 (14:11 +0000)]
Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)

The TR6 document is expected to be publically released around November 15.
This patch does not implement OMPT for libomptarget.

Patch by Simon Convent and Joachim Protze

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

llvm-svn: 317436

6 years agoRename fields of ompt_frame_t
Joachim Protze [Sun, 5 Nov 2017 14:11:10 +0000 (14:11 +0000)]
Rename fields of ompt_frame_t

This is part of the renaming of data types from OpenMP TR4 to TR6

Patch by Simon Convent

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

llvm-svn: 317435

6 years ago[clang-diff] NFC: format
Johannes Altmanninger [Sun, 5 Nov 2017 11:53:18 +0000 (11:53 +0000)]
[clang-diff] NFC: format

llvm-svn: 317434

6 years ago[REVERT][LV][X86] update the cost of interleaving mem. access of floats
Mohammed Agabaria [Sun, 5 Nov 2017 09:36:54 +0000 (09:36 +0000)]
[REVERT][LV][X86] update the cost of interleaving mem. access of floats

reverted my changes will be committed later after fixing the failure
This patch contains update of the costs of interleaved loads of v8f32 of stride 3 and 8.

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

llvm-svn: 317433

6 years ago[LV][X86] update the cost of interleaving mem. access of floats
Mohammed Agabaria [Sun, 5 Nov 2017 09:06:23 +0000 (09:06 +0000)]
[LV][X86] update the cost of interleaving mem. access of floats

This patch contains update of the costs of interleaved loads of v8f32 of stride 3 and 8.

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

llvm-svn: 317432

6 years ago[CGP] Fix the bug found by asan.
Serguei Katkov [Sun, 5 Nov 2017 07:59:02 +0000 (07:59 +0000)]
[CGP] Fix the bug found by asan.

Try to fix the asan failure introduced by r317429.

llvm-svn: 317431

6 years ago[CGP] Extends the scope of optimizeMemoryInst optimization. NFC
Serguei Katkov [Sun, 5 Nov 2017 05:51:44 +0000 (05:51 +0000)]
[CGP] Extends the scope of optimizeMemoryInst optimization. NFC

Commit tests for previous commit.

Reviewers: efriedma, dberlin, mkazantsev, reames, john.brawn
Reviewed By: john.brawn
Subscribers: javed.absar, john.brawn, dneilson, llvm-commits
Differential Revision: https://reviews.llvm.org/D36073

llvm-svn: 317430

6 years ago[CGP] Extends the scope of optimizeMemoryInst optimization
Serguei Katkov [Sun, 5 Nov 2017 05:50:33 +0000 (05:50 +0000)]
[CGP] Extends the scope of optimizeMemoryInst optimization

This is an implementation of PR26223.

Currently optimizeMemoryInst optimization tries to fold address computation
if all possible way to get compute the address are of the form

baseGV + base + scale * Index + offset
where scale and offset are constants and baseGV, base and Index are exactly
the same instructions if defined.

The patch extends this optimization to allow different bases. In this case
it tries to find/build a Phi node merging all possible bases and use this Phi node
as a base for sunk address computation. Also it supports Select instruction on
the way.

The main motivation for this scope extension is GCRelocateInst.
If there is a relocation of derived pointer it will be represented as relocation of base + offset.
Also there will be a Phi node merging address computation for relocated derived pointer
and derived pointer itself. If we have a Phi node merging original base and relocated base
and can fold the address computation of derived pointer then we can potentially reduce
the code size and Phi node for derived pointer. The later can have a positive impact to
register allocator.

Reviewers: efriedma, dberlin, mkazantsev, reames, john.brawn
Reviewed By: john.brawn
Subscribers: javed.absar, john.brawn, dneilson, llvm-commits
Differential Revision: https://reviews.llvm.org/D36073

llvm-svn: 317429

6 years agoInline a small function.
Rui Ueyama [Sat, 4 Nov 2017 23:57:51 +0000 (23:57 +0000)]
Inline a small function.

llvm-svn: 317428

6 years agoMove OutputSectionFactory to LinkerScript.cpp. NFC.
Rui Ueyama [Sat, 4 Nov 2017 23:54:25 +0000 (23:54 +0000)]
Move OutputSectionFactory to LinkerScript.cpp. NFC.

That class is used only by LinkerScript.cpp, so we should move it to
that file. Also, it no longer has to be a "factory" class. It can just
be a non-member function.

llvm-svn: 317427

6 years agoRewrite addSymbolWrap and applySymbolWrap. NFCI.
Rui Ueyama [Sat, 4 Nov 2017 23:09:43 +0000 (23:09 +0000)]
Rewrite addSymbolWrap and applySymbolWrap. NFCI.

r317396 changed the way how we handle the -defsym option. The option is
now handled using the infrastructure for the linker script.

We used to handle both -defsym and -wrap using the same set of functions
in the symbol table. Now, we don't need to do that.

This patch rewrites the functions so that they become more straightforward.
The new functions directly handle -wrap rather than abstract it.

llvm-svn: 317426

6 years agoRemove dead code and update comment.
Rui Ueyama [Sat, 4 Nov 2017 22:32:56 +0000 (22:32 +0000)]
Remove dead code and update comment.

llvm-svn: 317425

6 years ago[X86][AVX] Regenerate test. NFCI.
Simon Pilgrim [Sat, 4 Nov 2017 21:18:06 +0000 (21:18 +0000)]
[X86][AVX] Regenerate test. NFCI.

llvm-svn: 317424

6 years agoAdd ifdefs around ELF specific parts of UnwindRegisters*.S for arm
Martin Storsjo [Sat, 4 Nov 2017 21:01:31 +0000 (21:01 +0000)]
Add ifdefs around ELF specific parts of UnwindRegisters*.S for arm

This allows using dwarf exceptions on MinGW/ARM.

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

llvm-svn: 317423

6 years agoUse code voice for DIBuilder in LLVM C API
Harlan Haskins [Sat, 4 Nov 2017 20:31:20 +0000 (20:31 +0000)]
Use code voice for DIBuilder in LLVM C API

(This is a test commit)

llvm-svn: 317422

6 years ago[Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]
Roman Lebedev [Sat, 4 Nov 2017 20:27:47 +0000 (20:27 +0000)]
[Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]

Basically a regression after r316268.
However the diagnostic is correct, but the test coverage is bad.

So just like rL316500, introduce yet more tests,
and adjust the release notes.

See https://bugs.llvm.org/show_bug.cgi?id=35200

llvm-svn: 317421

6 years agoMove the llvm-tblgen project into the Tablegenning folder on IDEs like Visual Studio...
Aaron Ballman [Sat, 4 Nov 2017 20:07:16 +0000 (20:07 +0000)]
Move the llvm-tblgen project into the Tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

llvm-svn: 317420

6 years agoMove the clang-tblgen-targets project into the Misc folder on IDEs like Visual Studio...
Aaron Ballman [Sat, 4 Nov 2017 20:06:49 +0000 (20:06 +0000)]
Move the clang-tblgen-targets project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

llvm-svn: 317419

6 years agoMove the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual...
Aaron Ballman [Sat, 4 Nov 2017 20:06:22 +0000 (20:06 +0000)]
Move the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

llvm-svn: 317418

6 years agoMove the libclang-headers project into the Misc folder on IDEs like Visual Studio...
Aaron Ballman [Sat, 4 Nov 2017 20:00:21 +0000 (20:00 +0000)]
Move the libclang-headers project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

llvm-svn: 317417

6 years agoMove the srpm, ocaml_make_directory, llvm_vcsrevision_h, and llvm-headers projects...
Aaron Ballman [Sat, 4 Nov 2017 19:59:14 +0000 (19:59 +0000)]
Move the srpm, ocaml_make_directory, llvm_vcsrevision_h, and llvm-headers projects into the Misc folder on IDEs like Visual Studio rather than leave them in the root directory. NFC.

llvm-svn: 317416

6 years agoMove the LLVMCFIVerify project into the Libraries folder on IDEs like Visual Studio...
Aaron Ballman [Sat, 4 Nov 2017 19:48:17 +0000 (19:48 +0000)]
Move the LLVMCFIVerify project into the Libraries folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

llvm-svn: 317415

6 years agoMove these CMake projects into the Tests folder on IDEs like Visual Studio rather...
Aaron Ballman [Sat, 4 Nov 2017 19:39:14 +0000 (19:39 +0000)]
Move these CMake projects into the Tests folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.

llvm-svn: 317414

6 years ago[X86] Don't use RCP14 and RSQRT14 for reciprocal estimations or for legacy SSE rcp...
Craig Topper [Sat, 4 Nov 2017 18:26:41 +0000 (18:26 +0000)]
[X86] Don't use RCP14 and RSQRT14 for reciprocal estimations or for legacy SSE rcp/rsqrt intrinsics when AVX512 features are enabled.

Summary:
AVX512 added RCP14 and RSQRT instructions which improve accuracy over the legacy RCP and RSQRT instruction, but not enough accuracy to remove the need for a Newton Raphson refinement.

Currently we use these new instructions for the legacy packed SSE instrinics, but not the scalar instrinsics. And we use it for fast math optimization of division and reciprocal sqrt.

I think switching the legacy instrinsics maybe surprising to the user since it changes the answer based on which processor you're using regardless of any fastmath settings. It's also weird that we did something different between scalar and packed.

As far at the reciprocal estimation, I think it creates unnecessary deltas in our output behavior (and prevents EVEX->VEX). A little playing around with gcc and icc and godbolt suggest they don't change which instructions they use here.

This patch adds new X86ISD nodes for the RCP14/RSQRT14 and uses those for the new intrinsics. Leaving the old intrinsics to use the old instructions.

Going forward I think our focus should be on
-Supporting 512-bit vectors, which will have to use the RCP14/RSQRT14.
-Using RSQRT28/RCP28 to remove the Newton Raphson step on processors with AVX512ER
-Supporting double precision.

Reviewers: zvi, DavidKreitzer, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 317413

6 years ago[X86] Regenerate a couple more tests that I missed in r317410.
Craig Topper [Sat, 4 Nov 2017 18:26:39 +0000 (18:26 +0000)]
[X86] Regenerate a couple more tests that I missed in r317410.

llvm-svn: 317412

6 years agoImprove the posix core file triple detection
Tamas Berghammer [Sat, 4 Nov 2017 18:25:51 +0000 (18:25 +0000)]
Improve the posix core file triple detection

Summary:
Posix core files sometime don't contain enough information to correctly
detect the OS. If that is the case we should use the OS from the target
instead as it will contain usable information in more cases and if the
target and the core contain different OS-es then we are already in a
pretty bad state so moving from an unknown OS to a known (but possibly
incorrect) OS will do no harm.

We already had similar code in place for MIPS. This change tries to make
it more generic by using ArchSpec::MergeFrom and extends it to all
architectures but some MIPS specific issue prevent us from getting rid
of special casing MIPS.

Reviewers: clayborg, nitesh.jain

Subscribers: aemerson, sdardis, arichardson, kristof.beyls, lldb-commits

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

llvm-svn: 317411

6 years ago[X86] Teach EVEX->VEX pass to turn SHUFI32X4/SHUFF32X4/SHUFI64X/SHUFF64X2 into VPERM2...
Craig Topper [Sat, 4 Nov 2017 18:10:03 +0000 (18:10 +0000)]
[X86] Teach EVEX->VEX pass to turn SHUFI32X4/SHUFF32X4/SHUFI64X/SHUFF64X2 into VPERM2F128/VPERM2I128.

This recovers some of the tests that were changed by r317403.

llvm-svn: 317410

6 years ago[AMDGPU] Remove hardcoded address space value from AMDGPULibFunc
Yaxun Liu [Sat, 4 Nov 2017 17:37:43 +0000 (17:37 +0000)]
[AMDGPU] Remove hardcoded address space value from AMDGPULibFunc

AMDGPULibFunc hardcodes address space values of the old address space mapping,
which causes invalid addrspacecast instructions and undefined functions in
APPSDK sample MonteCarloAsianDP.

This patch fixes that.

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

llvm-svn: 317409

6 years ago[LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.
Sean Fertile [Sat, 4 Nov 2017 17:04:39 +0000 (17:04 +0000)]
[LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.

Now that we have a way to mark GlobalValues as local we can use the symbol
resolutions that the linker plugin provides as part of lto/thinlto link
step to refine the compilers view on what symbols will end up being local.

Originally commited as r317374, but reverted in r317395 to update some missed
tests.

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

llvm-svn: 317408

6 years ago[CodeGen] add remquo to list of recognized library calls
Sanjay Patel [Sat, 4 Nov 2017 15:03:11 +0000 (15:03 +0000)]
[CodeGen] add remquo to list of recognized library calls

This is just an oversight because we already do recognize __builtin_remquo()
with the same signature.

http://en.cppreference.com/w/c/numeric/math/remquo
http://pubs.opengroup.org/onlinepubs/9699919799/functions/remquo.html

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

llvm-svn: 317407

6 years ago[ELF] - Stop using SectionKey for creating output sections.
George Rimar [Sat, 4 Nov 2017 09:11:27 +0000 (09:11 +0000)]
[ELF] - Stop using SectionKey for creating output sections.

Stop using SectionKey for creating output sections.

Initially SectionKey was designed because we merged section with
use of Flags and Alignment fields. Currently LLD merges them by name only,
except the case when -relocatable output is produced. In that case
we still merge sections only with the same flags and alignment.
There is probably no issue at all to stop using Flags and Alignment for -r and
just disable the merging in that case.

After doing that change we can get rid of using SectionKey. That is not only
simplifies the code, but also gives some perfomance boost.

I tried to link chrome and mozilla, results are next:
* chrome link time goes from 1,666750355s to 1,551585364s, that is about 7%.
* mozilla time changes from 3,210261947 to 3,153782940, or about 2%.

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

llvm-svn: 317406

6 years ago[ELF] - Fix error reporting with --strip-debug/--strip-all.
George Rimar [Sat, 4 Nov 2017 08:20:30 +0000 (08:20 +0000)]
[ELF] - Fix error reporting with --strip-debug/--strip-all.

Currently LLD tries to use information about functions and variables location
taking it from debug sections. When --strip-* is given we discard such sections
and that breaks error reporting.
Patch stops discarding such sections and just removes them from InputSections list.

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

llvm-svn: 317405

6 years agollvm/test/lit.cfg.py: Don't set the feature "llvm-64-bits" if -m32 is specified.
NAKAMURA Takumi [Sat, 4 Nov 2017 06:55:55 +0000 (06:55 +0000)]
llvm/test/lit.cfg.py: Don't set the feature "llvm-64-bits" if -m32 is specified.

FIXME: LLVM_BUILD_32_BITS should modify host_triple.
llvm-svn: 317404

6 years ago[X86] Teach shuffle lowering to use 256-bit SHUF128 when possible.
Craig Topper [Sat, 4 Nov 2017 06:44:47 +0000 (06:44 +0000)]
[X86] Teach shuffle lowering to use 256-bit SHUF128 when possible.

This allows masked operations to be used and allows the register allocator to use YMM16-31 if necessary.

As a follow up I'll look into teaching EVEX->VEX how to turn this back into PERM2X128 if any of the additional features don't work out.

llvm-svn: 317403

6 years agoCMake: Let LLVM_BUILD_32_BITS aware of large file.
NAKAMURA Takumi [Sat, 4 Nov 2017 06:03:29 +0000 (06:03 +0000)]
CMake: Let LLVM_BUILD_32_BITS aware of large file.

llvm-svn: 317402

6 years agollvm/test/Object/archive-SYM64-write.test: Delete large temp files. They are 8GiB...
NAKAMURA Takumi [Sat, 4 Nov 2017 06:00:11 +0000 (06:00 +0000)]
llvm/test/Object/archive-SYM64-write.test: Delete large temp files. They are 8GiB total.

llvm-svn: 317401

6 years agoCodeGenCXX: no default dllimport storage for mingw
Martell Malone [Sat, 4 Nov 2017 02:15:49 +0000 (02:15 +0000)]
CodeGenCXX: no default dllimport storage for mingw

GNU frontends don't have options like /MT, /MD
This fixes a few link error regressions with libc++ and libc++abi

Reviewers: rnk, mstorsjo, compnerd

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

llvm-svn: 317398

6 years ago[Driver] MinGW: Remove custom linker detection
Martell Malone [Sat, 4 Nov 2017 02:07:59 +0000 (02:07 +0000)]
[Driver] MinGW: Remove custom linker detection

This is a re-apply of rL313082 which was reverted in rL313088

In rL289668 the ability to specify the default linker at compile time
was added but because the MinGW driver used custom detection we could
not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER.

rL289668 added no test cases and the mingw driver was either overlooked
or purposefully skipped because it has some custom linker tests
Removing them here because they are covered by the generic case.

Reviewers: rnk

Differntial Revision: https://reviews.llvm.org/D37727

llvm-svn: 317397

6 years ago[ELF] Support expressions with -defsym option
Petr Hosek [Sat, 4 Nov 2017 02:03:58 +0000 (02:03 +0000)]
[ELF] Support expressions with -defsym option

Fixes PR34948.

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

llvm-svn: 317396

6 years agoRevert "[LTO][ThinLTO] Use the linker resolutions to mark global values ..."
Sean Fertile [Sat, 4 Nov 2017 01:54:20 +0000 (01:54 +0000)]
Revert "[LTO][ThinLTO] Use the linker resolutions to mark global values ..."

Changes more tests then expected on one of the build bots.
reverting to investigate.

This reverts https://llvm.org/svn/llvm-project/llvm/trunk@317374

llvm-svn: 317395

6 years agoUpdate ODR hashing tests
Richard Trieu [Sat, 4 Nov 2017 01:20:50 +0000 (01:20 +0000)]
Update ODR hashing tests

Add a mix of postive and negative tests to check that wrong Decls won't be
flagged in the diagnostic.  Split the check everything test and moved the
pieces closer to where the related tests are.

llvm-svn: 317394

6 years ago[CallSiteSplitting] clang-format my last commit. NFCI.
Davide Italiano [Sat, 4 Nov 2017 00:44:01 +0000 (00:44 +0000)]
[CallSiteSplitting] clang-format my last commit. NFCI.

Thanks to Rui for pointing out.

llvm-svn: 317393

6 years agoRename Body -> Sym.
Rui Ueyama [Sat, 4 Nov 2017 00:31:04 +0000 (00:31 +0000)]
Rename Body -> Sym.

This patch is mechanically created by

  sed -i -e s/Body/Sym/g lld/ELF/*.{cpp,h}

and clang-format-diff.

llvm-svn: 317392

6 years agoFix CMake definitions of tsan runtime to make it installed by "install-compiler-rt"
Mehdi Amini [Sat, 4 Nov 2017 00:07:20 +0000 (00:07 +0000)]
Fix CMake definitions of tsan runtime to make it installed by "install-compiler-rt"

Summary: The PARENT_TARGET was correctly set under APPLE but not under linux.

Reviewers: kubamracek, samsonov

Subscribers: dberris, mgorny, llvm-commits

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

llvm-svn: 317391

6 years ago[scudo] Rearrange #include order
Kostya Kortchinsky [Fri, 3 Nov 2017 23:48:25 +0000 (23:48 +0000)]
[scudo] Rearrange #include order

Summary:
To be compliant with https://llvm.org/docs/CodingStandards.html#include-style,
system headers have to come after local headers.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 317390

6 years ago[Sanitizers] Call NanoTime() conditionally.
Alex Shlyapnikov [Fri, 3 Nov 2017 23:31:00 +0000 (23:31 +0000)]
[Sanitizers] Call NanoTime() conditionally.

Summary:
Call NanoTime() in primary 64 bit allocator only when necessary,
otherwise the unwarranted syscall causes problems in sandbox environments.
ReleaseToOSIntervalMs() conditional allows them to turn the feature off
with allocator_release_to_os_interval_ms=-1 flag.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 317386

6 years ago[CallSiteSplitting] Silence GCC's -Wparentheses. NFCI.
Davide Italiano [Fri, 3 Nov 2017 23:03:38 +0000 (23:03 +0000)]
[CallSiteSplitting] Silence GCC's -Wparentheses. NFCI.

llvm-svn: 317385

6 years ago[COFF] Avoid "Body" as a local variable name.
Rui Ueyama [Fri, 3 Nov 2017 22:49:02 +0000 (22:49 +0000)]
[COFF] Avoid "Body" as a local variable name.

Since SymbolBody is gone, "Body" is not a good variable name.
This patch renames or eliminates them.

llvm-svn: 317384

6 years agoRename replaceBody -> replaceSymbol.
Rui Ueyama [Fri, 3 Nov 2017 22:48:47 +0000 (22:48 +0000)]
Rename replaceBody -> replaceSymbol.

llvm-svn: 317383

6 years ago[X86] Give unary PERMI priority over SHUF128 in lowerV8I64VectorShuffle to make it...
Craig Topper [Fri, 3 Nov 2017 22:48:13 +0000 (22:48 +0000)]
[X86] Give unary PERMI priority over SHUF128 in lowerV8I64VectorShuffle to make it possible to fold a load.

llvm-svn: 317382

6 years ago[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 3 Nov 2017 22:35:27 +0000 (22:35 +0000)]
[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 317381

6 years agoFix variable name.
Zachary Turner [Fri, 3 Nov 2017 22:33:49 +0000 (22:33 +0000)]
Fix variable name.

A mechanical rename caused an illegal name conflict between
a variable and a type, which was picked up by GCC.

llvm-svn: 317380

6 years agoMove TargetFrameLowering.h to CodeGen where it's implemented
David Blaikie [Fri, 3 Nov 2017 22:32:11 +0000 (22:32 +0000)]
Move TargetFrameLowering.h to CodeGen where it's implemented

This header already includes a CodeGen header and is implemented in
lib/CodeGen, so move the header there to match.

This fixes a link error with modular codegeneration builds - where a
header and its implementation are circularly dependent and so need to be
in the same library, not split between two like this.

llvm-svn: 317379

6 years agoRevert "[ELF] - Teach LLD to use information from .debug_str for error reporting."
Bob Haarman [Fri, 3 Nov 2017 22:23:19 +0000 (22:23 +0000)]
Revert "[ELF] - Teach LLD to use information from .debug_str for error reporting."

This reverts commit 00b7acb8f6c8a4663bb7c8396d217c210209b562.

It was causing some links to execute llvm_unreachable.

llvm-svn: 317378