platform/upstream/llvm.git
4 years ago[FormatEntity] Add mangled function name support
Med Ismail Bennani [Tue, 10 Dec 2019 00:46:03 +0000 (16:46 -0800)]
[FormatEntity] Add mangled function name support

Summary:
Add `function.mangled-name` key for FormatEntity to show the mangled
function names in backtraces.

rdar://54088244

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Subscribers: lldb-commits

Tags: #lldb

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[DAGCombiner] improve readability
Sanjay Patel [Thu, 12 Dec 2019 18:14:02 +0000 (13:14 -0500)]
[DAGCombiner] improve readability

This is not quite NFC because I changed the SDLoc to use the more
standard 'N' (the starting node for the fold).

This transform is a special-case of a more general fold that we
do in IR, but it seems like the general fold is needed here too
to avoid a potential regression seen in D58017.

https://rise4fun.com/Alive/3jZm

4 years ago[lldb/Core] Add missing include (2/2)
Jonas Devlieghere [Thu, 12 Dec 2019 18:05:30 +0000 (10:05 -0800)]
[lldb/Core] Add missing include (2/2)

This got flagged by the debian buildbot.

4 years ago[lldb/Core] Add missing include
Jonas Devlieghere [Thu, 12 Dec 2019 17:54:48 +0000 (09:54 -0800)]
[lldb/Core] Add missing include

This got flagged by the modules build.

4 years ago[AArch64][PowerPC] add tests for shift sandwich; NFC
Sanjay Patel [Thu, 12 Dec 2019 17:36:10 +0000 (12:36 -0500)]
[AArch64][PowerPC] add tests for shift sandwich; NFC

4 years ago[lldb/Host] Use cmakedefine01 for LLDB_ENABLE_TERMIOS
Jonas Devlieghere [Thu, 12 Dec 2019 17:34:11 +0000 (09:34 -0800)]
[lldb/Host] Use cmakedefine01 for LLDB_ENABLE_TERMIOS

This renames LLDB_CONFIG_TERMIOS_SUPPORTED to LLDB_ENABLE_TERMIOS. It
now also uses cmakedefine01 to keep things consistent with out other
optional dependencies. But more importantly it won't silently fail when
you forget to include Config.h.

4 years ago[lldb/Host] Use cmakedefine01 for LLDB_ENABLE_LIBXML2
Jonas Devlieghere [Thu, 12 Dec 2019 17:25:01 +0000 (09:25 -0800)]
[lldb/Host] Use cmakedefine01 for LLDB_ENABLE_LIBXML2

This keeps things consistent with out other optional dependencies. But
more importantly it won't silently fail when you forget to include
Config.h.

4 years ago[ELF] Add a comment to handleSectionGroup(). NFC
Fangrui Song [Thu, 12 Dec 2019 17:23:06 +0000 (09:23 -0800)]
[ELF] Add a comment to handleSectionGroup(). NFC

Apply suggestion in https://reviews.llvm.org/D71157#1780834

Reviewed By: grimar, ruiu

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

4 years ago[lldb/CMake] Rename LLDB_DISABLE_LIBEDIT to LLDB_ENABLE_LIBEDIT
Jonas Devlieghere [Thu, 12 Dec 2019 17:22:34 +0000 (09:22 -0800)]
[lldb/CMake] Rename LLDB_DISABLE_LIBEDIT to LLDB_ENABLE_LIBEDIT

This matches the naming scheme used by LLVM.

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

4 years ago[BasicAA] Use GEP as context for computeKnownBits in aliasGEP.
Florian Hahn [Thu, 12 Dec 2019 17:10:43 +0000 (17:10 +0000)]
[BasicAA] Use GEP as context for computeKnownBits in aliasGEP.

In order to use assumptions, computeKnownBits needs a context
instruction. We can use the GEP, if it is an instruction. We already
pass the assumption cache, but it cannot be used without a context
instruction.

Reviewers: anemet, asbirlea, hfinkel, spatel

Reviewed By: asbirlea

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

4 years ago[lldb/CMake] Rename LLDB_DISABLE_CURSES to LLDB_ENABLE_CURSES
Jonas Devlieghere [Thu, 12 Dec 2019 17:13:04 +0000 (09:13 -0800)]
[lldb/CMake] Rename LLDB_DISABLE_CURSES to LLDB_ENABLE_CURSES

This matches the naming scheme used by LLVM.

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

4 years ago[fuzzer] Add basic support for emscripten.
Jonathan Metzman [Thu, 12 Dec 2019 16:48:54 +0000 (08:48 -0800)]
[fuzzer] Add basic support for emscripten.

Summary:
Add basic support for emscripten.

This enables libFuzzer to build (using build.sh) for emscripten and fuzz
a target compiled with
-fsanitize-coverage=inline-8bit-counters.

Basic fuzzing and bug finding work with this commit.
RSS limit and timeouts will not work because they depend on system
functions that are not implemented/widely supported in emscripten.

Reviewers: kcc, vitalybuka, hctim

Reviewed By: hctim

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[ASTImporter] Support functions with placeholder return types ...
Gabor Marton [Thu, 12 Dec 2019 16:13:35 +0000 (17:13 +0100)]
[ASTImporter] Support functions with placeholder return types ...

Summary:
Support functions with placeholder return types even in cases when the type is
declared in the body of the function.
Example: auto f() { struct X{}; return X(); }

Reviewers: balazske, a_sidorin, a.sidorin, shafik

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

Tags: #clang

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

