platform/upstream/llvm.git
6 years ago[x86] Introduce the pconfig instruction
Gabor Buella [Tue, 8 May 2018 06:47:36 +0000 (06:47 +0000)]
[x86] Introduce the pconfig instruction

Reviewers: craig.topper, zvi

Reviewed By: craig.topper

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

llvm-svn: 331739

6 years ago[DebugInfo] Accept `S` in augmentation strings in CIE.
Fangrui Song [Tue, 8 May 2018 06:21:12 +0000 (06:21 +0000)]
[DebugInfo] Accept `S` in augmentation strings in CIE.

glibc libc.a(sigaction.o) compiled from sysdeps/unix/sysv/linux/x86_64/sigaction.c uses "zRS".

llvm-svn: 331738

6 years ago[asan] Fix bug introduced by r331647
Walter Lee [Tue, 8 May 2018 05:58:57 +0000 (05:58 +0000)]
[asan] Fix bug introduced by r331647

unmap_shadow_on_exit was inadvertently flipped for non-RTEMS.

llvm-svn: 331737

6 years ago[sanitizer] Add InternalMmapVector::swap
Vitaly Buka [Tue, 8 May 2018 04:57:08 +0000 (04:57 +0000)]
[sanitizer] Add InternalMmapVector::swap

llvm-svn: 331736

6 years ago[sanitizer] Fix error checking in ThreadLister
Vitaly Buka [Tue, 8 May 2018 04:56:57 +0000 (04:56 +0000)]
[sanitizer] Fix error checking in ThreadLister

llvm-svn: 331735

6 years agoRevert "[sanitizer] Be more accurate when calculating the previous instruction addres...
Igor Kudrin [Tue, 8 May 2018 04:39:00 +0000 (04:39 +0000)]
Revert "[sanitizer] Be more accurate when calculating the previous instruction address on ARM."

This reverts commit r331626 because it causes build bot failures:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/5069

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

llvm-svn: 331734

6 years agoReally test type lookup in TestCppTypeLookup.py
Frederic Riss [Tue, 8 May 2018 03:08:46 +0000 (03:08 +0000)]
Really test type lookup in TestCppTypeLookup.py

Summary:
... and fix one bug found this way. Currently, the test works not because
types are looked up correctly, but because by injecting local variables
we also materialize the types for Clang. If we disable the local variable
injection, then one check fails.

The reason of the failure is that FindTypes is run with max_matches==1
and this value is passed down to the symbol lookup functions. When the
search is performed only on the basename (like it's the case for an
entity defined in the root namespace), then the search will stop after
having found one match on the basename. But that match might be in a
namespace, we were really just looking up the basename in the accelerator
tables.

The solution is to not pass max_matches down, but to search without a
limit and let RemoveMismatchedTypes do its job afterwards. Note the
patch includes 2 hunks with the same change, but only the latter is
tested. I couldn't find a way to create a testcase for the other
branch of the if ('image lookup -t' allows me to get there, but it
only ever returns one type anyway).

Reviewers: clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 331719

6 years ago[MachineVerifier][GlobalISel] Verifying generic extends and truncates
Roman Tereshin [Tue, 8 May 2018 02:48:15 +0000 (02:48 +0000)]
[MachineVerifier][GlobalISel] Verifying generic extends and truncates

Making sure we don't truncate / extend pointers, don't try to change
vector topology or bitcast vectors to scalars or back, and most
importantly, don't extend to a smaller type or truncate to a large
one.

Reviewers: qcolombet t.p.northover aditya_nandakumar

Reviewed By: qcolombet

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 331718

6 years ago[CMake] Pass additional CMake flags in Fuchsia cache files
Petr Hosek [Tue, 8 May 2018 02:47:13 +0000 (02:47 +0000)]
[CMake] Pass additional CMake flags in Fuchsia cache files

This allows passing additional CMake flags to builtins and runtimes
build through Fuchsia cache files.

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

llvm-svn: 331717

6 years ago[C++2a] operator<=>: Fix incorrect use of Twine.
Eric Fiselier [Tue, 8 May 2018 02:28:47 +0000 (02:28 +0000)]
[C++2a] operator<=>: Fix incorrect use of Twine.

llvm-svn: 331713

6 years ago[MIRParser][GlobalISel] Parsing vector pointer types (<M x pA>)
Roman Tereshin [Tue, 8 May 2018 02:02:50 +0000 (02:02 +0000)]
[MIRParser][GlobalISel] Parsing vector pointer types (<M x pA>)

MIParser wasn't able to parse LLTs like `<4 x p0>`, fixing that.

Reviewers: qcolombet t.p.northover aditya_nandakumar

Reviewed By: qcolombet

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 331712

6 years ago[XRay][compiler-rt] Add llvm-mca assembler annotations for XRay (NFC)
Dean Michael Berris [Tue, 8 May 2018 01:57:51 +0000 (01:57 +0000)]
[XRay][compiler-rt] Add llvm-mca assembler annotations for XRay (NFC)

This change adds some assembler comments to facilitate analysis with
llvm-mca. In particular, we're interested in identifying and later
optimising (reducing) the cost of the key functions in the XRay
implementation using both static analysis (with llvm-mca, etc.) and
dynamic analysis (perf profiling, etc.) of microbenchmarks.

llvm-svn: 331711

6 years ago[dfsan] update the abilist for the sanitizer coverage; also remove the fuzz target...
Kostya Serebryany [Tue, 8 May 2018 01:52:40 +0000 (01:52 +0000)]
[dfsan] update the abilist for the sanitizer coverage; also remove the fuzz target from this list

