platform/upstream/llvm.git
4 years ago[lldb/Target] Add Assert StackFrame Recognizer
Med Ismail Bennani [Tue, 4 Feb 2020 16:53:26 +0000 (17:53 +0100)]
[lldb/Target] Add Assert StackFrame Recognizer

When a thread stops, this checks depending on the platform if the top frame is
an abort stack frame. If so, it looks for an assert stack frame in the upper
frames and set it as the most relavant frame when found.

To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a
"cooked" stop reason description. When the thread is about to stop, it checks
if the current frame is recognized, and if so, it fetches the recognized frame's
attributes and applies them.

rdar://58528686

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years agoFix warning on unused variables. NFC.
Michael Liao [Thu, 6 Feb 2020 17:19:55 +0000 (12:19 -0500)]
Fix warning on unused variables. NFC.

4 years ago[AIX] Implement caller arguments passed in stack memory.
Chris Bowler [Thu, 6 Feb 2020 16:19:35 +0000 (11:19 -0500)]
[AIX] Implement caller arguments passed in stack memory.

This patch implements the caller side of placing function call arguments
in stack memory. This removes the current limitation where LLVM on AIX
will report fatal error when arguments can't be contained in registers.

There is a particular oddity that a float argument that passes in a
register and also in stack memory requires that the caller initialize
both. From what AIX "ABI" documentation I have it's not clear that this
needs to be done, however, it is necessary for compatibility with the
AIX XL compiler so I think it's best to implement it the same way.

Note a later patch will follow to address the callee side.

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

4 years ago[mlir-tblgen] Stop leaking PredNodes
Benjamin Kramer [Thu, 6 Feb 2020 17:03:15 +0000 (18:03 +0100)]
[mlir-tblgen] Stop leaking PredNodes

Technically a leak in tblgen is harmless, but this makes asan builds of
mlir very noisy. Just use a SpecificBumpPtrAllocator that knows how to
clean up after itself.

4 years ago[ARM][MVE] Add fixed point vector conversion intrinsics
Mikhail Maltsev [Thu, 6 Feb 2020 16:49:45 +0000 (16:49 +0000)]
[ARM][MVE] Add fixed point vector conversion intrinsics

Summary:
This patch implements the following Arm ACLE MVE intrinsics:
* vcvtq_n_*
* vcvtq_m_n_*
* vcvtq_x_n_*

and two corresponding LLVM IR intrinsics:
* int_arm_mve_vcvt_fix (vcvtq_n_*)
* int_arm_mve_vcvt_fix_predicated (vcvtq_m_n_*, vcvtq_x_n_*)

Reviewers: simon_tatham, ostannard, MarkMurrayARM, dmgreen

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years agoRevert "[mlir] Adds affine loop fusion transformation function to LoopFusionUtils."
Mehdi Amini [Thu, 6 Feb 2020 16:42:55 +0000 (16:42 +0000)]
Revert "[mlir] Adds affine loop fusion transformation function to LoopFusionUtils."

This reverts commit 64871f778d528b34aabeae6286711a61ad9ea7ee.

ASAN indicates a use-after-free in in mlir::canFuseLoops(mlir::AffineForOp, mlir::AffineForOp, unsigned int, mlir::ComputationSliceState*) lib/Transforms/Utils/LoopFusionUtils.cpp:202:41

4 years agoRevert "[CMake] Passthrough CMAKE_SYSTEM_NAME to default builtin and runtimes target"
Petr Hosek [Thu, 6 Feb 2020 16:24:08 +0000 (08:24 -0800)]
Revert "[CMake] Passthrough CMAKE_SYSTEM_NAME to default builtin and runtimes target"

This reverts commit 491a4a7ac9e39fd4cc20a21e7da1961dfc7fc275 as it
broke the runtimes build on Darwin.

4 years ago[clangd] Set "spelled" flag for constructor references.
Haojian Wu [Thu, 6 Feb 2020 13:55:12 +0000 (14:55 +0100)]
[clangd] Set "spelled" flag for constructor references.

Summary:
DeclarationName for cxx constructor is special, it is not an identifier.
thus the "Spelled" flag are not set for all ctor references, this patch
fixes it.

Reviewers: kbobyrev

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

Tags: #clang

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

4 years ago[OpenCL] Reduce size of builtin function tables
Sven van Haastregt [Thu, 6 Feb 2020 15:08:32 +0000 (15:08 +0000)]
[OpenCL] Reduce size of builtin function tables

Reduce the size of some of the TableGen'ed OpenCL builtin function
tables:

 - Use bit fields for bools such that they are packed together.  This
   saves about 7kb.

 - Use unsigned short for SignatureTable.  This saves about 10kb.

4 years ago[doc] typo in optimisation remark example
Sjoerd Meijer [Thu, 6 Feb 2020 14:55:18 +0000 (14:55 +0000)]
[doc] typo in optimisation remark example

Fix typo in the vectorisation optimisation remarks example:

  -Rpass-missed=loop-vectorized
=>
  -Rpass-missed=loop-vectorize

4 years agoRevert "[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field"
Jeremy Morse [Wed, 5 Feb 2020 17:27:44 +0000 (17:27 +0000)]
Revert "[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field"

This reverts commit ed29dbaafa49bb8c9039a35f768244c394411fea.

I'm backing out D68945, which as the discussion for D73526 shows, doesn't
seem to handle the -O0 path through the codegen backend correctly. I'll
reland the patch when a fix is worked out, apologies for all the churn.
The two parent commits are part of this revert too.

Conflicts:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/test/DebugInfo/X86/dbg-addr-dse.ll