4 years ago[amdgpu] Fix `-Wenum-compare` warning. NFC.
Michael Liao [Thu, 12 Dec 2019 16:43:02 +0000 (11:43 -0500)]
[amdgpu] Fix `-Wenum-compare` warning. NFC.

4 years ago[clang] Turn -fno-builtin flag into an IR Attribute
Guillaume Chatelet [Mon, 9 Dec 2019 11:22:27 +0000 (12:22 +0100)]
[clang] Turn -fno-builtin flag into an IR Attribute

Summary:
This is a follow up on https://reviews.llvm.org/D61634#1742154 to turn the clang driver -fno-builtin flag into an IR attribute.
I also investigated pushing the attribute earlier on (in Sema) but it looks like this patch is simple and will cover all function calls.

Reviewers: aaron.ballman, courbet

Subscribers: cfe-commits, tejohnson

Tags: #clang

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

4 years ago[clang-tidy] Use early returns to make the code easier to read and potentially run...
Alexander Kornienko [Thu, 12 Dec 2019 15:51:08 +0000 (16:51 +0100)]
[clang-tidy] Use early returns to make the code easier to read and potentially run faster

4 years agoFix naming style. NFC.
Alexander Kornienko [Fri, 6 Dec 2019 14:38:39 +0000 (15:38 +0100)]
Fix naming style. NFC.

4 years agogn build: Merge 526244b187d
LLVM GN Syncbot [Thu, 12 Dec 2019 15:45:15 +0000 (15:45 +0000)]
gn build: Merge 526244b187d

4 years ago[Matrix] Add first set of matrix intrinsics and initial lowering pass.
Florian Hahn [Thu, 12 Dec 2019 15:27:28 +0000 (15:27 +0000)]
[Matrix] Add first set of matrix intrinsics and initial lowering pass.

This is the first patch adding an initial set of matrix intrinsics and a
corresponding lowering pass. This has been discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2019-October/136240.html

The first patch introduces four new intrinsics (transpose, multiply,
columnwise load and store) and a LowerMatrixIntrinsics pass, that
lowers those intrinsics to vector operations.

Matrixes are embedded in a 'flat' vector (e.g. a 4 x 4 float matrix
embedded in a <16 x float> vector) and the intrinsics take the dimension
information as parameters. Those parameters need to be ConstantInt.
For the memory layout, we initially assume column-major, but in the RFC
we also described how to extend the intrinsics to support row-major as
well.

For the initial lowering, we split the input of the intrinsics into a
set of column vectors, transform those column vectors and concatenate
the result columns to a flat result vector.

This allows us to lower the intrinsics without any shape propagation, as
mentioned in the RFC. In follow-up patches, we plan to submit the
following improvements:
 * Shape propagation to eliminate the embedding/splitting for each
   intrinsic.
 * Fused & tiled lowering of multiply and other operations.
 * Optimization remarks highlighting matrix expressions and costs.
 * Generate loops for operations on large matrixes.
 * More general block processing for operation on large vectors,
   exploiting shape information.

We would like to add dedicated transpose, columnwise load and store
intrinsics, even though they are not strictly necessary. For example, we
could instead emit a large shufflevector instruction instead of the
transpose. But we expect that to
  (1) become unwieldy for larger matrixes (even for 16x16 matrixes,
      the resulting shufflevector masks would be huge),
  (2) risk instcombine making small changes, causing us to fail to
      detect the transpose, preventing better lowerings

For the load/store, we are additionally planning on exploiting the
intrinsics for better alias analysis.

Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor, efriedma, rengolin

Reviewed By: anemet

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

4 years ago[ARM][MVE] findVCMPToFoldIntoVPS. NFC.
Sjoerd Meijer [Thu, 12 Dec 2019 10:45:16 +0000 (10:45 +0000)]
[ARM][MVE] findVCMPToFoldIntoVPS. NFC.

This adds ReachingDefAnalysis (RDA) to the VPTBlock pass, so that we can
reimplement findVCMPToFoldIntoVPS with just a few calls to RDA.

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