llvm-svn: 331710

6 years ago[NewPM] Emit inliner NoDefinition missed optimization remark
Teresa Johnson [Tue, 8 May 2018 01:45:46 +0000 (01:45 +0000)]
[NewPM] Emit inliner NoDefinition missed optimization remark

Summary: Makes this consistent with the old PM.

Reviewers: eraman

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 331709

6 years agoAdd a CIE with length 0 unconditionally.
Fangrui Song [Tue, 8 May 2018 01:19:16 +0000 (01:19 +0000)]
Add a CIE with length 0 unconditionally.

Summary: This is not technically required, but glibc unwind-dw2-fde.c classify_object_over_fdes expects there is a CIE record length 0 as a terminator.

Reviewers: ruiu, espindola

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 331708

6 years ago[C++2a] Implement operator<=>: Address bugs and post-commit review comments after...
Eric Fiselier [Tue, 8 May 2018 00:52:19 +0000 (00:52 +0000)]
[C++2a] Implement operator<=>: Address bugs and post-commit review comments after r331677.

This patch addresses some mostly trivial post-commit review comments received
on r331677.

Additionally, this patch fixes an assertion in `getNarrowingKind` caused by
the use of an uninitialized value from `checkThreeWayNarrowingConversion`.

llvm-svn: 331707

6 years agoMove test input file into same directory as test. NFC
Richard Trieu [Tue, 8 May 2018 00:29:21 +0000 (00:29 +0000)]
Move test input file into same directory as test.  NFC

llvm-svn: 331706

6 years ago[WebAssembly] MC: Use existing MCSymbol.Index field rather than inventing extra mapping
Sam Clegg [Tue, 8 May 2018 00:08:21 +0000 (00:08 +0000)]
[WebAssembly] MC: Use existing MCSymbol.Index field rather than inventing extra mapping

MCSymbol has getIndex/setIndex which are implementation defined
and on other platforms are used to store the symbol table
index.  It makes sense to use this rather than invent a new
mapping.

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

llvm-svn: 331705

6 years ago[MC] ELFObjectWriter: Removing unneeded variable and cast
Sam Clegg [Mon, 7 May 2018 23:52:17 +0000 (23:52 +0000)]
[MC] ELFObjectWriter: Removing unneeded variable and cast

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

llvm-svn: 331704

6 years agoRename a local variable whose scope is very narrow. NFC.
Rui Ueyama [Mon, 7 May 2018 23:43:48 +0000 (23:43 +0000)]
Rename a local variable whose scope is very narrow. NFC.

llvm-svn: 331703

6 years agoRevert r330742: Let TableGen write output only if it changed, instead of doing so...
Chandler Carruth [Mon, 7 May 2018 23:41:48 +0000 (23:41 +0000)]
Revert r330742: Let TableGen write output only if it changed, instead of doing so in cmake.

This change causes us to re-run tablegen for every single target on
every single build. This is much, much worse than the problem being
fixed AFAICT.

On my system, it makes a clean rebuild of `llc` with nothing changed go
from .5s to over 8s. On systems with less parallelism, slower file
systems, or high process startup overhead this will be even more
extreme.

The only way I see this could be a win is in clean builds where we churn
the filesystem. But I think incremental rebuild is more important, and
so if we want to re-instate this, it needs to be done in a way that
doesn't trigger constant re-runs of tablegen.

llvm-svn: 331702

6 years ago[sanitizer] Simplify ThreadLister interface
Vitaly Buka [Mon, 7 May 2018 23:29:48 +0000 (23:29 +0000)]
[sanitizer] Simplify ThreadLister interface

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 331701

6 years agoImprove error message for --plugin-opt=thinlto-prefix-replace.
Rui Ueyama [Mon, 7 May 2018 23:24:25 +0000 (23:24 +0000)]
Improve error message for --plugin-opt=thinlto-prefix-replace.

llvm-svn: 331700

6 years agoRename Config::ThinLTOIndexOnlyObjectFiles -> Config::ThinLTOIndexOnlyArg.
Rui Ueyama [Mon, 7 May 2018 23:24:16 +0000 (23:24 +0000)]
Rename Config::ThinLTOIndexOnlyObjectFiles -> Config::ThinLTOIndexOnlyArg.

llvm-svn: 331699

6 years agoSplit BitcodeCompiler::init() into two functions. NFC.
Rui Ueyama [Mon, 7 May 2018 23:24:07 +0000 (23:24 +0000)]
Split BitcodeCompiler::init() into two functions. NFC.

Previously, code to initialize Backend and code to initialize Conf are
intermingled in init(), though they don't depend on each other.

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

llvm-svn: 331698

6 years agoFix failing codegen test on non-x86_64 platforms
Eric Fiselier [Mon, 7 May 2018 23:15:34 +0000 (23:15 +0000)]
Fix failing codegen test on non-x86_64 platforms

llvm-svn: 331697

6 years agoAdd support for thinlto option ( thinlto-emit-imports-files) to emit import files...
Rumeet Dhindsa [Mon, 7 May 2018 23:14:12 +0000 (23:14 +0000)]
Add support for thinlto option ( thinlto-emit-imports-files) to emit import files for thinlink.

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

llvm-svn: 331696

6 years agoFollow Up on [MachineVerifier][GlobalISel] NFC, Improving MO printing and refactoring...
Roman Tereshin [Mon, 7 May 2018 23:14:00 +0000 (23:14 +0000)]
Follow Up on [MachineVerifier][GlobalISel] NFC, Improving MO printing and refactoring visitMachineInstrBefore