SelectionDAGBuilder conflict is due to a nearby change in e39e2b4a79c6
that's technically unrelated. dbg-addr-dse.ll conflicted because
41206b61e30c (legitimately) changes the order of two lines.

There are further modifications to dbg-value-func-arg.ll: it landed after
the patch being reverted, and I've converted indirection to be represented
by the isIndirect field rather than DW_OP_deref.

4 years agoRevert "[DebugInfo][DAG] Distinguish different kinds of location indirection"
Jeremy Morse [Wed, 5 Feb 2020 16:57:59 +0000 (16:57 +0000)]
Revert "[DebugInfo][DAG] Distinguish different kinds of location indirection"

This reverts commit 3137fe4d23eeb8df08c03e9111465325eeafe08e.

I'm backing out D68945, which this patch is a follow up for. It'll be
re-landed when D68945 is fixed.

The changes to dbg-value-func-arg.ll occur because our handling of certain
kinds of location now mixes up indirection that happens at different points
in a DIExpression. While this is a regression, it's a return to the prior
behaviour while a better patch is sought.

4 years agoRevert "[SafeStack][DebugInfo] Insert DW_OP_deref in correct location"
Jeremy Morse [Wed, 5 Feb 2020 15:19:00 +0000 (15:19 +0000)]
Revert "[SafeStack][DebugInfo] Insert DW_OP_deref in correct location"

This reverts commit 2d3174c4df6b5f4131346828d0a31675d80d6e2b.

The overall solution for this problem is reverting D68945, which wasn't
handling the -O0 path through the codegen backend correctly. See:
discussion in D73526.

4 years ago[clangd] don't rename on protobuf symbols.
Haojian Wu [Wed, 5 Feb 2020 11:31:11 +0000 (12:31 +0100)]
[clangd] don't rename on protobuf symbols.

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[ARM] peephole-bitcast test change. NFC.
Sjoerd Meijer [Thu, 6 Feb 2020 14:36:48 +0000 (14:36 +0000)]
[ARM] peephole-bitcast test change. NFC.

This test case was XFAIL'ed because the peepholer was missing an optimisation.
But the peepholer is now able to handle this case, so enable this test. I will
close the corresponding and very old PR11364.

4 years ago[RDA] getInstFromId: find instructions. NFC.
Sjoerd Meijer [Thu, 6 Feb 2020 14:13:31 +0000 (14:13 +0000)]
[RDA] getInstFromId: find instructions. NFC.

To find the instruction in the block for a given ID, first a count and then a
lookup was performed in the map, which is almost the same thing, thus doing
double the work.

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

4 years ago[ReachingDefs] Make isSafeToMove more strict.
Sam Parker [Thu, 6 Feb 2020 13:53:09 +0000 (13:53 +0000)]
[ReachingDefs] Make isSafeToMove more strict.

Test that we're not moving the instruction through instructions with
side-effects.

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

4 years ago[clang][driver][ARM] Clean up ARM target & feature checking in clang driver.
Michael Liao [Wed, 5 Feb 2020 01:28:30 +0000 (20:28 -0500)]
[clang][driver][ARM] Clean up ARM target & feature checking in clang driver.

Summary:
- Similar to other targets, instead of passing a toolchain, a driver
  argument should be passed into `arm::getARMTargetFeatures`. Aslo, that
  routine should honor the specified triple. Refactor
  `arm::getARMFloatABI` with 2 separate interfaces. One has the original
  parameters and the other uses the driver and the specified triple.
- That fixes an issue when target & features are queried during the
  offload compilation, where the specified triple should be checked
  instead of a effective triple. A previously failed test is re-enabled.

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

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

4 years ago[lldb][NFC] Move call-overidden-method test to lang/cpp/ folder
Raphael Isemann [Thu, 6 Feb 2020 13:36:09 +0000 (14:36 +0100)]
[lldb][NFC] Move call-overidden-method test to lang/cpp/ folder

4 years ago[lldb] Add test for calling const functions
Raphael Isemann [Thu, 6 Feb 2020 09:52:30 +0000 (10:52 +0100)]
[lldb] Add test for calling const functions

4 years ago[llvm-exegesis] Document `repetition-mode`.
Clement Courbet [Thu, 6 Feb 2020 11:08:02 +0000 (12:08 +0100)]
[llvm-exegesis] Document `repetition-mode`.

Reviewers: gchatelet

Subscribers: tschuett, mstojanovic, llvm-commits

Tags: #llvm

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

4 years ago[LLD][ELF] Add time-trace to ELF LLD
Russell Gallop [Tue, 28 Jan 2020 16:05:13 +0000 (16:05 +0000)]
[LLD][ELF] Add time-trace to ELF LLD

This adds some of LLD specific scopes and picks up optimisation scopes
via LTO/ThinLTO. Makes use of TimeProfiler multi-thread support added in
77e6bb3c.

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

4 years agoRevert "[llvm-exegesis] Improve error reporting" and follow-up.
Hans Wennborg [Thu, 6 Feb 2020 11:53:05 +0000 (12:53 +0100)]
Revert "[llvm-exegesis] Improve error reporting" and follow-up.

It broke e.g. all tests under tools/llvm-exegesis/X86/ when libpfm is
not available, see comment on D74085.

This reverts commit b3576f60ebc8f660afad8120a72473be47517573 and
141915963b6ab36ee4e577d1b27673fa4d05b409.

4 years agoTry to fix ilist.h after 529e6f8791b6
Hans Wennborg [Thu, 6 Feb 2020 11:33:13 +0000 (12:33 +0100)]
Try to fix ilist.h after 529e6f8791b6