4 years ago[Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilder
Guillaume Chatelet [Thu, 12 Dec 2019 14:32:19 +0000 (15:32 +0100)]
[Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilder

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years agogn build: Merge 600d123c6ff
LLVM GN Syncbot [Thu, 12 Dec 2019 15:01:28 +0000 (15:01 +0000)]
gn build: Merge 600d123c6ff

4 years ago[ARM][CMSE] Add CMSE header and builtins
Momchil Velikov [Thu, 12 Dec 2019 14:59:04 +0000 (14:59 +0000)]
[ARM][CMSE] Add CMSE header and builtins

This is patch C2 as mentioned in RFC
http://lists.llvm.org/pipermail/cfe-dev/2019-March/061834.html

This adds CMSE builtin functions, and introduces arm_cmse.h header which has
useful macros, functions, and data types for end-users of CMSE.

Patch by Javed Absar.

Diferential Revision: https://reviews.llvm.org/D70817

4 years agoAMDGPU/SILoadStoreOptimizer: Simplify function
Tom Stellard [Thu, 12 Dec 2019 13:55:14 +0000 (05:55 -0800)]
AMDGPU/SILoadStoreOptimizer: Simplify function

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

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

Tags: #llvm

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

4 years ago[OpenMP][Test] Add check for aux-triple predefined macros
Alexey Bader [Thu, 12 Dec 2019 09:52:28 +0000 (12:52 +0300)]
[OpenMP][Test] Add check for aux-triple predefined macros

Summary:
Make sure that auxiliary target specific macros are defined in OpenMP
mode.

Reviewers: ABataev, jdoerfert

Subscribers: guansong, ebevhan, cfe-commits

Tags: #clang

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

4 years ago[ARM][MVE] Sink vector shift operand
Sam Parker [Thu, 12 Dec 2019 14:30:09 +0000 (14:30 +0000)]
[ARM][MVE] Sink vector shift operand

Recommit e0b966643fc2. sub instructions were being generated for the
negated value, and for some reason they were the register only ones.
I think the problem was because I was grabbing the 'zero' from
vmovimm, which is a target constant. Now I'm just generating a new
Constant zero and so rsb instructions are now generated.

Original commit message:

The shift amount operand can be provided in a general purpose
register so sink it. Flip the vdup and negate so the existing
patterns can be used for matching.

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

4 years ago[lldb/DWARF] Fix v5 location lists for dwo files
Pavel Labath [Mon, 25 Nov 2019 13:03:51 +0000 (14:03 +0100)]
[lldb/DWARF] Fix v5 location lists for dwo files

Dwo files don't have a DW_AT_loclists_base -- set one explicitly. Also,
make sure we use the correct location list flavour for v5.

4 years ago[llvm-dwarfdump] Add blank line after printing line table
James Henderson [Thu, 12 Dec 2019 09:35:59 +0000 (09:35 +0000)]
[llvm-dwarfdump] Add blank line after printing line table

This helps delineate it in the output from later tables or other output.

Reviewed by: JDevlieghere

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

4 years ago[clangd] Implement "textDocument/documentLink" protocol support
Michael Forster [Thu, 12 Dec 2019 13:30:02 +0000 (14:30 +0100)]
[clangd] Implement "textDocument/documentLink" protocol support

Summary:
This adds an implementation for the "textDocument/documentLink" LSP request.

It returns links for all `#include` directives to the resolved target files.

Fixes https://github.com/clangd/clangd/issues/217.

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

4 years ago[Diagnsotics] Small Improvement on -Wmisleading-indentation
Tyker [Tue, 10 Dec 2019 21:09:20 +0000 (22:09 +0100)]
[Diagnsotics] Small Improvement on -Wmisleading-indentation

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xbolva00

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

4 years ago[NFC][ARM] Add some test triples
Sam Parker [Thu, 12 Dec 2019 13:51:02 +0000 (13:51 +0000)]
[NFC][ARM] Add some test triples

Add thumb and thumb2 to a couple of the test files.

4 years ago[Attributor][NFC] Fix comments and unnecessary comma
Hideto Ueno [Thu, 12 Dec 2019 13:42:40 +0000 (13:42 +0000)]
[Attributor][NFC] Fix comments and unnecessary comma

4 years ago[Attributor] [NFC] Use `checkForAllUses` helpr in `AAHeapToStackImpl::updateImpl`
Hideto Ueno [Thu, 12 Dec 2019 12:26:30 +0000 (12:26 +0000)]
[Attributor] [NFC] Use `checkForAllUses` helpr in `AAHeapToStackImpl::updateImpl`

Summary: Remove `Worklist` iteration and make use `checkForAllUses`. There is no test chage.

Reviewers: sstefan1, jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Attributor][NFC] Refactoring `AANoFreeArgument::updateImpl`
Hideto Ueno [Thu, 12 Dec 2019 12:26:09 +0000 (12:26 +0000)]
[Attributor][NFC] Refactoring `AANoFreeArgument::updateImpl`

Summary: Refactoring `AANoFreeArgument::updateImpl`. There is no test change.

Reviewers: sstefan1, jdoerfert

Reviewed By: sstefan1

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Analyzer][Docs][NFC] Add CodeChecker to the command line tools
Gabor Marton [Tue, 29 Oct 2019 14:48:45 +0000 (15:48 +0100)]
[Analyzer][Docs][NFC] Add CodeChecker to the command line tools

We add a new common html file that documents the available command line
tools. Also a new html is added for a brief description of CodeChecker,
this way complementing scan-build.

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

4 years ago[DebugInfo] Prevent invalid fragments at ISel from dropping debug info
stozer [Tue, 10 Dec 2019 14:33:17 +0000 (14:33 +0000)]
[DebugInfo] Prevent invalid fragments at ISel from dropping debug info

During SelectionDAG, if a value which is associated with a DBG_VALUE
needs to be split across multiple registers, the DBG_VALUE will be split
into a set of fragment expressions to recreate the original value.

If one or more of these fragments cannot be created, they would
previously be silently dropped, causing the old debug value to live past
its expiry date. This patch fixes this issue by keeping invalid
fragments while setting their value as Undef.

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

4 years ago[Support] Try to fix bot failure after 8ddcd1dc26
Russell Gallop [Thu, 12 Dec 2019 12:18:12 +0000 (12:18 +0000)]
[Support] Try to fix bot failure after 8ddcd1dc26

http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/41755

4 years ago[clangd] Rename constructors and destructors in cross-file case
Kirill Bobyrev [Thu, 12 Dec 2019 12:10:59 +0000 (13:10 +0100)]
[clangd] Rename constructors and destructors in cross-file case

* Use ad-hoc Decl canonicalization from Clang-Rename to allow renaming
  constructors and destructors while using cross-file rename.
* Manually handle the destructor selection
* Add unit tests to prevent regressions and ensure the correct behaviour

Reviewed by: sammccall

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