Fixing accidentally broken CodeGen/X86/verifier-generic-types-1.mir test

llvm-svn: 331695

6 years ago[MachineVerifier][GlobalISel] Checking that generic instrs have LLTs on all vregs
Roman Tereshin [Mon, 7 May 2018 22:31:47 +0000 (22:31 +0000)]
[MachineVerifier][GlobalISel] Checking that generic instrs have LLTs on all vregs

Every generic machine instruction must have generic virtual registers
only, that is, have a low-level type attached to each operand.

Previously MachineVerifier would catch a type missing on an operand
only if the previous operand for the the same type index exists and
have a type attached to it and it will report it as a type mismatch.
This is incosistent behaviour and a misleading error message.

This commit makes sure MachineVerifier explicitly checks that the
types are there for every operand and if not provides a
straightforward error message.

Reviewers: qcolombet t.p.northover bogner ab

Reviewed By: qcolombet

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 331694

6 years ago[MachineVerifier][GlobalISel] NFC, Improving MO printing and refactoring visitMachine...
Roman Tereshin [Mon, 7 May 2018 22:31:12 +0000 (22:31 +0000)]
[MachineVerifier][GlobalISel] NFC, Improving MO printing and refactoring visitMachineInstrBefore

This is an NFC pre-commit for the following "Checking that generic
instrs have LLTs on all vregs" commit.

This overloads MachineOperand::print to make it possible to print LLTs
with standalone machine operands.

This also overloads MachineVerifier::print(...MachineOperand...) with
an optional LLT using the newly introduced MachineOperand::print
variant; no actual calls added.

This also refactors MachineVerifier::visitMachineInstrBefore in the
parts dealing with all generic instructions (checking Selected
property, LLTs, and phys regs).

llvm-svn: 331693

6 years agoPR37352: mangle numbering for decomposition declarations.
Richard Smith [Mon, 7 May 2018 22:23:38 +0000 (22:23 +0000)]
PR37352: mangle numbering for decomposition declarations.

In order to match our mangling scheme, use a different set of numbers for
decomposition declarations, and consider all binding names when forming the
numbering. This does not yet affect any mangled names we produce, because
local decomposition declarations can't yet have linkage, but a C++ standard
proposal to change that is currently being processed.

llvm-svn: 331692

6 years agoAMDGPU/GlobalISel: Don't try to lower hull shaders
Tom Stellard [Mon, 7 May 2018 22:17:54 +0000 (22:17 +0000)]
AMDGPU/GlobalISel: Don't try to lower hull shaders

Summary: The AMDGPU_HS calling convention is not supported yet.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 331691

6 years agoDo not call exit() directly from lld.
Rui Ueyama [Mon, 7 May 2018 22:11:34 +0000 (22:11 +0000)]
Do not call exit() directly from lld.

Our promise is that as long as there's no fatal error (i.e. broken
file is given to the linker), our main function returns to the caller.
So we can't use exit() in the regular code path.

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

llvm-svn: 331690

6 years agoRefactor ThinLTO-related code in BitcodeCompiler.cpp. NFC.
Rui Ueyama [Mon, 7 May 2018 22:11:24 +0000 (22:11 +0000)]
Refactor ThinLTO-related code in BitcodeCompiler.cpp. NFC.

Summary: Refactor ThinLTO-related code in BitcodeCompiler.cpp. NFC.

Reviewers: rdhindsa, espindola

Subscribers: emaste, inglorion, arichardson, llvm-commits, eraman

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

llvm-svn: 331689

6 years ago[NFC] Move 2 variable initialization from Ctor to member initializers.
Erich Keane [Mon, 7 May 2018 22:01:06 +0000 (22:01 +0000)]
[NFC] Move 2 variable initialization from Ctor to member initializers.

In response to dblaikie's suggestion on r331536, replace the two enum
typed variable initializers in the constructor with member initializers.

llvm-svn: 331688

6 years ago[tools] Add missing test dependency
Alexander Shaposhnikov [Mon, 7 May 2018 22:00:59 +0000 (22:00 +0000)]
[tools] Add missing test dependency

Caught by the build bots.

llvm-svn: 331687

6 years ago[lit, lldbsuite] Fixes for several tests LLDB tests for Python 3 or Windows
Stella Stamenova [Mon, 7 May 2018 21:57:00 +0000 (21:57 +0000)]
[lit, lldbsuite] Fixes for several tests LLDB tests for Python 3 or Windows

Summary:
In decorators.py, when opening streams, open them in text mode. In Py3, if they are not opened in text mode, the data is also expected to be binary, but we always use text data.
In TestLinuxCore, skip the tests that are not applicable on Windows
In the python api main.c, update the code to be compilable on Windows

Reviewers: asmith, zturner

Reviewed By: zturner

Subscribers: zturner

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

llvm-svn: 331686

6 years ago[DAGCombiner] Masked merge: enhance handling of 'andn' with immediates
Roman Lebedev [Mon, 7 May 2018 21:52:22 +0000 (21:52 +0000)]
[DAGCombiner] Masked merge: enhance handling of 'andn' with immediates

Summary:
Split off from D46031.

The previous patch, D46493, completely disabled unfolding in case of immediates.
But we can do better:
{F6120274} {F6120277}

https://rise4fun.com/Alive/xJS

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: andreadb, llvm-commits

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

llvm-svn: 331685

