platform/upstream/llvm.git
5 years ago[CMake] Add a missing case of TO_CMAKE_PATH
Martin Storsjo [Tue, 27 Nov 2018 09:23:15 +0000 (09:23 +0000)]
[CMake] Add a missing case of TO_CMAKE_PATH

This fixes building sanitizers for mingw natively.

llvm-svn: 347646

5 years ago[COFF] Generate a codeview build id signature for MinGW even when not creating a PDB
Martin Storsjo [Tue, 27 Nov 2018 09:20:55 +0000 (09:20 +0000)]
[COFF] Generate a codeview build id signature for MinGW even when not creating a PDB

GNU ld, which doesn't generate PDBs, can optionally generate a
build id by passing the --build-id option. LLD's MinGW frontend knows
about this option but ignores it, as I had falsely assumed that LLD
already generated build IDs even in those cases.

If debug info is requested and no PDB path is set, generate a
build id signature as a hash of the binary itself. This allows
associating a binary to a minidump, even if debug info isn't
written in PDB form by the linker.

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

llvm-svn: 347645

5 years agoAdd missing REQUIRES: asserts
Max Kazantsev [Tue, 27 Nov 2018 07:51:18 +0000 (07:51 +0000)]
Add missing REQUIRES: asserts

llvm-svn: 347644

5 years ago[X86] Add test cases for vector shifts of v2i32/v2i16/v4i16/v2i8/v4i8/v8i8 with promo...
Craig Topper [Tue, 27 Nov 2018 07:20:19 +0000 (07:20 +0000)]
[X86] Add test cases for vector shifts of v2i32/v2i16/v4i16/v2i8/v4i8/v8i8 with promotion legalization and widening legalization. NFC

llvm-svn: 347643

5 years ago[X86] Use getUnpackl/getUnpackh instead of directly creating UNPCKL/UNPCKH nodes.
Craig Topper [Tue, 27 Nov 2018 06:24:56 +0000 (06:24 +0000)]
[X86] Use getUnpackl/getUnpackh instead of directly creating UNPCKL/UNPCKH nodes.

llvm-svn: 347642

5 years ago[LoopSimplifyCFG] Turn on term folding after underlying bug fixed
Max Kazantsev [Tue, 27 Nov 2018 06:19:42 +0000 (06:19 +0000)]
[LoopSimplifyCFG] Turn on term folding after underlying bug fixed

llvm-svn: 347641

5 years ago[LoopSimplifyCFG] Fix corner case with duplicating successors
Max Kazantsev [Tue, 27 Nov 2018 06:17:21 +0000 (06:17 +0000)]
[LoopSimplifyCFG] Fix corner case with duplicating successors

It fixes a bug that doesn't update Phi inputs of the only live successor that
is in the list of block's successors more than once.

Thanks @uabelho for finding this.

Differential Revision: https://reviews.llvm.org/D54849
Reviewed By: anna

llvm-svn: 347640

5 years ago[gn build] Merge r347530 to gn.
Nico Weber [Tue, 27 Nov 2018 06:04:49 +0000 (06:04 +0000)]
[gn build] Merge r347530 to gn.

llvm-svn: 347639

5 years agoMove a file I forgot to move in r347636.
Nico Weber [Tue, 27 Nov 2018 05:49:08 +0000 (05:49 +0000)]
Move a file I forgot to move in r347636.

llvm-svn: 347638

5 years agoAdd support for the Dylan language to ClangASTContext
Bruce Mitchener [Tue, 27 Nov 2018 05:37:27 +0000 (05:37 +0000)]
Add support for the Dylan language to ClangASTContext

Summary:
This change adds eLanguageTypeDylan to the set of languages supported
by ClangASTContext. Debug info generated by the Open Dylan compiler's
LLVM back-end was designed to be compatible with C debug info.

Patch by Peter Housel.

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: brucem, lldb-commits, aprantl

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

llvm-svn: 347637