4 years ago[Support] Extend TimeProfiler to support multiple threads
Russell Gallop [Thu, 5 Dec 2019 09:43:49 +0000 (09:43 +0000)]
[Support] Extend TimeProfiler to support multiple threads

This makes TimeTraceProfilerInstance thread local. Added
timeTraceProfilerFinishThread() which moves the thread local instance to
a global vector of instances. timeTraceProfilerWrite() then writes
recorded data from all instances.

Threads are identified based on their thread ids. Totals are reported
with artificial thread ids higher than the real ones.

Replaced raw pointer for TimeTraceProfilerInstance with unique_ptr.

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

4 years ago[Tooling/Syntax] Helpers to find spelled tokens touching a location.
Sam McCall [Wed, 11 Dec 2019 14:40:23 +0000 (15:40 +0100)]
[Tooling/Syntax] Helpers to find spelled tokens touching a location.

Summary: Useful when positions are used to target nodes, with before/after ambiguity.

Reviewers: ilya-biryukov, kbobyrev

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[clangd] Fix windows tests
Kadir Cetinkaya [Thu, 12 Dec 2019 11:53:58 +0000 (12:53 +0100)]
[clangd] Fix windows tests

4 years ago[NFC] - Partially revert 9c48c2f9c477007234c
Gabor Buella [Thu, 12 Dec 2019 11:46:17 +0000 (12:46 +0100)]
[NFC] - Partially revert 9c48c2f9c477007234c

4 years ago[llvm-readobj][test] - Add a test for testing regular section flags and cleanup flags...
Georgii Rymar [Wed, 11 Dec 2019 10:38:52 +0000 (13:38 +0300)]
[llvm-readobj][test] - Add a test for testing regular section flags and cleanup flags testing.

This:
1) Adds a test for testing all section flags (`section-flags.test`).
2) Renames `sec-flags.test`->`section-arch-flags.test`
   and performs a clean up.
3) Removes `compression.zlib.style.elf-x86-64` binary and a test case
   for SHF_COMPRESSED flag, because them are now excessive.
4) Adds missing MIPS flags and a test for SHF_ARM_PURECODE.

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

4 years ago[lldb] Remove ClangASTMetrics
Raphael Isemann [Thu, 12 Dec 2019 10:45:06 +0000 (11:45 +0100)]
[lldb] Remove ClangASTMetrics

Summary: Not once have I looked at these numbers in a log and considered them useful. Also this should not have been implemented via an unguarded list of globals.

Reviewers: martong, shafik

Reviewed By: shafik

Subscribers: rnkovacs, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb] "See through" atomic types in ClangASTContext
Pavel Labath [Mon, 9 Dec 2019 17:24:45 +0000 (18:24 +0100)]
[lldb] "See through" atomic types in ClangASTContext

Summary:
This enables us to display the contents of atomic structs. Calling the
removal of _Atomic "desugaring" is not fully correct as it does more
than remove sugar, but it is the right thing to do for most of the
things that we care about. We can change this back once we decide to
support atomic types more comprehensively.

Reviewers: teemperor, shafik

Subscribers: jfb, lldb-commits

Tags: #lldb

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

4 years ago[clangd] Fix hover crashing on null types
Kadir Cetinkaya [Thu, 12 Dec 2019 09:41:27 +0000 (10:41 +0100)]
[clangd] Fix hover crashing on null types

Summary: Fixes https://github.com/clangd/clangd/issues/225

Reviewers: sammccall, ilya-biryukov

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

Tags: #clang

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

4 years ago[Mips] Add support for min/max/umin/umax atomics
Mirko Brkusanin [Thu, 12 Dec 2019 10:19:41 +0000 (11:19 +0100)]
[Mips] Add support for min/max/umin/umax atomics

In order to properly implement these atomic we need one register more than other
binary atomics. It is used for storing result from comparing values in addition
to the one that is used for actual result of operation.

https://reviews.llvm.org/D71028

4 years agoTemporarily Revert "[DataLayout] Fix occurrences that size and range of pointers...
Nicola Zaghen [Thu, 12 Dec 2019 10:25:14 +0000 (10:25 +0000)]
Temporarily Revert "[DataLayout] Fix occurrences that size and range of pointers are assumed to be the same."

This reverts commit 5f6208778ff92567c57d7c1e2e740c284d7e69a5.