4 years agoStringRef.h: __builtin_strlen seems to exist in VS 2017 MSVC 19.16 or later
Hans Wennborg [Thu, 6 Feb 2020 11:27:02 +0000 (12:27 +0100)]
StringRef.h: __builtin_strlen seems to exist in VS 2017 MSVC 19.16 or later

This is a follow-up to ff837aa63cd, as discussed on the llvm-commits
thread for that one.

4 years ago[llvm-exegesis] Improve error reporting in Target.cpp
Miloš Stojanović [Thu, 6 Feb 2020 10:03:15 +0000 (11:03 +0100)]
[llvm-exegesis] Improve error reporting in Target.cpp

Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.

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

4 years ago[llvm-exegesis] Improve error reporting
Miloš Stojanović [Thu, 6 Feb 2020 09:48:41 +0000 (10:48 +0100)]
[llvm-exegesis] Improve error reporting

Fix inconsistencies in error reporting created by mixing
`report_fatal_error()` and `ExitOnErr()`, and add additional information
to the error message to make it more user friendly. Minimize the use
`report_fatal_error()` because it's meant for use in very rare cases and
it results in low information density of the error messages.

Summary of the new design:

 * For command line argument errors output `llvm-exegesis: <error_message>`,
   which is consistent with the error output format emitted by the backend
   which checks correctness of the command line arguments.
 * For other errors the format `llvm-exegesis error: <error_message>` is used.
 ** If the error occurred during file access `<error_message>` will have
    of two parts: `'<file_name>': <rest_of_the_error_message>`

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

4 years ago[ADT] Fix iplist_impl - use after move warnings (PR43943)
Simon Pilgrim [Thu, 6 Feb 2020 11:22:06 +0000 (11:22 +0000)]
[ADT] Fix iplist_impl - use after move warnings (PR43943)

As detailed on PR43943, we're seeing static analyzer use after move warnings in the iplist_impl move constructor/operator as they call std::move to both the TraitsT and IntrusiveListT base classes.

As suggested by @dexonsmith this patch casts the moved value to the base classes to silence the warnings.

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

4 years agoFix build after D74112
Kirill Bobyrev [Thu, 6 Feb 2020 10:41:17 +0000 (11:41 +0100)]
Fix build after D74112

4 years ago[clangd] Filter out implicit references while renaming
Kirill Bobyrev [Thu, 6 Feb 2020 09:28:47 +0000 (10:28 +0100)]
[clangd] Filter out implicit references while renaming

This patch is based on D72746 and prevents non-spelled references from
being renamed which would cause incorrect behavior otherwise.

Reviewed by: hokein

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

4 years ago[IRCE] Use SCEVExpander to modify loop bound
Denis Antrushin [Mon, 27 Jan 2020 19:06:02 +0000 (22:06 +0300)]
[IRCE] Use SCEVExpander to modify loop bound

IRCE pass checks that it can calculate loop bounds by checking
SCEV availability at loop entry. However it is possible that loop
bound SCEV is loop invariant, but instruction used to compute it
resides within loop. In such case adjusting loop bound in preheader
using IRBuilder leads to malformed SSA.
Use SCEVExpander instead to generate proper instructions.

Reviewed-by: mkazantsev
Differential Revision: https://reviews.llvm.org/D73496

4 years ago[mlir] Add AffineMaxOp
OuHangKresnik [Thu, 6 Feb 2020 09:25:55 +0000 (10:25 +0100)]
[mlir] Add AffineMaxOp

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

4 years ago[llvm-readobj][test] Fix test after yaml2obj change (D74034)
Fangrui Song [Thu, 6 Feb 2020 09:21:49 +0000 (01:21 -0800)]
[llvm-readobj][test] Fix test after yaml2obj change (D74034)

4 years ago[ARM] Fix non-determenistic behaviour
Diogo Sampaio [Thu, 6 Feb 2020 08:54:30 +0000 (08:54 +0000)]
[ARM] Fix non-determenistic behaviour

Summary:
ARM Type Promotion pass does not clear
the container that defines if one variable
was visited or not, missing optimization
opportunities by luck when two llvm:Values
from different functions  are allocated at
the same memory address.

Also fixes a comment and uses existing
method to pop and obtain last element
of the worklist.

Reviewers: samparker

Reviewed By: samparker

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[NFC] Fix error handling documentation
Miloš Stojanović [Thu, 6 Feb 2020 09:19:42 +0000 (10:19 +0100)]
[NFC] Fix error handling documentation

The default Error constructor can't be used since rL286561.

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

4 years agoFix lld test after D74034
Fangrui Song [Thu, 6 Feb 2020 09:14:42 +0000 (01:14 -0800)]
Fix lld test after D74034

4 years ago[yaml2obj] Refactor command line parsing
Fangrui Song [Tue, 4 Feb 2020 18:45:07 +0000 (10:45 -0800)]
[yaml2obj] Refactor command line parsing

* Hide unrelated options.
* Add "OVERVIEW: " to yaml2obj -h/--help.
* Place options under a yaml2obj category.
* Disallow -docnum. Currently -docnum is the only yaml2obj specific long option that is affected.
* Specify `cl::init("-")` and `cl::Prefix` for OutputFilename. The
  latter allows `-ofile`

Reviewed By: grimar, jhenderson

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

4 years ago[yaml2obj] - Change NameIndex to StName for Symbol.
Georgii Rymar [Wed, 5 Feb 2020 10:54:57 +0000 (13:54 +0300)]
[yaml2obj] - Change NameIndex to StName for Symbol.