6 years ago[DagCombiner] Not all 'andn''s work with immediates.
Roman Lebedev [Mon, 7 May 2018 21:52:11 +0000 (21:52 +0000)]
[DagCombiner] Not all 'andn''s work with immediates.

Summary:
Split off from D46031.

In masked merge case, this degrades IPC by decreasing instruction count.
{F6108777}
The next patch should be able to recover and improve this.

This also affects the transform @spatel have added in D27489 / rL289738,
and the test coverage for X86 was missing.
But after i have added it, and looked at the changes in MCA, i'm somewhat confused.
{F6093591} {F6093592} {F6093593}
I'd say this regression is an improvement, since `IPC` increased in that case?

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: andreadb, llvm-commits, spatel

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

llvm-svn: 331684

6 years ago[X86] Use target feature defines in tests instead of defining our own flag on the...
Craig Topper [Mon, 7 May 2018 21:47:13 +0000 (21:47 +0000)]
[X86] Use target feature defines in tests instead of defining our own flag on the command line. NFCI

llvm-svn: 331683

6 years ago[X86] Make _mm256_gf2p8mul_epi8 require avx features since its 256 bits.
Craig Topper [Mon, 7 May 2018 21:47:11 +0000 (21:47 +0000)]
[X86] Make _mm256_gf2p8mul_epi8 require avx features since its 256 bits.

Without this we throw an error on the header file instead of the user code when the right features aren't enabled in clang.

Rename the other DEFAULT_FN_ATTRS defines to _Z for 512-bit since I used _Y for this case.

llvm-svn: 331682

6 years agoRelax a FileCheck pattern to make it pass on Windows.
Peter Collingbourne [Mon, 7 May 2018 21:40:53 +0000 (21:40 +0000)]
Relax a FileCheck pattern to make it pass on Windows.

Should fix Windows bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/16956

llvm-svn: 331681

6 years agoRemove explicit setting of the CFI jumptable section name, it does not appear
Dmitry Mikulin [Mon, 7 May 2018 21:30:15 +0000 (21:30 +0000)]
Remove explicit setting of the CFI jumptable section name, it does not appear
to be needed: jump table sections are created with .cfi.jumptable suffix. With
this change each jump table is placed in a separate section, which allows the
linker to re-order them.

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

llvm-svn: 331680

6 years agoTest Commit: fix a comment to be grammatically correct
Stella Stamenova [Mon, 7 May 2018 21:19:14 +0000 (21:19 +0000)]
Test Commit: fix a comment to be grammatically correct

llvm-svn: 331679

6 years ago[llvm-mca][x86] Remove addsubpd from SSE2 tests
Simon Pilgrim [Mon, 7 May 2018 21:10:48 +0000 (21:10 +0000)]
[llvm-mca][x86] Remove addsubpd from SSE2 tests

llvm-svn: 331678

6 years ago[C++2a] Implement operator<=> CodeGen and ExprConstant
Eric Fiselier [Mon, 7 May 2018 21:07:10 +0000 (21:07 +0000)]
[C++2a] Implement operator<=> CodeGen and ExprConstant

Summary:
This patch tackles long hanging fruit for the builtin operator<=> expressions. It is currently needs some cleanup before landing, but I want to get some initial feedback.

The main changes are:

* Lookup, build, and store the required standard library types and expressions in `ASTContext`. By storing them in ASTContext we don't need to store (and duplicate) the required expressions in the BinaryOperator AST nodes.

* Implement [expr.spaceship] checking, including diagnosing narrowing conversions.

* Implement `ExprConstant` for builtin spaceship operators.

* Implement builitin operator<=> support in `CodeGenAgg`. Initially I emitted the required comparisons using `ScalarExprEmitter::VisitBinaryOperator`, but this caused the operand expressions to be emitted once for every required cmp.

* Implement [builtin.over] with modifications to support the intent of P0946R0. See the note on `BuiltinOperatorOverloadBuilder::addThreeWayArithmeticOverloads` for more information about the workaround.

Reviewers: rsmith, aaron.ballman, majnemer, rnk, compnerd, rjmccall

Reviewed By: rjmccall

Subscribers: rjmccall, rsmith, aaron.ballman, junbuml, mgorny, cfe-commits

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

llvm-svn: 331677

6 years ago[tools] Adjust the lit config for llvm-strip
Alexander Shaposhnikov [Mon, 7 May 2018 21:07:01 +0000 (21:07 +0000)]
[tools] Adjust the lit config for llvm-strip

Caught by the build bots.

llvm-svn: 331676

6 years ago[llvm-rc] Fix build: missing 'override'.
Roman Lebedev [Mon, 7 May 2018 21:06:53 +0000 (21:06 +0000)]
[llvm-rc] Fix build: missing 'override'.

llvm-svn: 331675

6 years ago[CFI] Force LLVM to die if the implicit blacklist files cannot be found.
Peter Collingbourne [Mon, 7 May 2018 20:54:05 +0000 (20:54 +0000)]
[CFI] Force LLVM to die if the implicit blacklist files cannot be found.

Currently LLVM CFI tries to use an implicit blacklist file, currently
in /usr/lib64/clang/<version>/share. If the file is not there, LLVM
happily continues, which causes CFI to add checks to files/functions
that are known to fail, generating binaries that fail. This CL causes
LLVM to die (I hope) if it can't find these implicit blacklist files.

Patch by Caroline Tice!

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

llvm-svn: 331674