This caused failures in Transforms/PhaseOrdering/scev-custom-dl.ll
const: Assertion `getBitWidth() == CR.getBitWidth() && "ConstantRange types don't agree!"' failed.

4 years ago[NFC] - Typo fix in test/CodeGenCXX/runtime-dllstorage.cpp
Gabor Buella [Thu, 12 Dec 2019 10:26:54 +0000 (11:26 +0100)]
[NFC] - Typo fix in test/CodeGenCXX/runtime-dllstorage.cpp

Reviewed By: Jim

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

4 years ago[lldb][NFC] Don't implement ClangASTContext::SetMetadata again as a static method
Raphael Isemann [Thu, 12 Dec 2019 09:53:16 +0000 (10:53 +0100)]
[lldb][NFC] Don't implement ClangASTContext::SetMetadata again as a static method

We always have an ClangASTContext when we call this method so we might as
well always call the non-static version.

4 years ago[DataLayout] Fix occurrences that size and range of pointers are assumed to be the...
Nicola Zaghen [Mon, 2 Dec 2019 11:13:43 +0000 (11:13 +0000)]
[DataLayout] Fix occurrences that size and range of pointers are assumed to be the same.

GEP index size can be specified in the DataLayout, introduced in D42123. However, there were still places
in which getIndexSizeInBits was used interchangeably with getPointerSizeInBits. This notably caused issues
with Instcombine's visitPtrToInt; but the unit tests was incorrect, so this remained undiscovered.

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

Patch by Joseph Faulls!

4 years ago[Tooling] Move raw string literal out of a macro call. NFC
Ilya Biryukov [Thu, 12 Dec 2019 09:50:32 +0000 (10:50 +0100)]
[Tooling] Move raw string literal out of a macro call. NFC

Should fix buildbots with some older gcc versions.

4 years ago[AArch64][SVE] Remove nxv1f32 and nxv1f64 as legal types
Cullen Rhodes [Wed, 11 Dec 2019 13:56:40 +0000 (13:56 +0000)]
[AArch64][SVE] Remove nxv1f32 and nxv1f64 as legal types

Summary: Also cleans up ZPR register class definition.

Reviewers: sdesmalen, cameron.mcinally, efriedma

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl,
llvm-commits

Tags: #llvm

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

4 years ago[libomptarget][nfc] Add missing header for amdgcn/target_impl
Jon Chesterfield [Thu, 12 Dec 2019 09:35:39 +0000 (09:35 +0000)]
[libomptarget][nfc] Add missing header for amdgcn/target_impl

4 years ago[llvm-readobj][test] - Cleanup and split tests in tools/llvm-readobj folder.
Georgii Rymar [Tue, 10 Dec 2019 14:06:16 +0000 (17:06 +0300)]
[llvm-readobj][test] - Cleanup and split tests in tools/llvm-readobj folder.

tools/llvm-readobj currently contains tests that are either general for
all file types or that mix file types inside. This patch refactors
these test and leaves only general tests in that folder. All other
tests were moved to ELF/COFF/MachO and wasm accordingly.

I tried to minimize amount of changes, so most of the test parts
remained unchanged. Any further refactorings and improvements for
particular tests should be done independently from this patch.

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

4 years ago[NFC][llvm][MIRVRegNamerUtils] Moving methods around. Making some private.
Puyan Lotfi [Thu, 12 Dec 2019 08:27:47 +0000 (03:27 -0500)]
[NFC][llvm][MIRVRegNamerUtils] Moving methods around. Making some private.

Making all externally unused methods private in MIRVRegNamerUtils.h.
Moving or deleting a couple other methods around.

4 years agoRevert unintentional change to compiler-rt as part of the __bit_reference revert.
Eric Christopher [Thu, 12 Dec 2019 08:31:23 +0000 (00:31 -0800)]
Revert unintentional change to compiler-rt as part of the __bit_reference revert.

4 years ago[compiler-rt] Add a critical section when flushing gcov counters
Calixte Denizet [Tue, 10 Dec 2019 12:22:33 +0000 (13:22 +0100)]
[compiler-rt] Add a critical section when flushing gcov counters

Summary:
Counters can be flushed in a multi-threaded context for example when the process is forked in different threads (https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L632-L663).
In order to avoid pretty bad things, a critical section is needed around the flush.
We had a lot of crashes in this code in Firefox CI when we switched to clang for linux ccov builds and those crashes disappeared with this patch.

Reviewers: marco-c, froydnj, dmajor, davidxl, vsk

Reviewed By: marco-c, dmajor

Subscribers: ahatanak, froydnj, dmajor, dberris, jfb, #sanitizers, llvm-commits, sylvestre.ledru

Tags: #sanitizers, #llvm

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

4 years agoTemporarily Revert "[libc++] Fix -Wdeprecated-copy warnings in __bit_reference"
Eric Christopher [Thu, 12 Dec 2019 08:22:07 +0000 (00:22 -0800)]
Temporarily Revert "[libc++] Fix -Wdeprecated-copy warnings in __bit_reference"
as it's causing test failures due to mismatched visibility.

This reverts commit 02bb20223bda5add729402962c70d0ebd0d98af2.

4 years ago[DWARF5][DWARFVerifier] Check that Skeleton compilation unit does not have children.
Alexey Lapshin [Tue, 10 Dec 2019 10:00:19 +0000 (13:00 +0300)]
[DWARF5][DWARFVerifier] Check that Skeleton compilation unit does not have children.

  That patch adds checking into DWARFVerifier that the Skeleton
compilation unit does not have children.

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

4 years agoRevert "[ARM][MVE] Sink vector shift operand"
Sam Parker [Thu, 12 Dec 2019 07:52:18 +0000 (07:52 +0000)]
Revert "[ARM][MVE] Sink vector shift operand"

This reverts commit e0b966643fc2030442ffbae9b677247be697673b.

Instruction selection is failing with expensive checks.

4 years ago[libc++] Fix -Wdeprecated-copy warnings in __bit_reference
Eric Christopher [Thu, 12 Dec 2019 07:49:07 +0000 (23:49 -0800)]
[libc++] Fix -Wdeprecated-copy warnings in __bit_reference

Add a couple of default copy constructors to fix the warning.

Reviewed By: dblaikie

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

4 years ago[ARM][MVE] Sink vector shift operand
Sam Parker [Thu, 12 Dec 2019 07:34:49 +0000 (07:34 +0000)]
[ARM][MVE] Sink vector shift operand

The shift amount operand can be provided in a general purpose
register so sink it. Flip the vdup and negate so the existing
patterns can be used for matching.

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

4 years agoFix an error in the block ABI documentation sample code
Akira Hatanaka [Thu, 12 Dec 2019 07:17:49 +0000 (23:17 -0800)]
Fix an error in the block ABI documentation sample code

rdar://problem/38663011

4 years ago[Syntax] Build nodes for simple cases of top level declarations
Ilya Biryukov [Thu, 12 Dec 2019 07:04:21 +0000 (08:04 +0100)]
[Syntax] Build nodes for simple cases of top level declarations

Summary:
More complicated nodes (e.g. template declarations) will be implemented
in the follow-up patches.

Reviewers: gribozavr2

Reviewed By: gribozavr2

Subscribers: merge_guards_bot, cfe-commits

Tags: #clang

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

4 years ago[OpenMP][Docs] Mark 5.0 features worked on and list 5.1 features
Johannes Doerfert [Thu, 12 Dec 2019 05:59:46 +0000 (23:59 -0600)]
[OpenMP][Docs] Mark 5.0 features worked on and list 5.1 features

4 years ago[AutoFDO] Statistic for context sensitive profile guided inlining
Wenlei He [Fri, 22 Nov 2019 07:59:41 +0000 (23:59 -0800)]
[AutoFDO] Statistic for context sensitive profile guided inlining

Summary: AutoFDO compilation has two places that do inlining - the sample profile loader that does inlining with context sensitive profile, and the regular inliner as CGSCC pass. Ideally we want most inlining to come from sample profile loader as that is driven by context sensitive profile and also retains context sensitivity after inlining. However the reality is most of the inlining actually happens during regular inliner. To track the number of inline instances from sample profile loader and help move more inlining to sample profile loader, I'm adding statistics and optimization remarks for sample profile loader's inlining.

Reviewers: wmi, davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agogn build: (manually) merge 5d986953c8b917bacfaa1f800fc1e242559f76be
Nico Weber [Thu, 12 Dec 2019 03:48:38 +0000 (22:48 -0500)]
gn build: (manually) merge 5d986953c8b917bacfaa1f800fc1e242559f76be

4 years ago[llvm][MIRVRegNamerUtils] Adding hashing on memoperands.
Puyan Lotfi [Wed, 11 Dec 2019 06:39:17 +0000 (01:39 -0500)]
[llvm][MIRVRegNamerUtils] Adding hashing on memoperands.

No more hash collisions for memoperands. Now the MIRCanonicalization
pass shouldn't hit hash collisions when dealing with nearly identical
memory accessing instructions when their memoperands are in fact different.

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

4 years ago[AArch64][SVE] Add patterns for scalable vselect
Cameron McInally [Wed, 11 Dec 2019 23:07:07 +0000 (17:07 -0600)]
[AArch64][SVE] Add patterns for scalable vselect

This patch matches scalable vector selects to predicated move instructions.

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

4 years ago[IR] Split out target specific intrinsic enums into separate headers
Reid Kleckner [Wed, 11 Dec 2019 15:55:26 +0000 (07:55 -0800)]
[IR] Split out target specific intrinsic enums into separate headers

This has two main effects:
- Optimizes debug info size by saving 221.86 MB of obj file size in a
  Windows optimized+debug build of 'all'. This is 3.03% of 7,332.7MB of
  object file size.
- Incremental step towards decoupling target intrinsics.

The enums are still compact, so adding and removing a single
target-specific intrinsic will trigger a rebuild of all of LLVM.
Assigning distinct target id spaces is potential future work.

Part of PR34259

Reviewers: efriedma, echristo, MaskRay

Reviewed By: echristo, MaskRay

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

4 years agoRename TTI::getIntImmCost for instructions and intrinsics
Reid Kleckner [Wed, 11 Dec 2019 19:54:58 +0000 (11:54 -0800)]
Rename TTI::getIntImmCost for instructions and intrinsics

Soon Intrinsic::ID will be a plain integer, so this overload will not be
possible.

Rename both overloads to ensure that downstream targets observe this as
a build failure instead of a runtime failure.

Split off from D71320

Reviewers: efriedma

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

4 years ago[Remarks][Driver] Ask for line tables when remarks are enabled
Francis Visoiu Mistrih [Tue, 10 Dec 2019 23:10:52 +0000 (15:10 -0800)]
[Remarks][Driver] Ask for line tables when remarks are enabled

Serialized remarks contain debug locations for each remark, by storing a
file path, a line, and a column.

Also, remarks support being embedded in a .dSYM bundle using a separate
section in object files, that is found by `dsymutil` through the debug
map.

In order for tools to map addresses to source and display remarks in the
source, we need line tables, and in order for `dsymutil` to find the
object files containing the remark section, we need to keep the debug
map around.

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

4 years agogn build: (manually) merge d23c61490c
Nico Weber [Thu, 12 Dec 2019 01:41:18 +0000 (20:41 -0500)]
gn build: (manually) merge d23c61490c

4 years ago[libc++abi] Fix non-constant initialization of default terminate
Eric Fiselier [Thu, 12 Dec 2019 01:32:14 +0000 (20:32 -0500)]
[libc++abi] Fix non-constant initialization of default terminate
handlers.

4 years ago[libc++] Require C++14 in all cases.
Eric Fiselier [Thu, 12 Dec 2019 01:26:30 +0000 (20:26 -0500)]
[libc++] Require C++14 in all cases.

LLVM has moved to C++14, and the libc++ build should too.
C++14 is needed to provide constant initialization for certain global
objects.

I suspect this change may break some older GCC buildbots, and I'll clean
those up as they fall.

4 years ago[analyzer] Do not cache out on some shared implicit AST nodes
Gabor Horvath [Wed, 11 Dec 2019 19:34:44 +0000 (11:34 -0800)]
[analyzer] Do not cache out on some shared implicit AST nodes

Some AST nodes which stands for implicit initialization is shared. The analyzer
will do the same evaluation on the same nodes resulting in the same state. The
analyzer will "cache out", i.e. it thinks that it visited an already existing
node in the exploded graph. This is not true in this case and we lose coverage.
Since these nodes do not really require any processing from the analyzer
we just omit them from the CFG.

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

4 years ago[AArch64][x86] add tests for possible infinite loops in DAGCombiner; NFC
Sanjay Patel [Thu, 12 Dec 2019 00:38:37 +0000 (19:38 -0500)]
[AArch64][x86] add tests for possible infinite loops in DAGCombiner; NFC

This is a reduction of a test that failed (infinite looped)
with rGd1f0bdf2d2df (subsequently reverted). I've duplicated
it for 2 targets to increase coverage - everything down here
is wobbly.

4 years agoRevert "[clang][clang-scan-deps] Aggregate the full dependency information."
Michael Spencer [Thu, 12 Dec 2019 00:34:31 +0000 (16:34 -0800)]
Revert "[clang][clang-scan-deps] Aggregate the full dependency information."

This reverts commit f978ea498309adaebab8fbf1cd6e520e7e0e11f1.

It broke clang-ppc64be-linux, but not sure why yet.

4 years agoRevert "[DWARF] Allow cross-CU references of subprogram definitions"
Vedant Kumar [Wed, 11 Dec 2019 23:55:48 +0000 (15:55 -0800)]
Revert "[DWARF] Allow cross-CU references of subprogram definitions"

This reverts commit 30038da15b18ac4e34b9ea7a648382ae481e4770. It causes
the stage2 thinLTO bot to fail with:

Assertion failed: (CU.getDIE(CalleeSP) && "Expected declaration subprogram DIE for callee")

rdar://57840415

4 years ago[OpenMP] Use the OpenMP-IR-Builder
Johannes Doerfert [Tue, 5 Nov 2019 05:00:36 +0000 (23:00 -0600)]
[OpenMP] Use the OpenMP-IR-Builder

This is a follow up patch to use the OpenMP-IR-Builder, as discussed on
the mailing list ([1] and later) and at the US Dev Meeting'19.

[1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html

Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim

Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny

Tags: #clang

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

4 years ago[clang][clang-scan-deps] Aggregate the full dependency information.
Michael Spencer [Mon, 28 Oct 2019 21:26:45 +0000 (14:26 -0700)]
[clang][clang-scan-deps] Aggregate the full dependency information.

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

4 years ago[lit] Improve formatting of error messages. NFC
Julian Lettner [Tue, 26 Feb 2019 06:41:52 +0000 (22:41 -0800)]
[lit] Improve formatting of error messages. NFC

4 years ago[lldb/CMake] Simplify linking against curses
Jonas Devlieghere [Wed, 11 Dec 2019 22:27:58 +0000 (14:27 -0800)]
[lldb/CMake] Simplify linking against curses

Centralize the logic to determine what libraries to link against for
curses in the CMake file where it is actually being used. Use
target_include_directories instead of include_directories.

4 years agoSuppress false-positive -Wuninitialized warnings in the constructor of a
Richard Smith [Wed, 11 Dec 2019 22:25:43 +0000 (14:25 -0800)]
Suppress false-positive -Wuninitialized warnings in the constructor of a
templated but non-template class.

4 years agoDon't call export_symbols.py with duplicate libs
David Tenty [Wed, 11 Dec 2019 22:21:54 +0000 (17:21 -0500)]
Don't call export_symbols.py with duplicate libs

Summary:
export_symbols.py discards duplicate symbols, assuming they have public definitions, so if we end
up calling it with duplicate libraries we will end up with an inaccurate export list.

Reviewers: jasonliu, stevewan, john.brawn

Reviewed By: john.brawn

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Host] Use Host/Config.h for LibXML2 instead of a global define
Jonas Devlieghere [Wed, 11 Dec 2019 22:10:38 +0000 (14:10 -0800)]
[lldb/Host] Use Host/Config.h for LibXML2 instead of a global define

Rename LIBXML2_DEFINED to LLDB_ENABLE_LIBXML2 and pass it through
Config.h instead of a global define.

4 years ago[lldb][dotest] Add `#include <algorithm>` to libc++ detection
Jordan Rupprecht [Wed, 11 Dec 2019 22:02:22 +0000 (14:02 -0800)]
[lldb][dotest] Add `#include <algorithm>` to libc++ detection