It is consistent with the approach we use for Section struct.

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

4 years ago[SYCL][Driver] Add clang driver option to enable SYCL compilation mode
Alexey Bader [Tue, 4 Feb 2020 11:05:16 +0000 (14:05 +0300)]
[SYCL][Driver] Add clang driver option to enable SYCL compilation mode

Summary:
As a first step this implementation enables compilation of the offload
code.

Reviewers: ABataev

Subscribers: ebevhan, Anastasia, cfe-commits

Tags: #clang

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

4 years agoFix some typos in ArrayRef.h
Hans Wennborg [Thu, 6 Feb 2020 08:34:29 +0000 (09:34 +0100)]
Fix some typos in ArrayRef.h

4 years ago[LLDB] Fix compilation with GCC 5
Martin Storsjö [Wed, 5 Feb 2020 20:29:59 +0000 (22:29 +0200)]
[LLDB] Fix compilation with GCC 5

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

4 years agoFix build after D72746
Kirill Bobyrev [Thu, 6 Feb 2020 07:55:19 +0000 (08:55 +0100)]
Fix build after D72746

D72746 was missing a part of the patch before landing.

4 years ago[clangd] Add a flag for spelled references in the Index
Kirill Bobyrev [Thu, 6 Feb 2020 07:18:14 +0000 (08:18 +0100)]
[clangd] Add a flag for spelled references in the Index

This patch allows the index does to provide a way to distinguish
implicit references (e.g. coming from macro expansions) from the spelled
ones. The corresponding flag was added to RefKind and symbols that are
referenced without spelling their name explicitly are now marked
implicit. This allows fixing incorrect behavior when renaming a symbol
that was referenced in macro expansions would try to rename macro
invocations.

Differential Revision: D72746

Reviewed by: hokein

4 years ago[lldb/Reproducers] Serialize empty string for char* methods.
Jonas Devlieghere [Thu, 6 Feb 2020 05:20:12 +0000 (21:20 -0800)]
[lldb/Reproducers] Serialize empty string for char* methods.

For the methods taking a char* and a length that have a custom replayer,
ignore the incoming string in the instrumentation macro. This prevents
potentially reading garbage and blowing up the SB API log.

4 years ago[mlir] Build fix for mlir-opt
Kern Handa [Thu, 6 Feb 2020 03:02:23 +0000 (03:02 +0000)]
[mlir] Build fix for mlir-opt

mlir-opt needs to link against MLIRLoopAnalysis
This shouldn't be needed but MLIR "hack" for
"whole-archive" linking is not compatible with
CMake transitive dependencies management.

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

4 years ago[lldb/DWARF] Don't assume that a SymbolFileDWARFDwo contains one compile unit
Pavel Labath [Thu, 6 Feb 2020 03:45:22 +0000 (19:45 -0800)]
[lldb/DWARF] Don't assume that a SymbolFileDWARFDwo contains one compile unit

Summary:
This is a preparatory patch to re-enable DWP support in lldb (we already
have code claiming to do that, but it has been completely broken for a
while now).

The idea of the new approach is to make the SymbolFileDWARFDwo class
handle both dwo and dwo files, similar to how llvm uses one DWARFContext
to handle the two.

The first step is to remove the assumption that a SymbolFileDWARFDwo
holds just a single compile unit, i.e. the GetBaseCompileUnit method.
This requires changing the way how we reach the skeleton compile unit
(and the lldb_private::CompileUnit) from a dwo unit, which was
previously done via GetSymbolFile()->GetBaseCompileUnit() (and some
virtual dispatch).

The new approach reuses the "user data" mechanism of DWARFUnits, which
was used to link dwarf units (both skeleton and split) to their
lldb_private counterparts. Now, this is done only for non-dwo units, and
instead of that, the dwo units holds a pointer to the relevant skeleton
unit.

Reviewers: JDevlieghere, aprantl, clayborg

Reviewed By: JDevlieghere, clayborg

Subscribers: arphaman, lldb-commits

Tags: #lldb

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

4 years agoCompile-fix after StringRef's conversion operator has been made explicit.
Michael Kruse [Thu, 6 Feb 2020 04:23:29 +0000 (22:23 -0600)]
Compile-fix after StringRef's conversion operator has been made explicit.

Commit 777180a "[ADT] Make StringRef's std::string conversion operator explicit"
caused Polly's GPU code generator to not compile anymore. The rest of
Polly has already been fixed in commit
0257a9 "Fix polly build after StringRef change."

4 years ago[lldb/Reproducers] Implement custom replayers for (char *, size_t)
Jonas Devlieghere [Thu, 6 Feb 2020 03:41:09 +0000 (19:41 -0800)]
[lldb/Reproducers] Implement custom replayers for (char *, size_t)

Some SB API methods returns strings through a char* and a length. This
is a problem for the deserializer, which considers a single type at a
time, and therefore cannot know how many bytes to allocate for the
character buffer.

We can solve this problem by implementing a custom replayer, which
ignores the passed-in char* and allocates a buffer of the correct size
itself, before invoking the original API method or function.

This patch adds three new macros to register a custom replayer for
methods that take a char* and a size_t. It supports arbitrary return
values (some functions return a bool while others return a size_t).

4 years agoRevert "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"
Teresa Johnson [Thu, 6 Feb 2020 03:25:38 +0000 (19:25 -0800)]
Revert "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP"

This reverts commit 748bb5a0f1964d20dfb3891b0948ab6c66236c70.

Due to Chromium CFI+ThinLTO test crashes reported on patch.