5 years ago[gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build file for...
Nico Weber [Tue, 27 Nov 2018 05:19:17 +0000 (05:19 +0000)]
[gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build file for llvm/lib/Support.

The comments at the top of
llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn and
llvm/utils/gn/build/write_cmake_config.py should explain the main bits
happening in this patch. The main parts here are that these headers are
generated at build time, not gn time, and that currently they don't do any
actual feature checks but just hardcode most things based on the current OS,
which seems to work well enough. If this stops being enough, the feature checks
should each be their own action writing the result to somewhere, and the config
write step should depend on those checks (so that they can run in parallel and
as part of the build) -- utils/llvm/gn/README.rst already has some more words
on that in "Philosophy".

(write_cmake_config.py is also going to be used to write clang's
clang/include/clang/Config/config.h)

This also adds a few files for linking to system libraries in a consistent way
if needed in llvm/utils/gn/build/libs (and moves pthread to that model).0

I'm also adding llvm/utils/gn/secondary/llvm/lib/Target/targets.gni in this
patch because $native_arch is needed for writing llvm-config.h -- the rest of
it will be used later, when the build files for llvm/lib/Target get added. That
file describes how to select which archs to build.

As a demo, also add a build file for llvm-undname and make it the default build
target (it depends on everything that can currently be built).

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

llvm-svn: 347636

5 years ago[clangd] NFC: Prefer `isa<>` to `dyn_cast<>` to do the checking.
Henry Wong [Tue, 27 Nov 2018 04:27:00 +0000 (04:27 +0000)]
[clangd] NFC: Prefer `isa<>` to `dyn_cast<>` to do the checking.

Summary: Prefer `isa<>` to `dyn_cast<>` when there only need a checking.

Reviewers: ilya-biryukov, MaskRay

Reviewed By: ilya-biryukov, MaskRay

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits, MTC

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

llvm-svn: 347635

5 years ago[docs] UBSan and ASan are supported on Windows
Reid Kleckner [Tue, 27 Nov 2018 03:55:15 +0000 (03:55 +0000)]
[docs] UBSan and ASan are supported on Windows

Also fix a bullet list.

Fixes PR39775

llvm-svn: 347633

5 years ago[X86] Prevent DAG combine from folding a bitcast from vXi1 to iX with a store on...
Craig Topper [Tue, 27 Nov 2018 02:57:27 +0000 (02:57 +0000)]
[X86] Prevent DAG combine from folding a bitcast from vXi1 to iX with a store on pre-AVX512 targets.

If we fold the bitcast into the store we'll end up creating a truncating store to vXi1 that will get scalarized. Instead allow the bitcast to be turned into a movmsk.

We probably need to do something if the store itself is a vXi1 type, but I'll leave that til a testcase appears.

llvm-svn: 347632

5 years ago[X86] Add a bunch of test cases for storing a scalar bitcasted from a vXi1 type.
Craig Topper [Tue, 27 Nov 2018 02:57:23 +0000 (02:57 +0000)]
[X86] Add a bunch of test cases for storing a scalar bitcasted from a vXi1 type.

Currently a store combine will absorb the bitcast before our combine that turns bitcasts into movmsk gets a chance to run. This results in a store being created with a vXi1 type. Type legalization then promotes the input type and makes this a truncating store. Then we badly scalarize this store.

Currently we avoid this on v8i1->i8 bitcasts due to an incompletely qualified(per the original intention) check in isLoadBitCastBeneficial. An easy fix is to disable this for all vXi1->iX bitcasts on pre-avx512 targets. We'll still generate terrible code if the IR explicitly contains a store of vXi1 without a bitcast. We could probably solve that by just turning all stores of vXi1 into (store (iX (bitcast))) as an early DAG combine.

llvm-svn: 347631

5 years agoRevert r347627 "[MS] Push fewer DeclContexts for delayed template parsing"
Reid Kleckner [Tue, 27 Nov 2018 02:54:17 +0000 (02:54 +0000)]
Revert r347627 "[MS] Push fewer DeclContexts for delayed template parsing"

It broke the Windows self-host:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/1799/steps/stage%202%20build/logs/stdio

I can build
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachinePostDominators.cpp.obj to
repro.

llvm-svn: 347630

5 years ago[analyzer][PlistMacroExpansion] Part 3.: Macro arguments are expanded
Kristof Umann [Tue, 27 Nov 2018 02:28:23 +0000 (02:28 +0000)]
[analyzer][PlistMacroExpansion] Part 3.: Macro arguments are expanded

This part focuses on expanding macro arguments.

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

llvm-svn: 347629

5 years agoRevert "[clang][slh] add attribute for speculative load hardening"
Zola Bridges [Tue, 27 Nov 2018 02:22:00 +0000 (02:22 +0000)]
Revert "[clang][slh] add attribute for speculative load hardening"

until I figure out why the build is failing or timing out

***************************

Summary:
The prior diff had to be reverted because there were two tests
that failed. I updated the two tests in this diff

clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/SemaCXX/attr-speculative-load-hardening.cpp

LLVM IR already has an attribute for speculative_load_hardening. Before
this commit, when a user passed the -mspeculative-load-hardening flag to
Clang, every function would have this attribute added to it. This Clang
attribute will allow users to opt into SLH on a function by function
basis.

This can be applied to functions and Objective C methods.

Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman

Subscribers: llvm-commits

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

This reverts commit a5b3c232d1e3613f23efbc3960f8e23ea70f2a79.
(r347617)

llvm-svn: 347628

5 years ago[MS] Push fewer DeclContexts for delayed template parsing
Reid Kleckner [Tue, 27 Nov 2018 02:21:51 +0000 (02:21 +0000)]
[MS] Push fewer DeclContexts for delayed template parsing

Only push the outermost record as a DeclContext when parsing a function
body. See the comments in Sema::getContainingDC about the way the parser
pushes contexts. This is intended to match the behavior the parser
normally displays where it parses all method bodies from all nested
classes at the end of the outermost class, when all nested classes are
complete.

Fixes PR38460.

llvm-svn: 347627

5 years ago[stack-safety] Update comment
Vitaly Buka [Tue, 27 Nov 2018 01:56:44 +0000 (01:56 +0000)]
[stack-safety] Update comment

llvm-svn: 347626

5 years ago[stack-safety] Fix and uncomment assert
Vitaly Buka [Tue, 27 Nov 2018 01:56:35 +0000 (01:56 +0000)]
[stack-safety] Fix and uncomment assert

llvm-svn: 347625

5 years ago[stack-safety] Fix build on gcc 5.4
Vitaly Buka [Tue, 27 Nov 2018 01:56:26 +0000 (01:56 +0000)]
[stack-safety] Fix build on gcc 5.4

llvm-svn: 347624

5 years ago[COFF] Add exported functions to gfids table for /guard:cf
Reid Kleckner [Tue, 27 Nov 2018 01:50:17 +0000 (01:50 +0000)]
[COFF] Add exported functions to gfids table for /guard:cf

Summary:
MSVC does this, and we should to.

The .gfids table is a table of RVAs, so it's impossible for a DLL to
indicate that an imported symbol is address taken. Therefore, exports
appear to be listed as address taken by the DLL that exports them.

This fixes an issue that Firefox ran into here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1485016#c12

In Firefox, the export directive came from a .def file, but we need to
do this for any kind of export.

Reviewers: dmajor, hans, amccarth, alex

Subscribers: llvm-commits

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

llvm-svn: 347623

5 years agoFix filtering of sanitizer_common unittest architectures on Darwin.
Kuba Mracek [Tue, 27 Nov 2018 01:37:08 +0000 (01:37 +0000)]
Fix filtering of sanitizer_common unittest architectures on Darwin.

llvm-svn: 347622

5 years ago[WebAssembly] Remove `using` statements from header files. NFC.
Sam Clegg [Tue, 27 Nov 2018 01:08:16 +0000 (01:08 +0000)]
[WebAssembly] Remove `using` statements from header files. NFC.

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

llvm-svn: 347621

5 years ago[Common] Threads: use function_ref instead of std::function
Fangrui Song [Tue, 27 Nov 2018 00:26:50 +0000 (00:26 +0000)]
[Common] Threads: use function_ref instead of std::function

The benefits are:

a) Performance (very minor): it removes a heap allocation of the std::function constructor (template<class F> function(F f))
b) Clarity: it suggests that the callable's lifetime should end after the callee returns. Such callback is widely used in llvm. lld also uses it a lot.

Reviewers: ruiu, rnk, pcc

Reviewed By: ruiu

Subscribers: llvm-commits

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

llvm-svn: 347620

5 years agoRevert "[CMake] Streamline code signing for debugserver and pass entitlements to...
Davide Italiano [Tue, 27 Nov 2018 00:25:49 +0000 (00:25 +0000)]
Revert "[CMake] Streamline code signing for debugserver and pass entitlements to extended llvm_codesign"

It breaks the lldb cmake bots.

llvm-svn: 347619

5 years ago[InstCombine] add tests for rotate/bswap equality; NFC
Sanjay Patel [Tue, 27 Nov 2018 00:08:21 +0000 (00:08 +0000)]
[InstCombine] add tests for rotate/bswap equality; NFC

llvm-svn: 347618