Summary: Speculative fix after 34ef51b5f979 broke the lldb buildbot on libc++ tests.

Reviewers: echristo, EricWF

Subscribers: ldionne, lldb-commits

Tags: #lldb

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

4 years agoFix detection of __attribute__((may_alias)) to properly look through
Richard Smith [Wed, 11 Dec 2019 22:03:35 +0000 (14:03 -0800)]
Fix detection of __attribute__((may_alias)) to properly look through
type sugar.

We previously missed the attribute in a lot of cases in C++, because
there's often other type sugar there (eg, ElaboratedType).

4 years agoRevert "[SDAG] remove use restriction in isNegatibleForFree() when called from getNeg...
Sanjay Patel [Wed, 11 Dec 2019 21:56:18 +0000 (16:56 -0500)]
Revert "[SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpression()"

This reverts commit d1f0bdf2d2df9bdf11ee2ddfff3df50e53f2f042.
The patch can cause infinite loops in DAGCombiner.

4 years ago[lldb][dotest] Improve libc++ detection
Jordan Rupprecht [Wed, 11 Dec 2019 00:48:33 +0000 (16:48 -0800)]
[lldb][dotest] Improve libc++ detection

Summary: The test logic for running libc++ tests only looks to see if `/usr/include/c++/v1` exists. This adds a fallback for including libc++ tests as long as `$(CC) -stdlib=libc++` works.