6 years agoCorrect warning on Float->Integer conversions.
Erich Keane [Mon, 7 May 2018 20:52:56 +0000 (20:52 +0000)]
Correct warning on Float->Integer conversions.

As identified and briefly discussed here:
https://bugs.llvm.org/show_bug.cgi?id=37305

Converting a floating point number to an integer type when
the integral part is out of the range of the integer type is
undefined behavior in C. Additionally, CodeGen emits an undef
in this situation.

HOWEVER, we've been giving a warning that says that the value is
changed. This patch corrects the warning to list that it is actually
undefined behavior.

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

llvm-svn: 331673

6 years ago[X86] Split WriteFAdd/WriteFCmp/WriteFMul schedule classes
Simon Pilgrim [Mon, 7 May 2018 20:52:53 +0000 (20:52 +0000)]
[X86] Split WriteFAdd/WriteFCmp/WriteFMul schedule classes

Split to support single/double for scalar, XMM and YMM/ZMM instructions - removing InstrRW overrides for these instructions.

Fixes Atom ADDSUBPD instruction and reclassifies VFPCLASS as WriteFCmp which is closer in behaviour.

llvm-svn: 331672

6 years agoAdd test to ensure lld writes linked files to linked objects file for ThinLTO Indexin...
Rumeet Dhindsa [Mon, 7 May 2018 20:28:02 +0000 (20:28 +0000)]
Add test to ensure lld writes linked files to linked objects file for ThinLTO Indexing Only option.

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

llvm-svn: 331671

6 years ago[llvm-rc] Implement the BITMAP resource type
Martin Storsjo [Mon, 7 May 2018 20:27:37 +0000 (20:27 +0000)]
[llvm-rc] Implement the BITMAP resource type

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

llvm-svn: 331670

6 years ago[llvm-rc] Allow optional commas between the string table index and value
Martin Storsjo [Mon, 7 May 2018 20:27:28 +0000 (20:27 +0000)]
[llvm-rc] Allow optional commas between the string table index and value

This form is even used in one of the examples at
https://msdn.microsoft.com/en-us/library/windows/desktop/aa381050(v=vs.85).aspx.

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

llvm-svn: 331669

6 years ago[llvm-rc] Exclude padding from sizes in versioninfo resources
Martin Storsjo [Mon, 7 May 2018 20:27:23 +0000 (20:27 +0000)]
[llvm-rc] Exclude padding from sizes in versioninfo resources

Normally when writing something that requires padding, we first
measure the length of the written payload data, then write
padding if necessary.

For a recursive structure like versioninfo, this means that the
padding is excluded from the size of the inner element, but
included in the size of the enclosing block.

Rc.exe excludes the final padding (but not the padding of earlier
children) from all levels of the hierarchy.

To achieve this, don't pad after each block or value, but only
before starting the next one. We still pad after completing the
toplevel versioninfo resource, so this won't affect other resource
types.

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

llvm-svn: 331668

6 years ago[llvm-rc] Fix alphabetical order of cases. NFC.
Martin Storsjo [Mon, 7 May 2018 20:27:15 +0000 (20:27 +0000)]
[llvm-rc] Fix alphabetical order of cases. NFC.

llvm-svn: 331667

6 years ago[Driver] Use -fuse-line-directives by default in MSVC mode
Martin Storsjo [Mon, 7 May 2018 20:26:09 +0000 (20:26 +0000)]
[Driver] Use -fuse-line-directives by default in MSVC mode

Don't use the GNU extension form of line markers in MSVC mode.

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

llvm-svn: 331666

6 years ago[SelectionDAG] Transfer DbgValues when casts are optimized in SelectionDAG::getNode
Aaron Smith [Mon, 7 May 2018 20:15:50 +0000 (20:15 +0000)]
[SelectionDAG] Transfer DbgValues when casts are optimized in SelectionDAG::getNode

Summary:
getNode optimizes (ext (trunc x)) to x and the dbgvalue node on trunc is lost. The fix calls transferDbgValues to add the dbgvalue to x.

Add DebugInfo/AArch64/dbg-value-i16.ll

Patch by Sejong Oh!

Reviewers: aprantl, javed.absar, llvm-commits, vsk

Reviewed By: aprantl, vsk

Subscribers: kristof.beyls, JDevlieghere, llvm-commits

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

llvm-svn: 331665

6 years ago[WebAssembly] Ensure all .debug_XXX section has proper symbol names
Sam Clegg [Mon, 7 May 2018 19:40:50 +0000 (19:40 +0000)]
[WebAssembly] Ensure all .debug_XXX section has proper symbol names

Updated wasm section symbols names to match section name, and ensure all
referenced sections will have a symbol (per DWARF spec v3, Figure 43)

Patch by Yury Delendik!

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

llvm-svn: 331664

6 years ago[tools] Introduce llvm-strip
Alexander Shaposhnikov [Mon, 7 May 2018 19:32:09 +0000 (19:32 +0000)]
[tools] Introduce llvm-strip

llvm-strip is supposed to be a drop-in replacement for binutils strip.
To start the ball rolling this diff adds the initial bits for llvm-strip,
more features will be added incrementally over time.

Test plan: make check-all

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

llvm-svn: 331663

6 years ago[sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC)
Kostya Kortchinsky [Mon, 7 May 2018 19:02:19 +0000 (19:02 +0000)]
[sanitizer] s/TestOnlyInit/Init for the allocator ByteMap (NFC)

Summary:
The `TestOnlyInit` function of `{Flat,TwoLevel}ByteMap` seems to be a misnomer
since the function is used outside of tests as well, namely in
`SizeClassAllocator32::Init`. Rename it to `Init` and update the callers.