4 years agoTwo more small fixes for debugserver attach failure messaging.
Jason Molenda [Thu, 6 Feb 2020 03:23:23 +0000 (19:23 -0800)]
Two more small fixes for debugserver attach failure messaging.

The developer mode check is now working.

Add another check for user id mismatch, e.g. a regular user
trying to attach to something running as root, and describe
the problem for the user.

4 years ago[mlir] Add explicit friendship to LLVM::ModuleTranslation to derived
River Riddle [Thu, 6 Feb 2020 02:32:15 +0000 (18:32 -0800)]
[mlir] Add explicit friendship to LLVM::ModuleTranslation to derived
classes.

This allows for the `LLVM::ModuleTranslation::translateModule` to properly access the constructors of the derived classes.

4 years ago[CMake] Link against ZLIB::ZLIB
Petr Hosek [Thu, 6 Feb 2020 01:59:27 +0000 (17:59 -0800)]
[CMake] Link against ZLIB::ZLIB

This is the imported target that find_package(ZLIB) defines.

4 years ago[mlir] Add support for basic location translation to LLVM.
River Riddle [Thu, 6 Feb 2020 01:10:55 +0000 (17:10 -0800)]
[mlir] Add support for basic location translation to LLVM.

Summary:
This revision adds basic support for emitting line table information when exporting to LLVMIR. We don't yet have a story for supporting all of the LLVM debug metadata, so this revision stubs some features(like subprograms) to enable emitting line tables.

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

4 years ago[mlir] Register the GDB listener with ExecutionEngine to enable debugging JIT'd code
River Riddle [Wed, 5 Feb 2020 01:28:25 +0000 (17:28 -0800)]
[mlir] Register the GDB listener with ExecutionEngine to enable debugging JIT'd code

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

4 years ago[GWP-ASan] Fix unused variables from crash handler + clang-format
Mitch Phillips [Thu, 6 Feb 2020 01:31:27 +0000 (17:31 -0800)]
[GWP-ASan] Fix unused variables from crash handler + clang-format

Summary: NFC - See title

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: merge_guards_bot, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[mlir] [VectorOps] generalized vector.contract semantics
aartbik [Thu, 6 Feb 2020 00:45:39 +0000 (16:45 -0800)]
[mlir] [VectorOps] generalized vector.contract semantics

Summary:
Previously, vector.contract did not allow an empty set of
free or batch dimensions (K = 0) which defines a basic
reduction into a scalar (like a dot product). This CL
relaxes that restriction. Also adds constraints on
element type of operands and results. With tests.

Reviewers: nicolasvasilache, andydavis1, rriddle

Reviewed By: andydavis1

Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[GWP-ASan] Change crash handler constant.
Mitch Phillips [Thu, 6 Feb 2020 00:46:51 +0000 (16:46 -0800)]
[GWP-ASan] Change crash handler constant.

Constant is too large to fit into uintptr_t on 32-bit.

4 years agoRevert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"
Pavel Labath [Thu, 6 Feb 2020 00:13:50 +0000 (16:13 -0800)]
Revert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"

This patch has a couple of outstanding issues. The test is not python3
compatible, and it also seems to fail with python2 (at least under some
circumstances) due to an overambitious assertion.

This reverts the patch as well as subsequent fixup attempts:
014ea9337624fe20aca8892e73b6b3f741d8da9e,
f5f70d1c8fbf12249b4b9598f10a10f12d4db029.
4697e701b8cb40429818609814c7422e49b2ee07.
5c15e8e682e365b3a7fcf35200df79f3fb93b924.
3ec28da6d6430a00b46780555a87acd43fcab790.

4 years ago[mlir][VectorOps] Support vector transfer_read/write unrolling for memrefs with vecto...
Andy Davis [Thu, 6 Feb 2020 00:06:40 +0000 (16:06 -0800)]
[mlir][VectorOps] Support vector transfer_read/write unrolling for memrefs with vector element type.

Summary:
[mlir][VectorOps] Support vector transfer_read/write unrolling for memrefs with vector element type.  When unrolling vector transfer read/write on memrefs with vector element type, the indices used to index the memref argument must be updated to reflect the unrolled operation.   However, in the case of memrefs with vector element type, we need to be careful to only update the relevant memref indices.

For example, a vector transfer read with the following source/result types, memref<6x2x1xvector<2x4xf32>>, vector<2x1x2x4xf32>, should only update memref indices 1 and 2 during unrolling.

Reviewers: nicolasvasilache, aartbik

Reviewed By: nicolasvasilache, aartbik

Subscribers: lebedev.ri, Joonsoo, merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits

Tags: #llvm

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

4 years ago[analyzer] Move fuchsia.Lock checker to alpha
Gabor Horvath [Tue, 4 Feb 2020 23:57:31 +0000 (15:57 -0800)]
[analyzer] Move fuchsia.Lock checker to alpha

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

4 years ago[lldb] Remove "print xml" from TestWasm.py
Pavel Labath [Thu, 6 Feb 2020 00:08:24 +0000 (16:08 -0800)]
[lldb] Remove "print xml" from TestWasm.py

It's not py3 compatible, and the test should not be printing this to stdout
(unless in --trace mode) anyway.

4 years ago[lldb/Test] Mark heap-cstr.test as requiring Python
Jonas Devlieghere [Thu, 6 Feb 2020 00:05:45 +0000 (16:05 -0800)]
[lldb/Test] Mark heap-cstr.test as requiring Python

4 years ago[ConstantFold][NFC] Move scalable vector unit tests under vscale.ll
Huihui Zhang [Thu, 6 Feb 2020 00:01:12 +0000 (16:01 -0800)]
[ConstantFold][NFC] Move scalable vector unit tests under vscale.ll