Reviewers: labath, EricWF

Subscribers: ldionne, lldb-commits

Tags: #lldb

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

4 years ago[libc++] Fix fuzzing tests with older GCC compilers.
Eric Fiselier [Wed, 11 Dec 2019 21:36:21 +0000 (16:36 -0500)]
[libc++] Fix fuzzing tests with older GCC compilers.

GCC 5 doesn't support `if constexpr`, so we need to do old-style tag
dispatching.

4 years agoAdd resurrecting Type Validators to projects.rst
Adrian Prantl [Wed, 11 Dec 2019 21:30:05 +0000 (13:30 -0800)]
Add resurrecting Type Validators to projects.rst

4 years ago[libc++] Fix fuzzing unit tests with exceptions disabled.
Eric Fiselier [Wed, 11 Dec 2019 21:21:23 +0000 (16:21 -0500)]
[libc++] Fix fuzzing unit tests with exceptions disabled.

We simply turn off the parts of the tests that require exceptions.

4 years ago[OPENMP50]Add if clause in teams distribute parallel for simd directive.
Alexey Bataev [Wed, 11 Dec 2019 20:26:38 +0000 (15:26 -0500)]
[OPENMP50]Add if clause in teams distribute parallel for simd directive.

According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.

4 years ago[TSan] Pacify flaky test on Darwin
Julian Lettner [Wed, 11 Dec 2019 20:49:19 +0000 (12:49 -0800)]
[TSan] Pacify flaky test on Darwin