Reviewers: alekseyshl, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 331662

6 years agoStatus updates for Rapperswil
Marshall Clow [Mon, 7 May 2018 18:59:04 +0000 (18:59 +0000)]
Status updates for Rapperswil

llvm-svn: 331661

6 years ago[llvm-mca] Avoid exposing index values in the MCA interfaces.
Matt Davis [Mon, 7 May 2018 18:29:15 +0000 (18:29 +0000)]
[llvm-mca] Avoid exposing index values in the MCA interfaces.

Summary:
This patch eliminates many places where we originally needed to  pass index
values to represent an instruction.  The index is still used as a key, in various parts of
MCA.  I'm  not comfortable eliminating the index just yet.    By burying the index in
the instruction, we can avoid exposing that value in many places.

Eventually, we should consider removing the Instructions list in the Backend
all together,   it's only used to hold and reclaim the memory for the allocated
Instruction instances.  Instead we could pass around a smart pointer.  But that's
a separate discussion/patch.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: javed.absar, tschuett, gbedwell, llvm-commits

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

llvm-svn: 331660

6 years ago[X86][AVX2] Tag VPMOVSX/VPMOVZX ymm instructions as WriteShuffle256
Simon Pilgrim [Mon, 7 May 2018 18:25:19 +0000 (18:25 +0000)]
[X86][AVX2] Tag VPMOVSX/VPMOVZX ymm instructions as WriteShuffle256

These are more like cross-lane shuffles than regular shuffles - we already do this for AVX512 equivalents.

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

llvm-svn: 331659

6 years agoDo not pass Config members to simplify function signature. NFC.
Rui Ueyama [Mon, 7 May 2018 17:59:52 +0000 (17:59 +0000)]
Do not pass Config members to simplify function signature. NFC.

llvm-svn: 331658

6 years agoParse --thinlto-prefix-replace early so that we don't need to parse it later. NFC.
Rui Ueyama [Mon, 7 May 2018 17:59:43 +0000 (17:59 +0000)]
Parse --thinlto-prefix-replace early so that we don't need to parse it later. NFC.

llvm-svn: 331657

6 years agoUse StringRef instead of `const std::string &`. NFC.
Rui Ueyama [Mon, 7 May 2018 17:59:34 +0000 (17:59 +0000)]
Use StringRef instead of `const std::string &`. NFC.

llvm-svn: 331656

6 years agoRefactor BitcodeCompiler::createLTO. NFC.
Rui Ueyama [Mon, 7 May 2018 17:46:28 +0000 (17:46 +0000)]
Refactor BitcodeCompiler::createLTO. NFC.

llvm-svn: 331655

6 years ago[OPENMP, NVPTX] Small test fix, NFC.
Alexey Bataev [Mon, 7 May 2018 17:38:13 +0000 (17:38 +0000)]
[OPENMP, NVPTX] Small test fix, NFC.

llvm-svn: 331654

6 years ago[Hexagon] Move clamping of extended operands directly to MC code emitter
Krzysztof Parzyszek [Mon, 7 May 2018 17:34:23 +0000 (17:34 +0000)]
[Hexagon] Move clamping of extended operands directly to MC code emitter

llvm-svn: 331653

6 years ago[OPENMP, NVPTX] Codegen for critical construct.
Alexey Bataev [Mon, 7 May 2018 17:23:05 +0000 (17:23 +0000)]
[OPENMP, NVPTX] Codegen for critical construct.

Added correct codegen for the critical construct on NVPTX devices.

llvm-svn: 331652

6 years agoFix explicit template parameter reporting for narrowing conversions
Erich Keane [Mon, 7 May 2018 17:05:20 +0000 (17:05 +0000)]
Fix explicit template parameter reporting for narrowing conversions

I found that explicit template parameters that caused a
narrowing integer conversion resulted in the incorrect parameter
being mentioned in the note (see test attached). This is because
the argument checking code doesn't check to see if it caused
SFINAE errors when checking the arguments, so instead of giving
up on the first error, it continues through the list. This
makes the error reporting pick up the last template param every time.

This patch checks these parameters on each argument and gives up
if there is an error. The result is that only the required amount
of arguments are checked, and that the 'Converted' array contains
only the successful arguments before the first failure, as the
calls seem to all expect.

llvm-svn: 331651

6 years ago[DAGCombine][NFC] Masked merge unfolding: comment: some tests are non-canonical
Roman Lebedev [Mon, 7 May 2018 16:42:47 +0000 (16:42 +0000)]
[DAGCombine][NFC] Masked merge unfolding: comment: some tests are non-canonical

As requested in https://reviews.llvm.org/D46494#inline-407282

llvm-svn: 331650

6 years ago[asan] Port asan_malloc_linux.cc to RTEMS
Walter Lee [Mon, 7 May 2018 16:39:09 +0000 (16:39 +0000)]
[asan] Port asan_malloc_linux.cc to RTEMS

We reuse the allocation interceptors as is.  RTEMS doesn't support
dlsyms.  However, it needs to handle memory allocation requests before
the ASan run-time has been initialized.  We use the dlsym alloc pool
for this purpose, and we increase its size to 4k to support this
usage.

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

llvm-svn: 331649

6 years ago[sanitizer] On RTEMS, avoid recursion when reporting Mmap failure
Walter Lee [Mon, 7 May 2018 16:38:45 +0000 (16:38 +0000)]
[sanitizer] On RTEMS, avoid recursion when reporting Mmap failure

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