4 years ago[mlir] Adds affine loop fusion transformation function to LoopFusionUtils.
Andy Davis [Wed, 5 Feb 2020 23:51:18 +0000 (15:51 -0800)]
[mlir] Adds affine loop fusion transformation function to LoopFusionUtils.

Summary:
Adds affine loop fusion transformation function to LoopFusionUtils.
Updates TestLoopFusion utility to run loop fusion transformation until a fixed point is reached.
Adds unit tests to test the transformation.

Reviewers: bondhugula, dcaballe, nicolasvasilache

Reviewed By: bondhugula, dcaballe

Subscribers: Joonsoo, merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits

Tags: #llvm

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

4 years ago[analyzer] Prevent an assertion failure in PThreadLockChecker
Gabor Horvath [Tue, 4 Feb 2020 23:44:57 +0000 (15:44 -0800)]
[analyzer] Prevent an assertion failure in PThreadLockChecker

When the implementations of the locking functions are available.

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

4 years agoRevert "[lldb/Target] Add Assert StackFrame Recognizer"
Pavel Labath [Wed, 5 Feb 2020 23:43:55 +0000 (15:43 -0800)]
Revert "[lldb/Target] Add Assert StackFrame Recognizer"

This reverts commit 2b7f32892b76cdfbe075300a5bf4a52e1b674bc7 because of test
failures due to dangling pointers.

4 years ago[lldb] pass --lldb-libs-dir argument to lldb-dotest
Pavel Labath [Wed, 5 Feb 2020 23:15:01 +0000 (15:15 -0800)]
[lldb] pass --lldb-libs-dir argument to lldb-dotest

This argument was introduced in dcab9736f, but lldb-dotest was not handled.

4 years agoAdd missing directory from 3ec28da6
Derek Schuff [Wed, 5 Feb 2020 23:37:30 +0000 (15:37 -0800)]
Add missing directory from 3ec28da6

Also revert 4697e701b8, restoring the original patch from
https://reviews.llvm.org/D72751

4 years ago[mlir][VectorOps] Add ShapeCastOp to the vector ops dialect.
Andy Davis [Wed, 5 Feb 2020 23:35:50 +0000 (15:35 -0800)]
[mlir][VectorOps] Add ShapeCastOp to the vector ops dialect.

Summary:
Add ShapeCastOp to the vector ops dialect.

The shape_cast operation casts between an n-D source vector shape and a k-D result vector shape (the element type remains the same).

Reviewers: nicolasvasilache, aartbik

Reviewed By: nicolasvasilache

Subscribers: Joonsoo, merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits

Tags: #llvm

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

4 years ago[ConstantFold][SVE] Fix constant folding for bitcast.
Huihui Zhang [Wed, 5 Feb 2020 19:13:24 +0000 (11:13 -0800)]
[ConstantFold][SVE] Fix constant folding for bitcast.

Do not iterate on scalable vector type in BitCastConstantVector.
Continuation work of D70985, D71147.

Support for folding bitcast into splat value is kept in D74095, as
it depends on D71637.

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

4 years ago[GWP-ASan] Crash Handler API.
Mitch Phillips [Wed, 5 Feb 2020 23:39:03 +0000 (15:39 -0800)]
[GWP-ASan] Crash Handler API.

Summary:
Forewarning: This patch looks big in #LOC changed. I promise it's not that bad, it just moves a lot of content from one file to another. I've gone ahead and left inline comments on Phabricator for sections where this has happened.

This patch:
 1. Introduces the crash handler API (crash_handler_api.h).
 2. Moves information required for out-of-process crash handling into an AllocatorState. This is a trivially-copied POD struct that designed to be recovered from a deceased process, and used by the crash handler to create a GWP-ASan report (along with the other trivially-copied Metadata struct).
 3. Implements the crash handler API using the AllocatorState and Metadata.
 4. Adds tests for the crash handler.
 5. Reimplements the (now optionally linked by the supporting allocator) in-process crash handler (i.e. the segv handler) using the new crash handler API.
 6. Minor updates Scudo & Scudo Standalone to fix compatibility.
 7. Changed capitalisation of errors (e.g. /s/Use after free/Use After Free).

Reviewers: cryptoad, eugenis, jfb

Reviewed By: eugenis

Subscribers: merge_guards_bot, pcc, jfb, dexonsmith, mgorny, cryptoad, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoGlobalISel: Remove check for illegal MIR
Matt Arsenault [Fri, 24 Jan 2020 23:06:30 +0000 (18:06 -0500)]
GlobalISel: Remove check for illegal MIR

The verifier will catch this.

4 years agoPartially revert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"
Jonas Devlieghere [Wed, 5 Feb 2020 23:30:11 +0000 (15:30 -0800)]
Partially revert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"

This temporarily and partially reverts 3ec28da6d643 because it's missing
a directory.

4 years ago[AArch64][GlobalISel] Emit TBNZ with G_BRCOND where the condition is SLT
Jessica Paquette [Wed, 5 Feb 2020 21:54:00 +0000 (13:54 -0800)]
[AArch64][GlobalISel] Emit TBNZ with G_BRCOND where the condition is SLT

When we have a G_ICMP which checks SLT, and the comparison is against 0, we
can emit a TBNZ instead of a CBZ.

This lets us fold in things into the branch, which can provide some code size
savings.

This is similar to the case in `AArch64TargetLowering::LowerBR_CC`.

https://reviews.llvm.org/D74090