5 years ago[clang][slh] add attribute for speculative load hardening
Zola Bridges [Tue, 27 Nov 2018 00:03:44 +0000 (00:03 +0000)]
[clang][slh] add attribute for speculative load hardening

Summary:
The prior diff had to be reverted because there were two tests
that failed. I updated the two tests in this diff

clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/SemaCXX/attr-speculative-load-hardening.cpp

----- Summary from Previous Diff (Still Accurate) -----

LLVM IR already has an attribute for speculative_load_hardening. Before
this commit, when a user passed the -mspeculative-load-hardening flag to
Clang, every function would have this attribute added to it. This Clang
attribute will allow users to opt into SLH on a function by function basis.

This can be applied to functions and Objective C methods.

Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman

Subscribers: llvm-commits

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

llvm-svn: 347617

5 years agoFix debug build break
JF Bastien [Mon, 26 Nov 2018 23:48:47 +0000 (23:48 +0000)]
Fix debug build break

Comment out an assertion from D54543 which failed with error: no member named 'Range' in '(anonymous namespace)::PassAsArgInfo'.

llvm-svn: 347616

5 years ago[FileSystem] Ignore nanoseconds when comparing oso_mod_time
Jonas Devlieghere [Mon, 26 Nov 2018 23:40:52 +0000 (23:40 +0000)]
[FileSystem] Ignore nanoseconds when comparing oso_mod_time

After a recent change in LLVM the TimePoint encoding become more
precise, exceeding the precision of the TimePoint obtained from the
DebugMap. This patch adds a flag to the GetModificationTime helper in
the FileSystem to return the modification time with less precision.

Thanks to Davide for bisecting this failure on the LLDB bots.

llvm-svn: 347615

5 years agoNotify the linker when a TU compiled with split-stack has a function without a prologue.
Sterling Augustine [Mon, 26 Nov 2018 23:26:31 +0000 (23:26 +0000)]
Notify the linker when a TU compiled with split-stack has a function without a prologue.

More context here: https://go-review.googlesource.com/c/go/+/148819/

llvm-svn: 347614

5 years agoRemove trailing empty line
Vitaly Buka [Mon, 26 Nov 2018 23:17:52 +0000 (23:17 +0000)]
Remove trailing empty line

llvm-svn: 347613

5 years ago[stack-safety] Analysis documentation
Vitaly Buka [Mon, 26 Nov 2018 23:16:07 +0000 (23:16 +0000)]
[stack-safety] Analysis documentation

Summary:
Basic documentation of the Stack Safety Analysis.
It will be improved during review and upstream of an implementation.

Reviewers: kcc, eugenis, vlad.tsyrklevich, glider

Reviewed By: vlad.tsyrklevich

Subscribers: arphaman, llvm-commits

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

llvm-svn: 347612

5 years ago[stack-safety] Inter-Procedural Analysis implementation
Vitaly Buka [Mon, 26 Nov 2018 23:05:58 +0000 (23:05 +0000)]
[stack-safety] Inter-Procedural Analysis implementation

Summary:
IPA is implemented as module pass which produce map from Function or Alias to
StackSafetyInfo for a single function.

From prototype by Evgenii Stepanov and Vlad Tsyrklevich.

Reviewers: eugenis, vlad.tsyrklevich, pcc, glider

Subscribers: hiraditya, mgrang, llvm-commits

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

llvm-svn: 347611

5 years ago[stack-safety] Empty local passes for Stack Safety Global Analysis
Vitaly Buka [Mon, 26 Nov 2018 23:05:48 +0000 (23:05 +0000)]
[stack-safety] Empty local passes for Stack Safety Global Analysis

Reviewers: eugenis, vlad.tsyrklevich

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 347610

5 years agoAArch64ISelLowering: Remove a return-of-assignment to allow NRVO
David Blaikie [Mon, 26 Nov 2018 22:57:18 +0000 (22:57 +0000)]
AArch64ISelLowering: Remove a return-of-assignment to allow NRVO

Patch by Arthur O'Dwyer!

llvm-svn: 347609

5 years agoRemove duplicate _LIBCPP_INLINE_VISIBILITY attributes.
Eric Fiselier [Mon, 26 Nov 2018 22:51:35 +0000 (22:51 +0000)]
Remove duplicate _LIBCPP_INLINE_VISIBILITY attributes.

This attribute should appear only on the first declaration. This
patch cleans up <string> by removing the attribute on redeclarations.

llvm-svn: 347608

5 years agoAdd new passes to X86 pipeline tests
Mircea Trofin [Mon, 26 Nov 2018 22:49:17 +0000 (22:49 +0000)]
Add new passes to X86 pipeline tests

Summary: Fixes test failures introduced by rL347596.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

llvm-svn: 347607

5 years ago[X86] Add dependency from X86 to ProfileData after rL347596
Fangrui Song [Mon, 26 Nov 2018 22:16:19 +0000 (22:16 +0000)]
[X86] Add dependency from X86 to ProfileData after rL347596

llvm-svn: 347606

5 years ago[ICP] Remove incompatible attributes at indirect-call promoted callsites.
Xin Tong [Mon, 26 Nov 2018 22:03:52 +0000 (22:03 +0000)]
[ICP] Remove incompatible attributes at indirect-call promoted callsites.

Summary:
Removing ncompatible attributes at indirect-call promoted callsites, not removing it results in
at least a IR verification error.

Reviewers: davidxl, xur, mssimpso

Subscribers: llvm-commits

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

llvm-svn: 347605

5 years ago[InstCombine] add helper function to reduce code duplication; NFC
Sanjay Patel [Mon, 26 Nov 2018 22:00:41 +0000 (22:00 +0000)]
[InstCombine] add helper function to reduce code duplication; NFC

llvm-svn: 347604

5 years ago[stack-safety] Local analysis implementation
Vitaly Buka [Mon, 26 Nov 2018 21:57:59 +0000 (21:57 +0000)]
[stack-safety] Local analysis implementation

Summary:
Analysis produces StackSafetyInfo which contains information with how allocas
and parameters were used in functions.

From prototype by Evgenii Stepanov and  Vlad Tsyrklevich.

Reviewers: eugenis, vlad.tsyrklevich, pcc, glider

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 347603

5 years ago[stack-safety] Empty local passes for Stack Safety Local Analysis
Vitaly Buka [Mon, 26 Nov 2018 21:57:47 +0000 (21:57 +0000)]
[stack-safety] Empty local passes for Stack Safety Local Analysis

Reviewers: eugenis, vlad.tsyrklevich

Subscribers: mgorny, hiraditya, llvm-commits

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

llvm-svn: 347602