llvm-svn: 331648

6 years ago[asan] Set flags appropriately for RTEMS
Walter Lee [Mon, 7 May 2018 16:38:20 +0000 (16:38 +0000)]
[asan] Set flags appropriately for RTEMS

Disable both unmap_shadow_on_exit and protect_shadow_gap.

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

llvm-svn: 331647

6 years ago[sanitizer] Add definitions for Myriad RTEMS platform
Walter Lee [Mon, 7 May 2018 16:37:55 +0000 (16:37 +0000)]
[sanitizer] Add definitions for Myriad RTEMS platform

Introduce two definitions to be used by the Myriad RTEMS port of the
ASan run-time: SANITIZER_MYRIAD2 for the platform and SANITIZER_RTEMS
for the OS.  We expect to use SANITIZER_MYRIAD2 to guard the portion
of the port corresponding to Myriad's unique memory map, and
SANITIZER_RTEMS for most of the rest.

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

llvm-svn: 331646

6 years ago[X86][Znver1] Remove WriteFMul/WriteFRcp InstRW overrides/aliases.
Simon Pilgrim [Mon, 7 May 2018 16:34:26 +0000 (16:34 +0000)]
[X86][Znver1] Remove WriteFMul/WriteFRcp InstRW overrides/aliases.

Fixes x87 schedules to more closely match Agner - AMD doesn't tend to "special case" x87 instructions as much as Intel.

llvm-svn: 331645

6 years ago[docs] Fix typos in the Clang User's Manual.
Joel Galenson [Mon, 7 May 2018 16:23:46 +0000 (16:23 +0000)]
[docs] Fix typos in the Clang User's Manual.

llvm-svn: 331644

6 years ago[X86] Split WriteFDiv schedule classes to support single/double scalar, XMM and YMM...
Simon Pilgrim [Mon, 7 May 2018 16:15:46 +0000 (16:15 +0000)]
[X86] Split WriteFDiv schedule classes to support single/double scalar, XMM and YMM/ZMM instructions.

This removes all InstrRW overrides for these instructions - some x87 overrides remain but most use default (and realistic) values.

llvm-svn: 331643

6 years ago[OPENMP, NVPTX] Added support for L2 parallelism.
Alexey Bataev [Mon, 7 May 2018 14:50:05 +0000 (14:50 +0000)]
[OPENMP, NVPTX] Added support for L2 parallelism.

Added initial codegen for level 2, 3 etc. parallelism. Currently, all
the second, the third etc. parallel regions will run sequentially.

llvm-svn: 331642

6 years ago[AMDGPU][Waitcnt] Remove the old waitcnt pass
Mark Searles [Mon, 7 May 2018 14:43:28 +0000 (14:43 +0000)]
[AMDGPU][Waitcnt] Remove the old waitcnt pass

Remove the old waitcnt pass ( si-insert-waits ), which is no longer maintained
and getting crufty

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

llvm-svn: 331641

6 years ago[mips] Improve handling of -fno-[pic/PIC] option
Aleksandar Beserminji [Mon, 7 May 2018 14:30:49 +0000 (14:30 +0000)]
[mips] Improve handling of -fno-[pic/PIC] option

In order to disable PIC and to match GCC behaviour, -mno-abicalls
option is neccessary. When -fno-[pic/PIC] is used witout -mno-abicalls,
warning is reported. An error is reported when -fno-pic or -fno-PIC is
used in combination with -mabicalls.

In this commit, test case is added.

Depends on D44381.

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

llvm-svn: 331640

6 years agoRevert "[mips] Improve handling of -fno-[pic/PIC] option"
Aleksandar Beserminji [Mon, 7 May 2018 14:28:42 +0000 (14:28 +0000)]
Revert "[mips] Improve handling of -fno-[pic/PIC] option"

This reverts commit r331636. Forgot to add the test case.

llvm-svn: 331639

6 years agoUpdate for Rapperswil
Marshall Clow [Mon, 7 May 2018 14:21:52 +0000 (14:21 +0000)]
Update for Rapperswil

llvm-svn: 331638

6 years agoFix "file ./a.out" and file "../a.out" so that is works after recent FileSpec normali...
Greg Clayton [Mon, 7 May 2018 14:21:04 +0000 (14:21 +0000)]
Fix "file ./a.out" and file "../a.out" so that is works after recent FileSpec normalization path changes.

Test coming soon, but I want to unbreak people.

llvm-svn: 331637

6 years ago[mips] Improve handling of -fno-[pic/PIC] option
Aleksandar Beserminji [Mon, 7 May 2018 14:19:54 +0000 (14:19 +0000)]
[mips] Improve handling of -fno-[pic/PIC] option

In order to disable PIC and to match GCC behaviour, -mno-abicalls
option is neccessary. When -fno-[pic/PIC] is used witout -mno-abicalls,
warning is reported. An error is reported when -fno-pic or -fno-PIC is
used in combination with -mabicalls.

Depends on D44381.

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

llvm-svn: 331636

6 years agoAdd option -verify-cfiinstrs to run verifier in CFIInstrInserter
Petar Jovanovic [Mon, 7 May 2018 14:09:33 +0000 (14:09 +0000)]
Add option -verify-cfiinstrs to run verifier in CFIInstrInserter

Instead of enabling it for non NDEBUG builds, use -verify-cfiinstrs to
run verifier in CFIInstrInserter. It defaults to false.

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

llvm-svn: 331635