4 years ago[lldb/API] Fix non null-terminated stop-reason in SBThread::GetStopDescription
Med Ismail Bennani [Wed, 5 Feb 2020 23:15:37 +0000 (00:15 +0100)]
[lldb/API] Fix non null-terminated stop-reason in SBThread::GetStopDescription

When trying to get the stop reason description using the SB API, the
buffer fetched was not null-terminated causing failures on the sanitized bot.

This patch should address those failures.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[AArch64][GlobalISel][NFC] Factor out TB(N)Z emission code into its own function
Jessica Paquette [Wed, 5 Feb 2020 19:32:50 +0000 (11:32 -0800)]
[AArch64][GlobalISel][NFC] Factor out TB(N)Z emission code into its own function

Factor it out into `emitTestBit` and add some asserts to the new function.

This will be useful for implementing TB(N)Z emission for SLT/SGT compares.

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

4 years ago[AArch64][GlobalISel] Fold G_LSHR into test bit calculation
Jessica Paquette [Wed, 5 Feb 2020 18:25:48 +0000 (10:25 -0800)]
[AArch64][GlobalISel] Fold G_LSHR into test bit calculation

Add support for walking through G_LSHR in `getTestBitReg`. Equivalent to the
code in `getTestBitOperand` in AArch64ISelLowering.

```
(tbz (lshr x, c), b) -> (tbz x, b+c) when b + c is < # bits in x
```

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

4 years ago[PHIElimination] Compile time optimization for huge functions.
Jonas Paulsson [Mon, 20 Jan 2020 20:56:09 +0000 (21:56 +0100)]
[PHIElimination]  Compile time optimization for huge functions.

This is a compile-time optimization for PHIElimination (splitting of critical
edges), which was reported at https://bugs.llvm.org/show_bug.cgi?id=44249. As
discussed there, the way to remedy the slowdowns with huge functions is to
pre-compute the live-in registers for each MBB in an efficient way in
PHIElimination.cpp and then pass that information along to
LiveVariabless::addNewBlock().

In all the huge test programs where this slowdown has been noticable, it has
dissapeared entirely with this patch.

Review: Björn Pettersson, Quentin Colombet.

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

4 years ago[lldb/CMake] Remove non-existing wasm-DYLD subdir
Jonas Devlieghere [Wed, 5 Feb 2020 23:08:18 +0000 (15:08 -0800)]
[lldb/CMake] Remove non-existing wasm-DYLD subdir

4 years ago[lldb/debugserver] Link against Security
Jonas Devlieghere [Wed, 5 Feb 2020 22:34:15 +0000 (14:34 -0800)]
[lldb/debugserver] Link against Security

4 years ago[lldb/Reproducers] (De)serialize char* like const char*
Jonas Devlieghere [Wed, 5 Feb 2020 17:53:10 +0000 (09:53 -0800)]
[lldb/Reproducers] (De)serialize char* like const char*

The current implementation has a discrepancy between how char pointers
are serialized and deserialized. The latter treats it like a const char*
while the former serializes it as a pointer to a basic type.

Both are potentially wrong, as char pointers are mostly used in
combination with a size, and nothing guarantees that the string's length
(its first null byte to be more precise) is greater or equal to its
size. The real solution is to have a custom (de)serializer that uses
both pieces of infromation.

However, the implementation should be consistent between serialization
and deserialization and I believe treating char* as const char* is the
better alternative.