5 years ago[cfi] Help sanstats to find binary if they are not at the original location
Vitaly Buka [Mon, 26 Nov 2018 21:48:55 +0000 (21:48 +0000)]
[cfi] Help sanstats to find binary if they are not at the original location

Summary:
By default sanstats search binaries at the same location where they were when
stats was collected. Sometime you can not print report immediately or you need
to move post-processing to another workstation. To support this use-case when
original binary is missing sanstats will fall-back to directory with sanstats
file.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 347601

5 years ago[cfi] Make sanstats print address of the check
Vitaly Buka [Mon, 26 Nov 2018 21:48:45 +0000 (21:48 +0000)]
[cfi] Make sanstats print address of the check

Summary: Help with off-line symbolization or other type debugging.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 347600

5 years ago[AArch64] Refactor the scheduling predicates (3/3) (NFC)
Evandro Menezes [Mon, 26 Nov 2018 21:47:46 +0000 (21:47 +0000)]
[AArch64] Refactor the scheduling predicates (3/3) (NFC)

Refactor the scheduling predicates based on `MCInstPredicate`.  In this
case, `AArch64InstrInfo::hasExtendedReg()`.

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

llvm-svn: 347599

5 years ago[AArch64] Refactor the scheduling predicates (2/3) (NFC)
Evandro Menezes [Mon, 26 Nov 2018 21:47:41 +0000 (21:47 +0000)]
[AArch64] Refactor the scheduling predicates (2/3) (NFC)

Refactor the scheduling predicates based on `MCInstPredicate`.  In this
case, `AArch64InstrInfo::hasShiftedReg()`.

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

llvm-svn: 347598

5 years ago[AArch64] Refactor the scheduling predicates (1/3) (NFC)
Evandro Menezes [Mon, 26 Nov 2018 21:47:28 +0000 (21:47 +0000)]
[AArch64] Refactor the scheduling predicates (1/3) (NFC)

Refactor the scheduling predicates based on `MCInstPredicate`.  In this
case, `AArch64InstrInfo::isScaledAddr()`

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

llvm-svn: 347597

5 years agoSupport for inserting profile-directed cache prefetches
Mircea Trofin [Mon, 26 Nov 2018 21:36:18 +0000 (21:36 +0000)]
Support for inserting profile-directed cache prefetches

Summary:
Support for profile-driven cache prefetching (X86)