6 years ago[NFC] Fix typo in variable name.
Clement Courbet [Mon, 7 May 2018 13:26:47 +0000 (13:26 +0000)]
[NFC] Fix typo in variable name.

llvm-svn: 331634

6 years ago[AMDGPU] Don't force WQM for DS op
Tim Renouf [Mon, 7 May 2018 13:21:26 +0000 (13:21 +0000)]
[AMDGPU] Don't force WQM for DS op

Summary:
Previously, all DS ops forced WQM in a pixel shader. That was a hack to
allow for graphics frontends using ds_swizzle to implement explicit
derivatives, on SI/CI at least where DPP is not available. But it forced
WQM for _any_ DS op.

With this commit, DS ops no longer force WQM. Both graphics frontends
(Mesa and LLPC) need to change to issue an explicit llvm.amdgcn.wqm
intrinsic call when calculating explicit derivatives.

The required Mesa change is: "amd/common: use llvm.amdgcn.wqm for
explicit derivatives".

Subscribers: qcolombet, arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: I9b745b626fa91bbd66456e6cf41ee07eeea42f81
llvm-svn: 331633

6 years ago[OMPT] Fix thread_num for implicit_task_end callbacks in nested parallel regions
Joachim Protze [Mon, 7 May 2018 12:42:21 +0000 (12:42 +0000)]
[OMPT] Fix thread_num for implicit_task_end callbacks in nested parallel regions

implicit_task_end callbacks in nested parallel regions did not always give the
correct thread_num, since the inner parallel region may have already been
finalized.
Now, the thread_num is stored at the beginning of the implicit task and
retrieved at the end, whenever necessary.

A testcase was added as well.

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

llvm-svn: 331632

6 years ago[OMPT] Add api_calls_misc.c testcase and rename api_calls.c testcase
Joachim Protze [Mon, 7 May 2018 12:42:15 +0000 (12:42 +0000)]
[OMPT] Add api_calls_misc.c testcase and rename api_calls.c testcase

The api_calls_misc.c testcase tests the following api calls:

ompt_get_callback()
ompt_get_state()
ompt_enumerate_states()
ompt_enumerate_mutex_impls()
These have not been tested previously.

The api_calls.c testcase has been renamed to api_calls_places.c because it only tests api calls that are related to places.

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

llvm-svn: 331631

6 years ago[ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentSco...
Peter Szecsi [Mon, 7 May 2018 12:08:27 +0000 (12:08 +0000)]
[ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

The visit callback implementations for the 3 C++ AST Node added to the ASTImporter.

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

llvm-svn: 331630

6 years ago[X86] Split WriteFRcp/WriteFRsqrt/WriteFSqrt schedule classes
Simon Pilgrim [Mon, 7 May 2018 11:50:44 +0000 (11:50 +0000)]
[X86] Split WriteFRcp/WriteFRsqrt/WriteFSqrt schedule classes

WriteFRcp/WriteFRsqrt are split to support scalar, XMM and YMM/ZMM instructions.

WriteFSqrt is split into single/double/long-double sizes and scalar, XMM, YMM and ZMM instructions.

This removes all InstrRW overrides for these instructions.

NOTE: There were a couple of typos in the Znver1 model - notably a 1cy throughput for SQRT that is highly unlikely and doesn't tally with Agner.

NOTE: I had to add Agner's numbers for several targets for WriteFSqrt80.
llvm-svn: 331629

6 years agoSkip unreachable blocks for CFIInstrInserter verify
Petar Jovanovic [Mon, 7 May 2018 11:47:48 +0000 (11:47 +0000)]
Skip unreachable blocks for CFIInstrInserter verify

Iterate only through reachable blocks. This finetunes r330706 and
it resolves build issue reported by Craig Topper.

llvm-svn: 331628

6 years ago[SystemZ] Bugfix for MVCLoop CC clobbering.
Jonas Paulsson [Mon, 7 May 2018 10:48:43 +0000 (10:48 +0000)]
[SystemZ]  Bugfix for MVCLoop CC clobbering.

MVCLoop clobbers CC (since it emits a compare/branch), but this was not
modelled.

Review: Ulrich Weigand
llvm-svn: 331627

6 years ago[sanitizer] Be more accurate when calculating the previous instruction address on...
Igor Kudrin [Mon, 7 May 2018 10:07:22 +0000 (10:07 +0000)]
[sanitizer] Be more accurate when calculating the previous instruction address on ARM.

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

llvm-svn: 331626

6 years ago[InstCombine][NFC] Add tests for one more masked merge pattern.
Roman Lebedev [Mon, 7 May 2018 09:42:45 +0000 (09:42 +0000)]
[InstCombine][NFC] Add tests for one more masked merge pattern.

This pattern came up in D46494.
I'm pretty sure we want to canonicalize it from
(x | ~m) & (y &  m)
to
(x &  m) | (y & ~m)

https://rise4fun.com/Alive/TEM

llvm-svn: 331625

6 years agoRe-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results."
Clement Courbet [Mon, 7 May 2018 09:09:48 +0000 (09:09 +0000)]
Re-land r331622 "[llvm-exegesis] Add a library to cluster benchmark results."

Add missing move.

llvm-svn: 331624

6 years agoRevert r331622 "[llvm-exegesis] Add a library to cluster benchmark results."
Clement Courbet [Mon, 7 May 2018 08:30:18 +0000 (08:30 +0000)]
Revert r331622 "[llvm-exegesis] Add a library to cluster benchmark results."

Breaks build over llvm::Error copy construction.

llvm-svn: 331623