This flaky test that I added really gives our CI a lot of headaches.
Although I was never able to reproduce this locally, it sporadically
hangs/fails on our bots.  I decided to silently pass the test whenever
we are unable to setup the proper test condition after 10 retries.  This
is of course suboptimal and a last recourse.  Please let me know if you
know how to test this better.

rdar://57844626

4 years ago[LegalizeTypes] In SoftenFloatRes_FP_EXTEND, move the check for input already being...
Craig Topper [Wed, 11 Dec 2019 20:45:54 +0000 (12:45 -0800)]
[LegalizeTypes] In SoftenFloatRes_FP_EXTEND, move the check for input already being promoted above the check for fp16 converting to something other than fp32.

The fp16 to larger than fp32 inserts an extend that need to
re-legalized if fp16 is promoted. But if we check for fp16
promotion first, then we can avoid emiting the fp_extend all
together.

4 years ago[libc++] Add fuzzing tests for parts of <random>.
Eric Fiselier [Wed, 11 Dec 2019 20:45:48 +0000 (15:45 -0500)]
[libc++] Add fuzzing tests for parts of <random>.

This patch also re-names the existing fuzzing unit tests so they
actually run.

4 years ago[ADT] Fix SmallDenseMap assertion with large InlineBuckets
Nikita Popov [Wed, 11 Dec 2019 20:17:29 +0000 (21:17 +0100)]
[ADT] Fix SmallDenseMap assertion with large InlineBuckets

Fixes issue encountered in D56362, where I tried to use a
SmallSetVector<Instruction*, 128> with an excessively large number
of inline elements. This triggers an "Must allocate more buckets
than are inline" assertion inside allocateBuckets() under certain
usage patterns.

The issue is as follows: The grow() method is used either to grow
the map, or to rehash it and remove tombstones. The latter is done
if the fraction of empty (non-used, non-tombstone) elements is
below 1/8. In this case grow() is invoked with the current number
of buckets.

This is currently incorrectly handled for dense maps using the small
rep. The current implementation will switch them over to the large
rep, which violates the invariant that the large rep is only used
if there are more than InlineBuckets buckets.

This patch fixes the issue by staying in the small rep and only
moving the buckets. An alternative, if we do want to switch to the
large rep in this case, would be to relax the assertion in
allocateBuckets().

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

4 years ago[OpenMP] Introduce the OpenMP-IR-Builder
Johannes Doerfert [Wed, 6 Nov 2019 00:57:44 +0000 (18:57 -0600)]
[OpenMP] Introduce the OpenMP-IR-Builder

This is the initial patch for the OpenMP-IR-Builder, as discussed on the
mailing list ([1] and later) and at the US Dev Meeting'19.

The design is similar to D61953 but:
  - in a non-WIP status, with proper documentation and working.
  - using a OpenMPKinds.def file to manage lists of directives, runtime
    functions, types, ..., similar to the current Clang implementation.
  - restricted to handle only (simple) barriers, to implement most
    `#pragma omp barrier` directives and most implicit barriers.
  - properly hooked into Clang to be used if possible (D69922).
  - compatible with the remaining code generation.

Parts have been extracted into D69853.

The plan is to have multiple people working on moving logic from Clang
here once the initial scaffolding (=this patch) landed.

[1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html

Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim

Subscribers: mgorny, hiraditya, bollu, guansong, jfb, cfe-commits, llvm-commits, penzn, ppenzin

Tags: #clang, #llvm

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