This change is part of a larger system, consisting of a cache prefetches recommender, create_llvm_prof (https://github.com/google/autofdo), and LLVM.

A proof of concept recommender is DynamoRIO's cache miss analyzer. It processes memory access traces obtained from a running binary and identifies patterns in cache misses. Based on them, it produces a csv file with recommendations. The expectation is that, by leveraging such recommendations, we can reduce the amount of clock cycles spent waiting for data from memory. A microbenchmark based on the DynamoRIO analyzer is available as a proof of concept: https://goo.gl/6TM2Xp.

The recommender makes prefetch recommendations in terms of:

* the binary offset of an instruction with a memory operand;
* a delta;
* and a type (nta, t0, t1, t2)

meaning: a prefetch of that type should be inserted right before the instrution at that binary offset, and the prefetch should be for an address delta away from the memory address the instruction will access.

For example:

0x400ab2,64,nta

and assuming the instruction at 0x400ab2 is:

movzbl (%rbx,%rdx,1),%edx

means that the recommender determined it would be beneficial for a prefetchnta instruction to be inserted right before this instruction, as such:

prefetchnta 0x40(%rbx,%rdx,1)
movzbl (%rbx, %rdx, 1), %edx

The workflow for prefetch cache instrumentation is as follows (the proof of concept script details these steps as well):

1. build binary, making sure -gmlt -fdebug-info-for-profiling is passed. The latter option will enable the X86DiscriminateMemOps pass, which ensures instructions with memory operands are uniquely identifiable (this causes ~2% size increase in total binary size due to the additional debug information).

2. collect memory traces, run analysis to obtain recommendations (see above-referenced DynamoRIO demo as a proof of concept).

3. use create_llvm_prof to convert recommendations to reference insertion locations in terms of debug info locations.

4. rebuild binary, using the exact same set of arguments used initially, to which -mllvm -prefetch-hints-file=<file> needs to be added, using the afdo file obtained at step 3.

Note that if sample profiling feedback-driven optimization is also desired, that happens before step 1 above. In this case, the sample profile afdo file that was used to produce the binary at step 1 must also be included in step 4.

The data needed by the compiler in order to identify prefetch insertion points is very similar to what is needed for sample profiles. For this reason, and given that the overall approach (memory tracing-based cache recommendation mechanisms) is under active development, we use the afdo format as a syntax for capturing this information. We avoid confusing semantics with sample profile afdo data by feeding the two types of information to the compiler through separate files and compiler flags. Should the approach prove successful, we can investigate improvements to this encoding mechanism.

Reviewers: davidxl, wmi, craig.topper

Reviewed By: davidxl, wmi, craig.topper

Subscribers: davide, danielcdh, mgorny, aprantl, eraman, JDevlieghere, llvm-commits

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

llvm-svn: 347596

5 years agoAMDGPU: Record SGPR spills when restoring too
Matt Arsenault [Mon, 26 Nov 2018 21:28:40 +0000 (21:28 +0000)]
AMDGPU: Record SGPR spills when restoring too

It's possible in some cases to have a restore present
without a corresponding spill. Due to an apparent bug
in D54366 <https://reviews.llvm.org/D54366>, only the
restore for a register was emitted. It's probably
always a bug for this to happen, but due to how SGPR
spilling is implemented, this makes the issues appear
worse than it is.

llvm-svn: 347595

5 years agoELF: ICF: Include contents of referenced sections in initial partitioning hash. NFCI.
Peter Collingbourne [Mon, 26 Nov 2018 21:15:47 +0000 (21:15 +0000)]
ELF: ICF: Include contents of referenced sections in initial partitioning hash. NFCI.

On my machine this reduced median link time of lld-speed-test/chrome
from 2.68s to 2.41s. It also reduces link time of Chrome for Android
with a prototype compiler change that causes the compiler to create
large numbers of identical (modulo relocations) sections from >15
minutes to a few seconds.

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

llvm-svn: 347594

5 years ago[LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use SplitVecOp_TruncateHelper...
Craig Topper [Mon, 26 Nov 2018 21:12:39 +0000 (21:12 +0000)]
[LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use SplitVecOp_TruncateHelper for FP_TO_SINT/UINT.

SplitVecOp_TruncateHelper tries to promote the result type while splitting FP_TO_SINT/UINT. It then concatenates the result and introduces a truncate to the original result type. But it does this without inserting the AssertZExt/AssertSExt that the regular result type promotion would insert. Nor does it turn FP_TO_UINT into FP_TO_SINT the way normal result type promotion for these operations does. This is bad on X86 which doesn't support FP_TO_SINT until AVX512.

This patch disables the use of SplitVecOp_TruncateHelper for these operations and just lets normal promotion handle it. I've tweaked a couple things in X86ISelLowering to avoid a few obvious regressions there. I believe all the changes on X86 are improvements. The other targets look neutral.

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

llvm-svn: 347593

5 years ago[ThinLTO] Consolidate cache key computation between new/old LTO APIs
Teresa Johnson [Mon, 26 Nov 2018 20:40:37 +0000 (20:40 +0000)]
[ThinLTO] Consolidate cache key computation between new/old LTO APIs

Summary:
The old legacy LTO API had a separate cache key computation, which was
a subset of the cache key computation in the new LTO API (from what I
can tell this is largely just because certain features such as CFI,
dsoLocal, etc are only utilized via the new LTO API). However, having
separate computations is unnecessary (much of the code is duplicated),
and can lead to bugs when adding new optimizations if both cache
computation algorithms aren't updated properly - it's much easier to
maintain if we have a single facility.

This patch refactors the old LTO API code to use the cache key
computation from the new LTO API. To do this, we set up an lto::Config
object and fill in the fields that the old LTO was hashing (the others
will just use the defaults).

There are two notable changes:
- I added a Freestanding flag to the LTO Config. Currently this is only
used by the legacy LTO API. In the patch that added it (D30791) I had
asked about adding it to the new LTO API, but it looks like that was not
addressed. This should probably be discussed as a follow up to this
change, as it is orthogonal.
- The legacy LTO API had some code that was hashing the GUID of all
preserved symbols defined in the module. I looked back at the history of
this (which was added with the original hashing in the legacy LTO API in
D18494), and there is a comment in the review thread that it was added
in preparation for future internalization. We now do the internalization
of course, and that is handled in the new LTO API cache key computation
by hashing the recorded linkage type of all defined globals. Therefore I
didn't try to move over and keep the preserved symbols handling.

Reviewers: steven_wu, pcc

Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, dang, llvm-commits

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

llvm-svn: 347592

5 years ago[SelectionDAG] Teach BaseIndexOffset::match to unwrap the base after looking through...
Craig Topper [Mon, 26 Nov 2018 20:16:33 +0000 (20:16 +0000)]
[SelectionDAG] Teach BaseIndexOffset::match to unwrap the base after looking through an add/or

We might find a target specific node that needs to be unwrapped after we look through an add/or. Otherwise we get inconsistent results if one pointer is just X86WrapperRIP and the other is (add X86WrapperRIP, C)

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

llvm-svn: 347591

5 years ago[X86] Add test case for D54818
Craig Topper [Mon, 26 Nov 2018 20:16:31 +0000 (20:16 +0000)]
[X86] Add test case for D54818

llvm-svn: 347590

5 years agoAdd basic_string::__resize_default_init (from P1072)
Eric Fiselier [Mon, 26 Nov 2018 20:15:38 +0000 (20:15 +0000)]
Add basic_string::__resize_default_init (from P1072)

This patch adds an implementation of __resize_default_init as
described in P1072R2. Additionally, it uses it in filesystem to
demonstrate its intended utility.

Once P1072 lands, or if it changes it's interface, I will adjust
the internal libc++ implementation to match.

llvm-svn: 347589

5 years agoRevert "[clang][slh] add attribute for speculative load hardening"
Zola Bridges [Mon, 26 Nov 2018 20:11:18 +0000 (20:11 +0000)]
Revert "[clang][slh] add attribute for speculative load hardening"

This reverts commit 801eaf91221ba6dd6996b29ff82659ad6359e885.

llvm-svn: 347588

5 years ago[COFF] ICF: use parallelForEach{,N}
Fangrui Song [Mon, 26 Nov 2018 20:07:07 +0000 (20:07 +0000)]
[COFF] ICF: use parallelForEach{,N}

Summary: They have an additional `ThreadsEnabled` check, which does not matter much.

Reviewers: pcc, ruiu, rnk

Reviewed By: ruiu

Subscribers: llvm-commits

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

llvm-svn: 347587

5 years ago[clang][slh] add attribute for speculative load hardening
Zola Bridges [Mon, 26 Nov 2018 19:41:14 +0000 (19:41 +0000)]
[clang][slh] add attribute for speculative load hardening

Summary:
LLVM IR already has an attribute for speculative_load_hardening. Before
this commit, when a user passed the -mspeculative-load-hardening flag to
Clang, every function would have this attribute added to it. This Clang
attribute will allow users to opt into SLH on a function by function basis.

This can be applied to functions and Objective C methods.

Reviewers: chandlerc, echristo

Subscribers: llvm-commits

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

llvm-svn: 347586

5 years ago[libcxx] Fix XFAILs for aligned allocation tests
Louis Dionne [Mon, 26 Nov 2018 19:30:08 +0000 (19:30 +0000)]
[libcxx] Fix XFAILs for aligned allocation tests

In r339743, I marked several aligned allocation tests as downright
unsupported on macosx in an attempt to unbreak the build. It turns
out that marking them as unuspported whenever we're on OS X is way
too coarse grained. This commit marks the tests as XFAIL with more
granularity.

llvm-svn: 347585

5 years ago[CodeGen] Support custom format of stack maps
Than McIntosh [Mon, 26 Nov 2018 18:43:48 +0000 (18:43 +0000)]
[CodeGen] Support custom format of stack maps

Summary:
Add a hook to the GCMetadataPrinter for emitting stack maps in
custom format. The hook will be called at stack map generation
time. The default stack map format is used if there is no hook.

For this to be useful a few data structures and accessors are
exposed from the StackMaps class, so the custom printer can
access the stack map data.

This patch authored by Cherry Zhang <cherryyz@google.com>.

Reviewers: thanm, apilipenko, reames

Reviewed By: reames

Subscribers: reames, apilipenko, nemanjai, javed.absar, kbarton, jsji, llvm-commits

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

llvm-svn: 347584

5 years ago[OPENMP][NVPTX]Emit default locations with the correct Exec|Runtime
Alexey Bataev [Mon, 26 Nov 2018 18:37:09 +0000 (18:37 +0000)]
[OPENMP][NVPTX]Emit default locations with the correct Exec|Runtime
modes.

If the region is inside target|teams|distribute region, we can emit the
locations with the correct info for execution mode and runtime mode.
Patch adds this ability to the NVPTX codegen to help the optimizer to
produce better code.

llvm-svn: 347583

5 years ago[clang][slh] Forward mSLH only to Clang CC1
Zola Bridges [Mon, 26 Nov 2018 18:13:31 +0000 (18:13 +0000)]
[clang][slh] Forward mSLH only to Clang CC1

Summary:
-mno-speculative-load-hardening isn't a cc1 option, therefore,
before this change:

clang -mno-speculative-load-hardening hello.cpp

would have the following error:

error: unknown argument: '-mno-speculative-load-hardening'

This change will only ever forward -mspeculative-load-hardening
which is a CC1 option based on which flag was passed to clang.

Also added a test that uses this option that fails if an error like the
above is ever thrown.

Thank you ericwf for help debugging and fixing this error.

Reviewers: chandlerc, EricWF

Subscribers: llvm-commits

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

llvm-svn: 347582

5 years agoDelete dead code introduced in r347354.
Erich Keane [Mon, 26 Nov 2018 17:51:27 +0000 (17:51 +0000)]
Delete dead code introduced in r347354.

ParentTy is never used other than an assignment, and since it is a
pointer, there is no side effect. Some versions of GCC notice and warn
on this.

Change-Id: I37dc1a18c7b58040419afb803621de13d8904a8f
llvm-svn: 347581

5 years ago[libcxx] Fix XFAIL for aligned deallocation test with trunk Clang
Louis Dionne [Mon, 26 Nov 2018 17:47:16 +0000 (17:47 +0000)]
[libcxx] Fix XFAIL for aligned deallocation test with trunk Clang

The test was marked as failing whenever the deployment target was 10.12
or older, but in reality the test passes when the deployment target is
10.12 on recent Clangs. This happens because only older clangs do not
honor the -faligned-allocation flag, which disables any availability
error related to aligned allocation support, regardless of the
deployment target.

llvm-svn: 347580

5 years ago[lit] Fully qualify lit_config to avoid runtime crashes.
Davide Italiano [Mon, 26 Nov 2018 17:39:20 +0000 (17:39 +0000)]
[lit] Fully qualify lit_config to avoid runtime crashes.

llvm-svn: 347579

5 years ago[Cmake] Add missing dependency to `count`.
Davide Italiano [Mon, 26 Nov 2018 17:30:28 +0000 (17:30 +0000)]
[Cmake] Add missing dependency to `count`.

llvm-svn: 347578

5 years ago[NFC] Replace magic numbers with CodeGenOpt enums
Sam Parker [Mon, 26 Nov 2018 17:26:49 +0000 (17:26 +0000)]
[NFC] Replace magic numbers with CodeGenOpt enums

Use enum values from llvm/Support/CodeGen.h for the optimisation
levels in CompilerInvocation.

llvm-svn: 347577

5 years agoAMDGPU: Cleanup / relax tests for future changes
Matt Arsenault [Mon, 26 Nov 2018 17:17:07 +0000 (17:17 +0000)]
AMDGPU: Cleanup / relax tests for future changes

llvm-svn: 347576

5 years ago[ASTImporter] Set MustBuildLookupTable on PrimaryContext
Gabor Marton [Mon, 26 Nov 2018 17:09:50 +0000 (17:09 +0000)]
[ASTImporter] Set MustBuildLookupTable on PrimaryContext

Summary: SetMustBuildLookupTable() must always be called on a primary context.

Reviewers: labath, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411

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

llvm-svn: 347575

5 years ago[clangd] Do not drop diagnostics from macros
Ilya Biryukov [Mon, 26 Nov 2018 17:05:13 +0000 (17:05 +0000)]
[clangd] Do not drop diagnostics from macros

if they still end up being in the main file.

llvm-svn: 347574

5 years agoAMDGPU: Don't optimize exec masks at -O0
Matt Arsenault [Mon, 26 Nov 2018 17:02:02 +0000 (17:02 +0000)]
AMDGPU: Don't optimize exec masks at -O0

llvm-svn: 347573

5 years agoAMDGPU: Only add implicit super-reg def for first subreg
Matt Arsenault [Mon, 26 Nov 2018 17:02:01 +0000 (17:02 +0000)]
AMDGPU: Only add implicit super-reg def for first subreg

llvm-svn: 347572

5 years ago[AArch64] Add aarch64_vector_pcs function attribute to Clang
Sander de Smalen [Mon, 26 Nov 2018 16:38:37 +0000 (16:38 +0000)]
[AArch64] Add aarch64_vector_pcs function attribute to Clang

This is the Clang patch to complement the following LLVM patches:
  https://reviews.llvm.org/D51477
  https://reviews.llvm.org/D51479

More information describing the vector ABI and procedure call standard
can be found here:

https://developer.arm.com/products/software-development-tools/\
                          hpc/arm-compiler-for-hpc/vector-function-abi

Patch by Kerry McLaughlin.

Reviewed By: rjmccall

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

llvm-svn: 347571

5 years ago[clang-tidy] Improving narrowing conversions
Guillaume Chatelet [Mon, 26 Nov 2018 16:25:55 +0000 (16:25 +0000)]
[clang-tidy] Improving narrowing conversions

Summary:
Newly flagged narrowing conversions:
 - integer to narrower signed integer (this is compiler implementation defined),
 - integer - floating point narrowing conversions,
 - floating point - integer narrowing conversions,
 - constants with narrowing conversions (even in ternary operator).

Reviewers: hokein, alexfh, aaron.ballman, JonasToth

Reviewed By: aaron.ballman, JonasToth

Subscribers: lebedev.ri, courbet, nemanjai, xazax.hun, kbarton, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 347570

5 years ago[CodeGen] Take SPAdj into account for STATEPOINT liveness args
Than McIntosh [Mon, 26 Nov 2018 16:16:09 +0000 (16:16 +0000)]
[CodeGen] Take SPAdj into account for STATEPOINT liveness args

Summary:
STATEPOINT records its args' locations on stack relative to SP.
If the SP is changed, take that into account.

This patch authored by Cherry Zhang <cherryyz@google.com>.

Reviewers: thanm, reames

Reviewed By: reames

Subscribers: reames, llvm-commits

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

llvm-svn: 347569

5 years ago[libcxx] Use a type that is always an aggregate in variant's tests
Louis Dionne [Mon, 26 Nov 2018 16:14:56 +0000 (16:14 +0000)]
[libcxx] Use a type that is always an aggregate in variant's tests

Summary:
In PR39232, we noticed that some variant tests started failing in C++2a mode
with recent Clangs, because the rules for literal types changed in C++2a. As
a result, a temporary fix was checked in (enabling the test only in C++17).

This commit is what I believe should be the long term fix: I removed the
tests that checked constexpr default-constructibility with a weird type
from the tests for index() and valueless_by_exception(), and instead I
added tests for those using an obviously literal type in the test for the
default constructor.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, arphaman, libcxx-commits, rsmith

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

llvm-svn: 347568

5 years ago[clangd] Enable auto-index behind a flag.
Sam McCall [Mon, 26 Nov 2018 16:00:11 +0000 (16:00 +0000)]
[clangd] Enable auto-index behind a flag.

Summary:
Ownership and configuration:
The auto-index (background index) is maintained by ClangdServer, like Dynamic.
(This means ClangdServer will be able to enqueue preamble indexing in future).
For now it's enabled by a simple boolean flag in ClangdServer::Options, but
we probably want to eventually allow injecting the storage strategy.

New 'sync' command:
In order to meaningfully test the integration (not just unit-test components)
we need a way for tests to ensure the asynchronous index reads/writes occur
before a certain point.
Because these tests and assertions are few, I think exposing an explicit "sync"
command for use in tests is simpler than allowing threading to be completely
disabled in the background index (as we do for TUScheduler).

Bugs:
I fixed a couple of trivial bugs I found while testing, but there's one I can't.
JSONCompilationDatabase::getAllFiles() may return relative paths, and currently
we trigger an assertion that assumes they are absolute.
There's no efficient way to resolve them (you have to retrieve the corresponding
command and then resolve against its directory property). In general I think
this behavior is broken and we should fix it in JSONCompilationDatabase and
require CompilationDatabase::getAllFiles() to be absolute.

Reviewers: kadircet

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 347567

5 years ago[clangd] Fix compilation of IndexBenchmark
Ilya Biryukov [Mon, 26 Nov 2018 15:58:29 +0000 (15:58 +0000)]
[clangd] Fix compilation of IndexBenchmark

llvm-svn: 347566

5 years agoRemove an unnecessary file; NFC.
Aaron Ballman [Mon, 26 Nov 2018 15:54:36 +0000 (15:54 +0000)]
Remove an unnecessary file; NFC.

This source file has not been needed since r346522 and was triggering diagnostics in MSVC about an object file which exports no public symbols (LNK4221).

llvm-svn: 347565

5 years ago[ASTImporter][Structural Eq] Check for isBeingDefined
Gabor Marton [Mon, 26 Nov 2018 15:54:08 +0000 (15:54 +0000)]
[ASTImporter][Structural Eq] Check for isBeingDefined

Summary:
If one definition is currently being defined, we do not compare for
equality and we assume that the decls are equal.

Reviewers: a_sidorin, a.sidorin, shafik

Reviewed By: a_sidorin

Subscribers: gamesh411, shafik, rnkovacs, dkrupp, Szelethus, cfe-commits

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

llvm-svn: 347564

5 years ago[clangd] Fix use-after-free with expected types in indexing
Ilya Biryukov [Mon, 26 Nov 2018 15:52:16 +0000 (15:52 +0000)]
[clangd] Fix use-after-free with expected types in indexing

llvm-svn: 347563

5 years ago[clangd] Add type boosting in code completion
Ilya Biryukov [Mon, 26 Nov 2018 15:38:01 +0000 (15:38 +0000)]
[clangd] Add type boosting in code completion

Reviewers: sammccall, ioeric

Reviewed By: sammccall

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347562

5 years ago[DemandedBits] Add support for funnel shifts
Nikita Popov [Mon, 26 Nov 2018 15:36:57 +0000 (15:36 +0000)]
[DemandedBits] Add support for funnel shifts

Add support for funnel shifts to the DemandedBits analysis. The
demanded bits of the first two operands can be determined if the
shift amount is constant. The demanded bits of the third operand
(shift amount) can be determined if the bitwidth is a power of two.

This is basically the same functionality as implemented in D54869
and D54478, but for DemandedBits rather than InstCombine.

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

llvm-svn: 347561

5 years ago[clangd] Collect and store expected types in the index
Ilya Biryukov [Mon, 26 Nov 2018 15:29:14 +0000 (15:29 +0000)]
[clangd] Collect and store expected types in the index

Summary:
And add a hidden option to control whether the types are collected.
For experiments, will be removed when expected types implementation
is stabilized.

The index size is almost unchanged, e.g. the YAML index for all clangd
sources increased from 53MB to 54MB.

Reviewers: ioeric, sammccall

Reviewed By: sammccall

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347560

5 years ago[clangd] Initial implementation of expected types
Ilya Biryukov [Mon, 26 Nov 2018 15:25:20 +0000 (15:25 +0000)]
[clangd] Initial implementation of expected types

Summary:
Provides facilities to model the C++ conversion rules without the AST.
The introduced representation can be stored in the index and used to
implement type-based ranking improvements for index-based completions.

Reviewers: sammccall, ioeric

Reviewed By: sammccall

Subscribers: malaperle, mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347559

5 years ago[Index] Expose USR generation for types
Ilya Biryukov [Mon, 26 Nov 2018 15:24:48 +0000 (15:24 +0000)]
[Index] Expose USR generation for types

Summary: Used in clangd.

Reviewers: sammccall, ioeric

Reviewed By: sammccall

Subscribers: kadircet, cfe-commits

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

llvm-svn: 347558

5 years ago[x86] promote all multiply i8 by constant to i32
Sanjay Patel [Mon, 26 Nov 2018 15:22:30 +0000 (15:22 +0000)]
[x86] promote all multiply i8 by constant to i32

We have these 2 "isDesirable" promotion hooks (I'm not sure why we need both of them, but that's
independent of this patch), and we can adjust them to promote "mul i8 X, C" to i32. Then, all of
our existing LEA and other multiply expansion magic happens as it would for i32 ops.

Some of the test diffs show that we could end up with an actual 32-bit mul instruction here
because we choose not to expand to simpler ops. That instruction could be slower depending on the
subtarget. On the plus side, this means we don't need a separate instruction to load the constant
operand and possibly an extra instruction to move the result. If we need to tune mul i32 further,
we could add a later transform that tries to shrink it back to i8 based on subtarget timing.

I did not bother to duplicate all of the 32-bit test file RUNs and target settings that exist to
test whether LEA expansion is cheap or not. The diffs here assume a default target, so that means
LEA is generally cheap.

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

llvm-svn: 347557

5 years ago[PowerPC] Vector load/store builtins overstate alignment of pointers
Nemanja Ivanovic [Mon, 26 Nov 2018 14:35:38 +0000 (14:35 +0000)]
[PowerPC] Vector load/store builtins overstate alignment of pointers

A number of builtins in altivec.h load/store vectors from pointers to scalar
types. Currently they just cast the pointer to a vector pointer, but expressions
like that have the alignment of the target type. Of course, the input pointer
did not have that alignment so this triggers UBSan (and rightly so).

This resolves https://bugs.llvm.org/show_bug.cgi?id=39704

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

llvm-svn: 347556

5 years agoCreate a diagnostic group for warn_call_to_pure_virtual_member_function_from_ctor_dto...
Sylvestre Ledru [Mon, 26 Nov 2018 14:29:48 +0000 (14:29 +0000)]
Create a diagnostic group for warn_call_to_pure_virtual_member_function_from_ctor_dtor, so it can be turned into an error using Werror

Summary: Patch by Arnaud Bienner

Reviewers: davide, rsmith, jkorous

Reviewed By: jkorous

Subscribers: jkorous, sylvestre.ledru, cfe-commits

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

llvm-svn: 347555

5 years ago[clangd] Fix missing include from r347538 - fix windows buildbots
Sam McCall [Mon, 26 Nov 2018 13:35:02 +0000 (13:35 +0000)]
[clangd] Fix missing include from r347538 - fix windows buildbots

llvm-svn: 347554

5 years ago[LLD][ELF] - Added a test for "-image-base: number expected" message. NFC.
George Rimar [Mon, 26 Nov 2018 13:15:57 +0000 (13:15 +0000)]
[LLD][ELF] - Added a test for "-image-base: number expected" message. NFC.

We had no such test.

llvm-svn: 347553

5 years ago[LLD][ELF] - Add a test for "unbalanced --push-state/--pop-state" error.
George Rimar [Mon, 26 Nov 2018 12:58:51 +0000 (12:58 +0000)]
[LLD][ELF] - Add a test for "unbalanced --push-state/--pop-state" error.

We had no such test.

llvm-svn: 347552

5 years ago[clang-tidy] No warning for auto new expression in smart check
Haojian Wu [Mon, 26 Nov 2018 12:42:08 +0000 (12:42 +0000)]
[clang-tidy] No warning for auto new expression in smart check

Summary: The fix for `auto` new expression is illegal.

Reviewers: aaron.ballman

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 347551

5 years ago[LLD][ELF] - Add a check for --split-stack-adjust-size error message. NFCI.
George Rimar [Mon, 26 Nov 2018 12:36:16 +0000 (12:36 +0000)]
[LLD][ELF] - Add a check for --split-stack-adjust-size error message. NFCI.

"--split-stack-adjust-size: size must be >= 0" message
was never tested.

llvm-svn: 347550

5 years ago[LLD][ELF] - Do not crash when parsing the -defsym option from a error state.
George Rimar [Mon, 26 Nov 2018 12:29:56 +0000 (12:29 +0000)]
[LLD][ELF] - Do not crash when parsing the -defsym option from a error state.

When we are in a error state, script parser will not parse the -defsym
expression and hence will not tokenize it. Then ScriptLexer::Pos will be 0
and LLD will assert and crash here:

MemoryBufferRef ScriptLexer::getCurrentMB() {
  assert(!MBs.empty() && Pos > 0); // Bang !

Solution - stop parsing the defsym in a error state. That is consistent
with the regular case (when we parse the linker script).

llvm-svn: 347549

5 years ago[clangd] Tune down scope boost for global scope
Eric Liu [Mon, 26 Nov 2018 12:12:01 +0000 (12:12 +0000)]
[clangd] Tune down scope boost for global scope

Summary:
This improves cross-namespace completions and has ignorable
impact on other completion types.

Metrics
```
==================================================================================================
                                        OVERALL (excl. CROSS_NAMESPACE)
==================================================================================================
  Total measurements: 109367 (-6)
  All measurements:
MRR: 68.11 (+0.04) Top-1: 58.59% (+0.03%) Top-5: 80.00% (+0.01%) Top-100: 95.92% (-0.02%)
  Full identifiers:
MRR: 98.35 (+0.09) Top-1: 97.87% (+0.17%) Top-5: 98.96% (+0.01%) Top-100: 99.03% (+0.00%)
  Filter length 0-5:
MRR:      23.20 (+0.05) 58.72 (+0.01) 70.16 (-0.03) 73.44 (+0.03) 76.24 (+0.00) 80.79 (+0.14)
Top-1:    11.90% (+0.03%) 45.07% (+0.03%) 58.49% (-0.05%) 62.44% (-0.02%) 66.31% (-0.05%) 72.10% (+0.07%)
Top-5:    35.51% (+0.08%) 76.94% (-0.01%) 85.10% (-0.13%) 87.40% (-0.02%) 88.65% (+0.01%) 91.84% (+0.17%)
Top-100:  83.25% (-0.02%) 96.61% (-0.15%) 98.15% (-0.02%) 98.43% (-0.01%) 98.53% (+0.01%) 98.66% (+0.02%)

==================================================================================================
                                        CROSS_NAMESPACE
==================================================================================================
  Total measurements: 17702 (+27)
  All measurements:
MRR: 28.12 (+3.26) Top-1: 21.07% (+2.70%) Top-5: 35.11% (+4.48%) Top-100: 74.31% (+1.02%)
  Full identifiers:
MRR: 79.20 (+3.72) Top-1: 71.78% (+4.86%) Top-5: 88.39% (+2.84%) Top-100: 98.99% (+0.00%)
  Filter length 0-5:
MRR:      0.92 (-0.10) 5.51 (+0.57) 18.30 (+2.34) 21.62 (+3.76) 32.00 (+6.00) 41.55 (+7.61)
Top-1:    0.56% (-0.08%) 2.44% (+0.15%) 9.82% (+1.47%) 12.59% (+2.16%) 21.17% (+4.47%) 30.05% (+6.72%)
Top-5:    1.20% (-0.15%) 7.14% (+1.04%) 25.17% (+3.91%) 29.74% (+5.90%) 43.29% (+9.59%) 54.75% (+9.79%)
Top-100:  5.49% (-0.01%) 56.22% (+2.59%) 86.69% (+1.08%) 89.03% (+2.04%) 93.74% (+0.78%) 96.99% (+0.59%)
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347548

5 years ago[clangd] Use testPath in the test.
Haojian Wu [Mon, 26 Nov 2018 11:18:16 +0000 (11:18 +0000)]
[clangd] Use testPath in the test.

llvm-svn: 347547

5 years ago[clang-tidy] PrintStackTraceOnErrorSignal
Alexander Kornienko [Mon, 26 Nov 2018 11:11:52 +0000 (11:11 +0000)]
[clang-tidy] PrintStackTraceOnErrorSignal

llvm-svn: 347546