4 years ago[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging
Paolo Severini [Wed, 5 Feb 2020 18:33:13 +0000 (10:33 -0800)]
[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging

Add a dynamic loader plug-in class for WebAssembly modules.

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

4 years agoAMDGPU: Make LDS_DIRECT an artifical register
Matt Arsenault [Sat, 25 Jan 2020 19:17:16 +0000 (14:17 -0500)]
AMDGPU: Make LDS_DIRECT an artifical register

4 years agoGlobalISel: Allow CSE of G_IMPLICIT_DEF
Matt Arsenault [Tue, 4 Feb 2020 03:49:00 +0000 (22:49 -0500)]
GlobalISel: Allow CSE of G_IMPLICIT_DEF

The legalizer produces a lot of these, and they make reading legalized
MIR annoying. For some reason, this does seem to sometimes introduce
copies of implicit def, which is dumb.

4 years agoDebugInfo: Stabilize DW_OP_convert tests so they don't depend on register allocation...
David Blaikie [Wed, 5 Feb 2020 22:27:29 +0000 (14:27 -0800)]
DebugInfo: Stabilize DW_OP_convert tests so they don't depend on register allocation, etc

4 years ago[ELF][ARM] Fix regression of BL->BLX substitution after D73542
Fangrui Song [Wed, 5 Feb 2020 21:50:33 +0000 (13:50 -0800)]
[ELF][ARM] Fix regression of BL->BLX substitution after D73542

D73542 made a typo (`rel.type == R_PLT_PC`; should be `rel.expr`) and introduced a regression:
BL->BLX substitution was disabled when the target symbol is preemptible
(expr is R_PLT_PC).

The two added bl instructions in arm-thumb-interwork-shared.s check that
we patch BL to BLX.

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1047531

4 years ago[SystemZ] Improve handling of inline asm constraints.
Jonas Paulsson [Tue, 4 Feb 2020 23:12:36 +0000 (00:12 +0100)]
[SystemZ]  Improve handling of inline asm constraints.

The "{=v0}" constraint did not result in the expected error message in the
abscence of the vector facility, because 'v0' matches as a string into the
AnyRegBitRegClass in common code.

This patch adds checks for vector support in case of "{v" and soft-float in
case of "{f" to remedy this.

Review: Ulrich Weigand.

4 years ago[MemCpyOpt] Simplify find*Alignment
Juneyoung Lee [Wed, 5 Feb 2020 21:41:58 +0000 (06:41 +0900)]
[MemCpyOpt] Simplify find*Alignment

4 years ago[X86] Improve the gather scheduler models for SkylakeClient and SkylakeServer
Craig Topper [Wed, 5 Feb 2020 20:15:01 +0000 (12:15 -0800)]
[X86] Improve the gather scheduler models for SkylakeClient and SkylakeServer

The load ports need a cycle for each potentially loaded element just like Haswell and Skylake. Unlike Haswell and Broadwell, the number of uops does not scale with the number of elements. Instead the load uops run for multiple cycles.

I've taken the latency number from the uops.info. The port binding for the non-load uops is taken from the original IACA data I have.

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

4 years agoAMDGPU/GlobalISel: Remove bitcast legality hack
Matt Arsenault [Tue, 21 Jan 2020 22:23:07 +0000 (17:23 -0500)]
AMDGPU/GlobalISel: Remove bitcast legality hack

4 years agoMemCpyOpt cannot use ABI alignment even if it was not given
Juneyoung Lee [Wed, 5 Feb 2020 21:20:36 +0000 (06:20 +0900)]
MemCpyOpt cannot use ABI alignment even if it was not given

Summary: This patch fixes https://bugs.llvm.org/show_bug.cgi?id=44388 which incorrectly assigns an ABI alignment to memset when there was no explicit alignment given.

Reviewers: gchatelet, lenary, nikic

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[mlir] Update generic op ebnf to include region
Jacques Pienaar [Wed, 5 Feb 2020 16:31:49 +0000 (08:31 -0800)]
[mlir] Update generic op ebnf to include region

Summary: Optional regions are supported in the generic op print/parse form, update the docs to match.

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

4 years agoMake llvm::crc32() work also for input sizes larger than 32 bits.
Hans Wennborg [Wed, 5 Feb 2020 10:03:49 +0000 (11:03 +0100)]
Make llvm::crc32() work also for input sizes larger than 32 bits.

The problem was noticed by the Chrome OS toolchain folks
(crbug.com/1048445) because llvm-objcopy --add-gnu-debuglink would
insert the wrong checksum when processing a binary larger than 4 GB.
That use case regressed in 1e1e3ba2526 when we started using
llvm::crc32() in more places.

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

4 years agoAMDGPU/GlobalISel: Add mem operand to s.buffer.load intrinsic
Matt Arsenault [Sun, 2 Feb 2020 17:13:48 +0000 (12:13 -0500)]
AMDGPU/GlobalISel: Add mem operand to s.buffer.load intrinsic

Really the intrinsic definition is wrong, but work around this
here. The DAG lowering introduces an MMO. We have to introduce a new
operation to avoid the verifier complaining about the missing mayLoad.

4 years ago[x86] use getSplatIndex() in lowerShuffleAsBroadcast()
Sanjay Patel [Wed, 5 Feb 2020 19:41:50 +0000 (14:41 -0500)]
[x86] use getSplatIndex() in lowerShuffleAsBroadcast()

The old code was doing an N^2 search for splat index.

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

4 years ago[Analysis] add query to get splat value from array of ints
Sanjay Patel [Wed, 5 Feb 2020 19:18:13 +0000 (14:18 -0500)]
[Analysis] add query to get splat value from array of ints

I was debug stepping through an x86 shuffle lowering and
noticed we were doing an N^2 search for splat index. I
didn't find the equivalent functionality anywhere else in
LLVM, so here's a helper that takes an array of int and
returns a splatted index while ignoring undefs (any
negative value).

This might also be used inside existing
ShuffleVectorInst/ShuffleVectorSDNode functions and/or
help with D72467.

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

4 years ago[PowerPC][NFC] Clang-format on commit 4b414d
Victor Huang [Wed, 5 Feb 2020 19:47:54 +0000 (13:47 -0600)]
[PowerPC][NFC] Clang-format on commit 4b414d

4 years ago[VFS] More consistent support for Windows
Adrian McCarthy [Wed, 22 Jan 2020 00:45:51 +0000 (16:45 -0800)]
[VFS] More consistent support for Windows

Removed some #ifdefs specific to Windows handling of VFS paths.  This
eliminates most of the differences between the Windows and non-Windows
code paths.

Making this work required some changes to account for the fact that VFS
file paths can be Posix style or Windows style, so you cannot just assume
that they use the host's native path style.  In one case, this means
implementing our own version of make_absolute, since the filesystem code
in Support doesn't have styles in the sense that the path code does.

Differential Review: https://reviews.llvm.org/D71092

4 years agoAMDGPU/GlobalISel: Legalize f64 G_FFLOOR for SI
Matt Arsenault [Fri, 24 Jan 2020 15:01:15 +0000 (10:01 -0500)]
AMDGPU/GlobalISel: Legalize f64 G_FFLOOR for SI

Use cmp ord instead of cmp_class compared to the DAG version for the
nan check, but mostly try to match the existsing pattern.

I think the sign doesn't matter for fract, so we could do a little
better with the source modifier matching.

I think this is also still broken as in D22898, but I'm leaving it
as-is for now while I don't have an SI system to test on.

4 years ago[NFC][RISCV] Fixing typo in comment.
Nate Voorhies [Tue, 4 Feb 2020 19:30:30 +0000 (11:30 -0800)]
[NFC][RISCV] Fixing typo in comment.

Reviewers: luismarques, lenary

Reviewed By: lenary

Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits

Tags: #llvm

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