platform/upstream/llvm.git
3 years ago[mips] Implement add.ps, mul.ps and sub.ps
Michael Roe [Fri, 30 Oct 2020 07:57:22 +0000 (10:57 +0300)]
[mips] Implement add.ps, mul.ps and sub.ps

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

3 years ago[NFC] Fix "ambiguous overload for ‘operator=’"
Vitaly Buka [Fri, 30 Oct 2020 07:36:50 +0000 (00:36 -0700)]
[NFC] Fix "ambiguous overload for ‘operator=’"

From D89768

3 years ago[mlir][ASM] Refactor how attribute/type aliases are specified.
River Riddle [Fri, 30 Oct 2020 07:30:59 +0000 (00:30 -0700)]
[mlir][ASM] Refactor how attribute/type aliases are specified.

Previously they were separated into "instance" and "kind" aliases, and also required that the dialect know ahead of time all of the instances that would have a corresponding alias. This approach was very clunky and not ergonomic to interact with. The new approach is to provide the dialect with an instance  of an attribute/type to provide an alias for, fully replacing the original split approach.

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

3 years ago[NFC] Fix "ambiguous overload for ‘operator=’"
Vitaly Buka [Fri, 30 Oct 2020 07:36:50 +0000 (00:36 -0700)]
[NFC] Fix "ambiguous overload for ‘operator=’"

3 years ago[Coroutine] Properly determine whether an alloca should live on the frame
Xun Li [Fri, 30 Oct 2020 06:54:28 +0000 (23:54 -0700)]
[Coroutine] Properly determine whether an alloca should live on the frame

The existing logic in determining whether an alloca should live on the frame only looks explicit def-use relationships. However a value defined by an alloca may be implicitly needed across suspension points, either because an alias has across-suspension-point def-use relationship, or escaped by store/call/memory intrinsics. To properly handle all these cases, we have to properly visit the alloca pointer up-front. Thie patch extends the exisiting alloca use visitor to determine whether an alloca should live on the frame.

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

3 years ago[llvm-readobj][test][NFC] - Use "--check-prefix" instead of "--check-prefixes".
Georgii Rymar [Fri, 30 Oct 2020 06:50:00 +0000 (09:50 +0300)]
[llvm-readobj][test][NFC] - Use "--check-prefix" instead of "--check-prefixes".

We have the `--check-prefixes` invocation for a single suffix.
It is cleaner to use `--check-prefix` in this case.

3 years ago[NFC] Don't run python binding tests with sanitizers
Vitaly Buka [Fri, 30 Oct 2020 06:46:22 +0000 (23:46 -0700)]
[NFC] Don't run python binding tests with sanitizers

Almost any sanitizer can try to install interceptors.

3 years ago[OpenMP][Docs] Structure and content for the OpenMP documentation
Johannes Doerfert [Tue, 27 Oct 2020 18:16:03 +0000 (13:16 -0500)]
[OpenMP][Docs] Structure and content for the OpenMP documentation

This adds some initial content as well as structure to the new OpenMP
Sphinx documentation hosted at http://openmp.llvm.org/docs/ .

The content contains some useful links but most pages are still empty.

This uses a "custom" theme which is a copy of the default "agogo" one
with minor modifications to get a nicer table of content in the sidebar.
This way we can also adjust the theme as we go.

Reviewed By: jhuber6, JonChesterfield

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

3 years ago[OpenMP][NFC] Clang format ParseOpenMP
Johannes Doerfert [Thu, 29 Oct 2020 23:44:28 +0000 (18:44 -0500)]
[OpenMP][NFC] Clang format ParseOpenMP

ParseOpenMP.cpp was pretty much clang-formatted except a few minor
locations. Let's make it a clang formatted file.

Reviewed By: JonChesterfield

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

3 years ago[MC] Fix an assert in MCAssembler::writeSectionData to be aware of errors
Fangrui Song [Fri, 30 Oct 2020 06:09:57 +0000 (23:09 -0700)]
[MC] Fix an assert in MCAssembler::writeSectionData to be aware of errors

If MCContext has an error, MCAssembler::layout may stop early
and some MCFragment's may not finalize.

In the Linux kernel, arch/x86/lib/memcpy_64.S could trigger the assert before
"x86_64: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S"

3 years ago[Flang][OpenMP][OpenACC] Fix exit out of a region in OpenMP parallel construct.
sameeran joshi [Fri, 30 Oct 2020 04:50:05 +0000 (10:20 +0530)]
[Flang][OpenMP][OpenACC] Fix exit out of a region in OpenMP parallel construct.

From below mentioned standard references
OpenACC 3.0 Standards document
840 • A program may not branch into or out of an OpenACC parallel construct

OpenMP 5.0 Standards document
A program that branches into or out of a parallel region is non-conforming.

This patch
Resolves the issue of exit out of a parallel region, other branching out issues like goto statements are not handled with this patch.
Moves code from D87906 to be reused by other OpenMP/OpenACC to check-directive-structure.h.
Adds support in OpenMP parallel construct and a test case to verify.

Reviewed By: clementval

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

3 years ago[NFC] Don't run clang/bindings/python/tests with msan
Vitaly Buka [Fri, 30 Oct 2020 01:13:23 +0000 (18:13 -0700)]
[NFC] Don't run clang/bindings/python/tests with msan

Fixes check-all with LLVM_USE_SANITIZER=Memory

3 years agoFix "incorrect" assertions in Linalg/EDSC/Builders.cpp (NFC)
Mehdi Amini [Fri, 30 Oct 2020 05:16:59 +0000 (05:16 +0000)]
Fix "incorrect" assertions in Linalg/EDSC/Builders.cpp (NFC)

It is semantically equivalent, but the intent was really lost there.
This fixes a warning/error from MSVC as well, see PR48013

3 years ago[test] Fix unused check prefixes in test/Linker/ and test/Other/
Fangrui Song [Fri, 30 Oct 2020 04:54:45 +0000 (21:54 -0700)]
[test] Fix unused check prefixes in test/Linker/ and test/Other/

3 years agoFix shared build.
Michael Liao [Fri, 30 Oct 2020 04:44:42 +0000 (00:44 -0400)]
Fix shared build.

3 years ago[RISCV] Fix unused check prefixes in test/MC/RISCV/
Fangrui Song [Fri, 30 Oct 2020 04:18:00 +0000 (21:18 -0700)]
[RISCV] Fix unused check prefixes in test/MC/RISCV/

3 years ago[llvm] Export LLVM_LIT_ARGS in LLVMConfig.cmake
Jonas Devlieghere [Fri, 30 Oct 2020 03:24:37 +0000 (20:24 -0700)]
[llvm] Export LLVM_LIT_ARGS in LLVMConfig.cmake

Allow standalone builds to inherit the LLVM_LIT_ARGS.

3 years ago[MC] Add SMLoc to MCStreamer::emitSymbolAttribute and report changed binding warnings...
Fangrui Song [Fri, 30 Oct 2020 02:41:59 +0000 (19:41 -0700)]
[MC] Add SMLoc to MCStreamer::emitSymbolAttribute and report changed binding warnings/errors for ELF

3 years ago[gn build] Port 00090a2b826
LLVM GN Syncbot [Fri, 30 Oct 2020 02:36:24 +0000 (02:36 +0000)]
[gn build] Port 00090a2b826

3 years agoSupport complex target features combinations
Liu, Chen3 [Sat, 10 Oct 2020 10:42:05 +0000 (18:42 +0800)]
Support complex target features combinations

This patch is mainly doing two things:

1. Adding support for parentheses, making the combination of target features
   more diverse;
2. Making the priority of ’,‘ is higher than that of '|' by default. So I need
   to make some change with PTX Builtin function.

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

3 years ago[lldb] XFAIL TestTypeGetModule.py (temporarily)
Jonas Devlieghere [Fri, 30 Oct 2020 01:37:44 +0000 (18:37 -0700)]
[lldb] XFAIL TestTypeGetModule.py (temporarily)

Temporarily XFAIL'ing TestTypeGetModule.py while the DWO failure is
being investigated.

3 years ago[lldb] Update TestTypeGetModule.py
Ilya Bukonkin [Fri, 30 Oct 2020 01:27:47 +0000 (18:27 -0700)]
[lldb] Update TestTypeGetModule.py

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

3 years ago[PruneEH] Pin tests to legacy PM
Arthur Eubanks [Fri, 23 Oct 2020 05:26:21 +0000 (22:26 -0700)]
[PruneEH] Pin tests to legacy PM

prune-eh will not be ported to the NPM. Instead, a combination of
function-attrs and simplifycfg should be used (as described in
https://reviews.llvm.org/D44415).

This pins most tests using -prune-eh to the legacy PM. Some of these
were testing legacy PM infra (mostly the CGPassManager). Some of these
can be tested in the NPM using function-attrs and simplifycfg.

One interesting case is simplenoreturntest.ll. function-attrs +
simplifycfg does not yet make a caller of a caller of a noreturn
function end with unreachable like prune-eh does. That can be added in
the future.

Reviewed By: asbirlea

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

3 years ago[AA] Pass query info.
Alina Sbirlea [Fri, 30 Oct 2020 00:55:07 +0000 (17:55 -0700)]
[AA] Pass query info.

Pass AAQI in places where it was missed.

Part of D89991.
Author: haoranxu510 (Haoran Xu)

3 years ago[dwarfdump] Recognize __apple sections as debug info sections
Jonas Devlieghere [Fri, 30 Oct 2020 00:48:21 +0000 (17:48 -0700)]
[dwarfdump] Recognize __apple sections as debug info sections

Recognize the __apple_ sections as debug info sections and make sure
they're included in the --show-sections-sizes output.

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

3 years ago[llvm-readobj][NFC] Remove unused prefix from FileCheck tests
Keith Smiley [Fri, 30 Oct 2020 00:47:26 +0000 (17:47 -0700)]
[llvm-readobj][NFC] Remove unused prefix from FileCheck tests

This is to enable --allow-unused-duplicates=false. This prefix appears
to be outdated and intentionally unused.

Reviewed By: rupprecht

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

3 years agoAdd InsertionPoint and context managers to the Python API.
Stella Laurenzo [Thu, 29 Oct 2020 06:16:36 +0000 (23:16 -0700)]
Add InsertionPoint and context managers to the Python API.

* Removes index based insertion. All insertion now happens through the insertion point.
* Introduces thread local context managers for implicit creation relative to an insertion point.
* Introduces (but does not yet use) binding the Context to the thread local context stack. Intent is to refactor all methods to take context optionally and have them use the default if available.
* Adds C APIs for mlirOperationGetParentOperation(), mlirOperationGetBlock() and mlirBlockGetTerminator().
* Removes an assert in PyOperation creation that was incorrectly constraining. There is already a TODO to rework the keepAlive field that it was guarding and without the assert, it is no worse than the current state.

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

3 years ago[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files
Wouter van Oortmerssen [Mon, 26 Oct 2020 21:38:09 +0000 (14:38 -0700)]
[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files

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

3 years agoclang-tidy: Make tests more hermetic
Nico Weber [Fri, 30 Oct 2020 00:12:50 +0000 (20:12 -0400)]
clang-tidy: Make tests more hermetic

Make check_clang_tidy.py not just pass -format-style=none by default
but a full -config={}. Without this, with a build dir outside of
the llvm root dir and a .clang-tidy config further up that contains

  CheckOptions:
    - key:          modernize-use-default-member-init.UseAssignment
      value:        1

these tests would fail:

   Clang Tools :: clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-modernize-use-default-member-init.cpp
   Clang Tools :: clang-tidy/checkers/modernize-use-default-member-init-bitfield.cpp
   Clang Tools :: clang-tidy/checkers/modernize-use-default-member-init.cpp

After this change, they pass fine, despite the unrelated
.clang-tidy file further up.

3 years ago[Hexagon] Handle additional shuffles that can be made perfect
Krzysztof Parzyszek [Thu, 29 Oct 2020 21:09:46 +0000 (16:09 -0500)]
[Hexagon] Handle additional shuffles that can be made perfect

3 years agoThis is a preliminary version of the test for https://reviews.llvm.org/D88483.
Jim Ingham [Thu, 29 Oct 2020 23:37:34 +0000 (16:37 -0700)]
This is a preliminary version of the test for https://reviews.llvm.org/D88483.

The test can be cleaned up a bit, but this should be good to see why the
Debian bot is failing...

3 years agoThread safety analysis: Consider static class members as inaccessible
Aaron Puchert [Thu, 29 Oct 2020 23:35:14 +0000 (00:35 +0100)]
Thread safety analysis: Consider static class members as inaccessible

This fixes the issue pointed out in D84604#2363134. For now we exclude
static members completely, we'll take them into account later.

3 years ago[NFC] Fix typo function -> module
Arthur Eubanks [Thu, 29 Oct 2020 23:10:17 +0000 (16:10 -0700)]
[NFC] Fix typo function -> module

3 years ago[NFC][AMDGPU] Resize Memory Model columns in AMDGPUUsage.rst
Scott Linder [Thu, 29 Oct 2020 21:45:46 +0000 (21:45 +0000)]
[NFC][AMDGPU] Resize Memory Model columns in AMDGPUUsage.rst

Make all of the "AMDGPU Machine Code GFX*" columns in the Memory Model
table a consistent width of 32-characters.

Best viewed with something like --word-diff

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

3 years ago[AMDGPU] Update Memory Model in AMDGPUUsage.rst
Scott Linder [Thu, 22 Oct 2020 16:42:05 +0000 (16:42 +0000)]
[AMDGPU] Update Memory Model in AMDGPUUsage.rst

Mostly NFC, but some changes are "bug fixes" rather than just e.g.
formatting changes or typo corrections.

- Fix typo "competing" -> "completing".
- Document why waintcnt is added to stores and not loads for
  sequentially consistent ordering.
- Lowercase some mentions of `buffer_gl{0,1}_inv`.
- Make mentions of `*cnt(0)` consistently include the `(0)` count.
- Remove some mentions of instructions for incorrect address spaces. For
  example, remove mention of `flat_load` from
  `load atomic acquire workgroup global`.
- Re-flow some text to get all the target columns to fit in a
  32-character wide column. Makes a future NFC patch to make these columns
  both 32-character wide more straightforward.

Modified cherry-pick of patch by Tony Tye

Reviewed By: t-tye

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

3 years ago[GWP-ASan] Add mutexes for Fuchsia
Kostya Kortchinsky [Wed, 28 Oct 2020 23:04:02 +0000 (16:04 -0700)]
[GWP-ASan] Add mutexes for Fuchsia

Mitch expressed a preference to not have `#ifdef`s in platform agnostic
code, this change tries to accomodate this.

I am not attached to the method this CL proposes, so if anyone has a
suggestion, I am open.

We move the platform specific member of the mutex into its own platform
specific class that the main `Mutex` class inherits from. Functions are
implemented in their respective platform specific compilation units.

For Fuchsia, we use the sync APIs, as those are also the ones being
used in Scudo.

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

3 years ago[OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in complex wrapper headers.
Joachim Meyer [Thu, 29 Oct 2020 18:45:49 +0000 (19:45 +0100)]
[OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in complex wrapper headers.

This is very similar to 7f1e6fcff942, just fixing a left-over.
With this, it should be possible to use both, -x cuda and -fopenmp in the same invocation,
enabling to use both OpenMP, targeting CPU, and CUDA, targeting the GPU.

Reviewed By: jdoerfert

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

3 years agoProvide a reasonable value for PATH_MAX if the lldb headers don't provide it.
Jim Ingham [Thu, 29 Oct 2020 22:02:51 +0000 (15:02 -0700)]
Provide a reasonable value for PATH_MAX if the lldb headers don't provide it.

3 years ago[mlir][vector] Improve vector distribute integration test and fix block distribution
Thomas Raoux [Thu, 29 Oct 2020 21:28:01 +0000 (14:28 -0700)]
[mlir][vector] Improve vector distribute integration test and fix block distribution

Fix semantic in the distribute integration test based on offline feedback. This
exposed a bug in block distribution, we need to make sure the id is multiplied
by the stride of the vector. Fix the transformation and unit test.

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

3 years ago[RISCV] Improve worklist management in the DAG combine for SLLW/SRLW/SRAW
Craig Topper [Thu, 29 Oct 2020 21:16:12 +0000 (14:16 -0700)]
[RISCV] Improve worklist management in the DAG combine for SLLW/SRLW/SRAW

This combine makes two calls to SimplifyDemandedBits, one for the LHS and one
for the RHS. If the LHS call returns true, we don't make the RHS call. When
SimplifyDemandedBits makes a change, it will add the nodes around the change to
the DAG combiner worklist. If the simplification happens on the first recursion
step, the N will get added to the worklist. But if the simplification happens
deeper in the recursion, then N will not be revisited until the next time the
DAG combiner runs.

This patch explicitly addes N to the worklist anytime a Simplification is made.
Without this we might miss additional simplifications on the LHS or never
simplify the RHS. Special care also needs to be taken to not add N if it has
been CSEd by the simplification. There are similar examples in DAGCombiner and
the X86 target, but I don't have a test for it for RISC-V. I've also returned
SDValue(N, 0) instead of SDValue() so DAGCombiner knows a change was made and
will update its Statistic variable.

The test here was constructed so that 2 simplifications happen to the LHS.
Without this fix one happens in the post type legalization DAG combine and the
other happens after LegalizeDAG. This prevents the RHS from ever being
simplified causing the left and right shift to clear the upper 32 bits of the
RHS to be left behind.

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

3 years ago[RISCV] Add test case for D90339
Craig Topper [Thu, 29 Oct 2020 21:15:37 +0000 (14:15 -0700)]
[RISCV] Add test case for D90339

3 years agoUse !hasLocalLinkage instead of listing the symbol types
Jim Ingham [Thu, 29 Oct 2020 21:43:03 +0000 (14:43 -0700)]
Use !hasLocalLinkage instead of listing the symbol types
we should be exporting one by one.

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

3 years agoMark the execution of stop-hooks as non-interactive.
Jim Ingham [Wed, 28 Oct 2020 18:58:25 +0000 (11:58 -0700)]
Mark the execution of stop-hooks as non-interactive.

The intention is not to allow stop-hook commands to query the
user, so this is correct.  It also works around a deadlock in
switching to the Python Session to execute python based commands
in the stop hook when the Debugger stdin is backed by a FILE *.

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

3 years ago[mlir][gpu] Add pass to make GPU ops within a region execute asynchronously.
Christian Sigg [Thu, 29 Oct 2020 17:13:01 +0000 (18:13 +0100)]
[mlir][gpu] Add pass to make GPU ops within a region execute asynchronously.

Do not use the pass yet, except in a test.

Reviewed By: herhut

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

3 years ago[mlir][gpu] Handle async in gpu.launch_func lowering.
Christian Sigg [Thu, 29 Oct 2020 16:58:48 +0000 (17:58 +0100)]
[mlir][gpu] Handle async in gpu.launch_func lowering.

For the synchronous case, destroy the stream after synchronization.

Sneak in a unrelated change to report why the gpu.wait conversion pattern didn't match.

Reviewed By: herhut

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

3 years ago[SDAG] Extract helper to determine neutral element (NFC)
Nikita Popov [Thu, 29 Oct 2020 20:59:58 +0000 (21:59 +0100)]
[SDAG] Extract helper to determine neutral element (NFC)

Make the existing VECREDUCE based code more generic, but expressing
it in terms of the neutral value of the base opcode instead.

3 years ago[LCSSA] Doc for special treatment of PHIs
Stefanos Baziotis [Thu, 29 Oct 2020 20:50:07 +0000 (22:50 +0200)]
[LCSSA] Doc for special treatment of PHIs

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

3 years ago[mlir][gpu] Allow gpu.launch_func to be async.
Christian Sigg [Thu, 22 Oct 2020 05:49:50 +0000 (07:49 +0200)]
[mlir][gpu] Allow gpu.launch_func to be async.

This is a roll-forward of rGec7780ebdab4, now that the remaining
gpu.launch_func have been converted to custom form in rGb22f111023ba.

Reviewed By: antiagainst

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

3 years ago[LoopUtils] Fix neutral value for vector.reduce.fadd
Nikita Popov [Thu, 29 Oct 2020 20:41:58 +0000 (21:41 +0100)]
[LoopUtils] Fix neutral value for vector.reduce.fadd

Use -0.0 instead of 0.0 as the start value. The previous use of 0.0
was fine for all existing uses of this function though, as it is
always generated with fast flags right now, and thus nsz.

3 years agoGetModule, GetExeModule methods added
Ilya Bukonkin [Tue, 29 Sep 2020 12:51:49 +0000 (15:51 +0300)]
GetModule, GetExeModule methods added

3 years ago[SLP] Consider alternatives for cost of select instructions.
Florian Hahn [Thu, 29 Oct 2020 19:46:34 +0000 (19:46 +0000)]
[SLP] Consider alternatives for cost of select instructions.

Some architectures do not have general vector select instructions (e.g.
AArch64). But some cmp/select patterns can be vectorized using other
instructions/intrinsics.

One example is using min/max instructions for certain patterns.

This patch updates the cost calculations for selects in the SLP
vectorizer to consider using min/max intrinsics.

This patch does not change SLP vectorizer's codegen itself to actually
generate those intrinsics, but relies on the backends to lower the
vector cmps & selects. This keeps things simple on the SLP side and
works well in practice for AArch64.

This exposes additional SLP vectorization opportunities in some
benchmarks on AArch64 (-O3 -flto).

Metric: SLP.NumVectorInstructions

Program                                        base    slp     diff
 test-suite...ications/JM/ldecod/ldecod.test   502.00  697.00  38.8%
 test-suite...ications/JM/lencod/lencod.test   1023.00 1414.00 38.2%
 test-suite...-typeset/consumer-typeset.test    56.00   65.00  16.1%
 test-suite...6/464.h264ref/464.h264ref.test   804.00  822.00   2.2%
 test-suite...006/453.povray/453.povray.test   3335.00 3357.00  0.7%
 test-suite...CFP2000/177.mesa/177.mesa.test   2110.00 2121.00  0.5%
 test-suite...:: External/Povray/povray.test   2378.00 2382.00  0.2%

Reviewed By: RKSimon, samparker

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

3 years ago[WebAssembly] Remove unused FileCheck test prefixes
Thomas Lively [Thu, 29 Oct 2020 20:37:55 +0000 (13:37 -0700)]
[WebAssembly] Remove unused FileCheck test prefixes

This commit removes unused FileCheck prefixes from WebAssembly test files to
avoid causing test failures once FileCheck disallows unused prefixes by default.
See D90281 and the corresponding llvm-dev thread for context.

Reviewed By: aardappel

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

3 years ago[SDAG] Fix neutral value for vecreduce_fadd
Nikita Popov [Thu, 29 Oct 2020 20:27:59 +0000 (21:27 +0100)]
[SDAG] Fix neutral value for vecreduce_fadd

The neutral value for FADD is -0.0, not 0.0, so this is what we
need to pad vectors with.

3 years ago[CodeGen] Fix neutral value of vecreduce fadd in tests (NFC)
Nikita Popov [Thu, 29 Oct 2020 19:34:13 +0000 (20:34 +0100)]
[CodeGen] Fix neutral value of vecreduce fadd in tests (NFC)

The neutral value is -0.0, not 0.0. This doesn't matter for "fast"
reductions due to nsz, but does matter for reassoc-only and seq
reductions.

Change tests to mostly use -0.0 where the neutral value was intended,
and add some additional test coverage in some places. Also update
LangRef to use the right value.

3 years ago[mlir][gpu] NFC: Change gpu.launch_func ops to custom format.
Christian Sigg [Thu, 29 Oct 2020 18:16:19 +0000 (19:16 +0100)]
[mlir][gpu] NFC: Change gpu.launch_func ops to custom format.

This should fix the reason for the failures after ec7780ebdab480139596c3cb08ee77d7035457b3. I will roll forward in a separate change.

Reviewed By: antiagainst

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

3 years ago[AMDGPU] Update AMD GPU documentation
Tony [Wed, 28 Oct 2020 22:20:51 +0000 (22:20 +0000)]
[AMDGPU] Update AMD GPU documentation

- AMDGPUUsage.rst: Correct AMD GPU DWARF address space table address
  sizes which are in bits and not bytes.

- clang/.../Options.td: Improve description of AMD GPU options.

- Re-generate ClangComamndLineReference.rst from clang/.../Options.td .

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

3 years agoAdded remotely ran compiler-rt tests.
Alex Orlov [Thu, 29 Oct 2020 20:11:16 +0000 (00:11 +0400)]
Added remotely ran compiler-rt tests.

Use LLVM/utils/remote-exec.py to run compiler-rt tests remotely on the target.

Reviewed By: vvereschaka

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

3 years agoRemove HAVE_VCS_VERSION_INC, not needed
Marcel Hlopko [Thu, 29 Oct 2020 20:01:28 +0000 (13:01 -0700)]
Remove HAVE_VCS_VERSION_INC, not needed

This preprocessor define was meant to be used to conditionally include VCSVersion.inc. However, the define was always set, and it was the content of the header that was conditionally generated. Therefore HAVE_VCS_VERSION_INC should be cleaned up.

Reviewed By: gribozavr2, MaskRay

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

3 years ago[SDAG] Extract helper to get vecreduce base opcode (NFC)
Nikita Popov [Thu, 29 Oct 2020 19:21:25 +0000 (20:21 +0100)]
[SDAG] Extract helper to get vecreduce base opcode (NFC)

3 years ago[sanitizer] Disable ASLR for release_shadow_space
Adhemerval Zanella [Thu, 29 Oct 2020 14:49:28 +0000 (14:49 +0000)]
[sanitizer] Disable ASLR for release_shadow_space

On aarch64 with kernel 4.12.13 the test sporadically fails with

RSS at start: 1564, after mmap: 103964, after mmap+set label: 308768, \
after fixed map: 206368, after another mmap+set label: 308768, after \
munmap: 206368
release_shadow_space.c.tmp: [...]/release_shadow_space.c:80: int \
main(int, char **): Assertion `after_fixed_mmap <= before + delta' failed.

It seems on some executions the memory is not fully released, even
after munmap.  And it also seems that ASLR is hurting it by adding
some fragmentation, by disabling it I could not reproduce the issue
in multiple runs.

3 years ago[OpenMP] Add NULL check in dispatcher debug output
Peyton, Jonathan L [Thu, 29 Oct 2020 18:57:33 +0000 (13:57 -0500)]
[OpenMP] Add NULL check in dispatcher debug output

Patch by Nawrin Sultana

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

3 years ago[InferAttrs] Add nocapture/writeonly to string/mem libcalls
Dávid Bolvanský [Thu, 29 Oct 2020 18:14:55 +0000 (19:14 +0100)]
[InferAttrs] Add nocapture/writeonly to string/mem libcalls

One step closer to fix PR47644.

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

3 years ago[llvm-libtool-darwin] Add support for LLVM bitcode files
Paul-Antoine Arras [Thu, 29 Oct 2020 18:08:45 +0000 (11:08 -0700)]
[llvm-libtool-darwin] Add support for LLVM bitcode files

This diff adds support for LLVM bitcode objects to llvm-libtool-darwin.

Test plan: make check-all

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

3 years ago[clangd] Add support for multiple DecisionForest model experiments.
Utkarsh Saxena [Fri, 23 Oct 2020 08:19:53 +0000 (10:19 +0200)]
[clangd] Add support for multiple DecisionForest model experiments.

With every incremental change, one needs to check-in new model upstream.
This also significantly increases the size of the git repo with every
new model.
Testing and comparing the old and previous model is also not possible as
we run only a single model at any point.

One solution is to have a "staging" decision forest which can be
injected into clangd without pushing it to upstream. Compare the
performance of the staging model with the live model. After a couple of
enhancements have been done to staging model, we can then replace the
live model upstream with the staging model. This reduces upstream churn
and also allows us to compare models with current baseline model.

This is done by having a callback in CodeCompleteOptions which is called
only when we want to use a decision forest ranking model. This allows us
to inject different completion model internally.

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

3 years ago[RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseInfo.h
Craig Topper [Thu, 29 Oct 2020 18:39:19 +0000 (11:39 -0700)]
[RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseInfo.h

RISCVRegisterInfo.h is part of the CodeGen layer. The Utils library
is intended to be shared with the MC layer so shouldn't use files
from the CodeGen layer.

The register enum names are already available from
RISCVMCTargetDesc.h. It appears what was coming from this include
was a transitive include of the Register class which I've replaced
with MCRegister. Register has a constructor from MCRegister so it
should be convertible.

3 years ago[MemProf] Temporarily disable test failing on a couple bots
Teresa Johnson [Thu, 29 Oct 2020 18:22:28 +0000 (11:22 -0700)]
[MemProf] Temporarily disable test failing on a couple bots

I finally see why this test is failing (on now 2 bots). Somehow the path
name is getting messed up, and the "linux" converted to "1". I suspect
there is something in the environment causing the macro expansion in the
test to get messed up:

http://lab.llvm.org:8011/#/builders/112/builds/555/steps/5/logs/FAIL__MemProfiler-x86_64-linux__log_path_test_cpp
http://lab.llvm.org:8011/#/builders/37/builds/275/steps/31/logs/stdio

On the avr bot:
-DPROFILE_NAME_VAR="/home/buildbot/llvm-avr-linux/llvm-avr-linux/stage1/projects/compiler-rt/test/memprof/X86_64LinuxConfig/TestCases/Output/log_path_test.cpp.tmp.log2"

after macros expansions becomes:
/home/buildbot/llvm-avr-1/llvm-avr-1/stage1/projects/compiler-rt/test/memprof/X86_64LinuxConfig/TestCases/Output/log_path_test.cpp.tmp.log2

Similar (s/linux/1/) on the other bot.

Disable it while I investigate

3 years agoAdd support of the next Ubuntu (Ubuntu 21.04 - Hirsute Hippo)
Sylvestre Ledru [Thu, 29 Oct 2020 16:56:53 +0000 (17:56 +0100)]
Add support of the next Ubuntu (Ubuntu 21.04 - Hirsute Hippo)

3 years ago[WebAssembly] Implement SIMD signselect instructions
Thomas Lively [Thu, 29 Oct 2020 18:06:20 +0000 (11:06 -0700)]
[WebAssembly] Implement SIMD signselect instructions

As proposed in https://github.com/WebAssembly/simd/pull/124, using the opcodes
adopted by V8 in
https://chromium-review.googlesource.com/c/v8/v8/+/2486235/2/src/wasm/wasm-opcodes.h.
Uses new builtin functions and a new target intrinsic exclusively to ensure that
the new instructions are only emitted when a user explicitly opts in to using
them since they are still in the prototyping and evaluation phase.

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

3 years ago[libc++] Minor cleanup in the test suite
Louis Dionne [Thu, 29 Oct 2020 17:04:41 +0000 (13:04 -0400)]
[libc++] Minor cleanup in the test suite

3 years ago[sanitizer][fuchsia] Avoid deprecated syscall.
Jody Sankey [Thu, 29 Oct 2020 17:51:01 +0000 (10:51 -0700)]
[sanitizer][fuchsia] Avoid deprecated syscall.

The zx_clock_get syscall on Fuchsia is deprecated - ref
https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get
This changes to the recommended replacement; calling zx_clock_read on
the userspace UTC clock.

Reviewed By: mcgrathr, phosek

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

3 years ago[Support] Make Support/SwapByteOrder.h compile on Fuchsia
Roland McGrath [Wed, 28 Oct 2020 01:30:25 +0000 (18:30 -0700)]
[Support] Make Support/SwapByteOrder.h compile on Fuchsia

Reviewed By: phosek

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

3 years ago[AMDGPU] Fix double space in disassembly of ds_gws_sema_* with gds
Jay Foad [Wed, 28 Oct 2020 13:06:44 +0000 (13:06 +0000)]
[AMDGPU] Fix double space in disassembly of ds_gws_sema_* with gds

By setting up the AsmStrings correctly we can remove some special cases
from AMDGPUInstPrinter::printOffset.

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

3 years agoRevert "[mlir][gpu] Allow gpu.launch_func to be async."
Mehdi Amini [Thu, 29 Oct 2020 17:30:27 +0000 (17:30 +0000)]
Revert "[mlir][gpu] Allow gpu.launch_func to be async."

This reverts commit ec7780ebdab480139596c3cb08ee77d7035457b3.

One of the bot is crashing in a test related to this change.

3 years ago[MemProf] Augment test to debug avr bot failure
Teresa Johnson [Thu, 29 Oct 2020 16:40:22 +0000 (09:40 -0700)]
[MemProf] Augment test to debug avr bot failure

After 81f7b96ed0a2295e0b82ca185019370ac8e1895e, I can see that the
reason this test is failing on llvm-avr-linux is that it doesn't think
the directory exists (error comes during file open for write command).
Not sure why since this is the main test Output directory and we created
a different file there earlier in the test from the same file open
invocation. Print directory contents in an attempt to debug.

3 years ago[nfc] [lldb] Remove excessive parentheses in SymbolFileDWARF::GetUID
Jan Kratochvil [Thu, 29 Oct 2020 16:54:43 +0000 (17:54 +0100)]
[nfc] [lldb] Remove excessive parentheses in SymbolFileDWARF::GetUID

3 years ago[ThinLTO] Fix empty .llvmcmd sections
Mircea Trofin [Thu, 29 Oct 2020 03:16:51 +0000 (20:16 -0700)]
[ThinLTO] Fix empty .llvmcmd sections

When passing -lto-embed-bitcode=post-merge-pre-opt, we were getting
empty .llvmcmd sections. It turns out that is because the
CodeGenOptions::CmdArgs field was only populated when clang saw
-fembed-bitcode={all|marker}.

This patch always populates the CodeGenOptions::CmdArgs. The overhead
of carrying through in memory in all cases is likely negligible in
the grand schema of things, and it keeps the using code simple.

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

3 years ago[mlir][gpu] Allow gpu.launch_func to be async.
Christian Sigg [Thu, 22 Oct 2020 05:49:50 +0000 (07:49 +0200)]
[mlir][gpu] Allow gpu.launch_func to be async.

Reviewed By: herhut

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

3 years ago[X86] Add PR46393 test case
Simon Pilgrim [Thu, 29 Oct 2020 16:27:04 +0000 (16:27 +0000)]
[X86] Add PR46393 test case

3 years ago[AMDGPU] Add __builtin_amdgcn_grid_size
Jon Chesterfield [Thu, 29 Oct 2020 16:24:53 +0000 (16:24 +0000)]
[AMDGPU] Add __builtin_amdgcn_grid_size

[AMDGPU] Add __builtin_amdgcn_grid_size

Similar to D76772, loads the data from the dispatch pointer. Marked invariant.

Patch also updates the openmp devicertl to use this builtin.

Reviewed By: yaxunl

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

3 years ago[x86] add test for umul intrinsic costs; NFC
Sanjay Patel [Thu, 29 Oct 2020 16:12:25 +0000 (12:12 -0400)]
[x86] add test for umul intrinsic costs; NFC

3 years ago[MC] Error for .globl/.local which change the symbol binding and warn for .weak
Fangrui Song [Thu, 29 Oct 2020 16:03:13 +0000 (09:03 -0700)]
[MC] Error for .globl/.local which change the symbol binding and warn for .weak

GNU as let .weak override .globl since binutils-gdb
5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996) while MC lets the last
directive win (PR38921).

This caused an issue to Linux's powerpc port which has been fixed by
http://git.kernel.org/linus/968339fad422a58312f67718691b717dac45c399

Binding overriding is error-prone. This patch disallows a changed binding.
(https://sourceware.org/pipermail/binutils/2020-March/000299.html )

Our behavior regarding `.globl x; .weak x` matches GNU as. Such usage is
still suspicious but we issue a warning for now. We may upgrade it to an
error in the future.

Reviewed By: jhenderson, nickdesaulniers

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

3 years ago[AMDGPU] Use pseudo instructions for readlane/writelane
Jay Foad [Thu, 29 Oct 2020 12:10:56 +0000 (12:10 +0000)]
[AMDGPU] Use pseudo instructions for readlane/writelane

This reverts r227987 "R600/SI: Determine target-specific encoding of READLANE and WRITELANE early v2".

All the codegen changes are caused by the post-RA scheduler no longer
treating readlane/writelane as scheduling barriers due to having
unmodelled side effects. (The pseudos are hasSideEffects = 0, but the
real instructions are hasSideEffects = ? which TableGen conservatively
treats as 1.)

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

3 years ago[sanitizer] Print errno for report file open failure
Teresa Johnson [Sun, 25 Oct 2020 05:32:03 +0000 (22:32 -0700)]
[sanitizer] Print errno for report file open failure

To help debug failures, specifically the llvm-avr-linux bot failure from
5c20d7db9f2791367b9311130eb44afecb16829c:

http://lab.llvm.org:8011/#/builders/112/builds/407/steps/5/logs/FAIL__MemProfiler-x86_64-linux-dynamic__log_path_t

Also re-enable the failing test which I temporarily disabled, to
see if this change will help identify why that particular log file can't
be opened for write on that bot (when another log file in the same
directory could earlier in the test).

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

3 years ago[NFC] Add more tests for DISubprogram verifier
Scott Linder [Thu, 29 Oct 2020 15:22:15 +0000 (15:22 +0000)]
[NFC] Add more tests for DISubprogram verifier

Minimum amount of tests to cover (most) of the DISubprogram verifier
checks.

Reviewed By: vsk

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

Change-Id: Icd25dac64f87f6dcf67ff3443eb4f95af18d05a8

3 years ago[InstCombine] visitShl - ensure inner shifts have inrange amounts
Simon Pilgrim [Thu, 29 Oct 2020 14:30:42 +0000 (14:30 +0000)]
[InstCombine] visitShl - ensure inner shifts have inrange amounts

Noticed when fixing OSS Fuzz #26716

3 years ago[mlir][Linalg] Make Linalg fusion a test pass
Nicolas Vasilache [Thu, 29 Oct 2020 14:02:56 +0000 (14:02 +0000)]
[mlir][Linalg] Make Linalg fusion a test pass

Linalg "tile-and-fuse" is currently exposed as a Linalg pass "-linalg-fusion" but only the mechanics of the transformation are currently relevant.
Instead turn it into a "-test-linalg-greedy-fusion" pass which performs canonicalizations to enable more fusions to compose.
This allows dropping the OperationFolder which is not meant to be used with the pattern rewrite infrastructure.

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

3 years ago[ARM] Fix IT block generation after Thumb2SizeReduce with -Oz
Nicholas Guy [Thu, 29 Oct 2020 13:58:39 +0000 (13:58 +0000)]
[ARM] Fix IT block generation after Thumb2SizeReduce with -Oz

Fixes a regression caused by D82439, in which IT blocks were no longer being generated when -Oz is present.

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

3 years ago[ARM] Add IT block generation test
Nicholas Guy [Thu, 29 Oct 2020 13:56:52 +0000 (13:56 +0000)]
[ARM] Add IT block generation test

D88496 introduces some new behaviour to IT block generation,
behaviour which is not covered by the current unit tests.
This adds one to cover it

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

3 years ago[VE] Change to use integrated assembly by defualt
Kazushi (Jam) Marukawa [Thu, 29 Oct 2020 12:17:37 +0000 (21:17 +0900)]
[VE] Change to use integrated assembly by defualt

We've implemented integrated assembler.  Now, we change to use
integrated assembler by default.  Update a regression test also.

Reviewed By: simoll

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

3 years ago[libc++] Remove additional uses of std::rand() missed by 63aeadb4849d
Louis Dionne [Thu, 29 Oct 2020 15:07:39 +0000 (11:07 -0400)]
[libc++] Remove additional uses of std::rand() missed by 63aeadb4849d

3 years ago[AMDGPU] Remove gds operand from ds_gws_* MachineInstrs
Jay Foad [Thu, 29 Oct 2020 10:20:54 +0000 (10:20 +0000)]
[AMDGPU] Remove gds operand from ds_gws_* MachineInstrs

The operand value was always 1 (except in some bad MIR tests) so it was
redundant.

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

3 years ago[AMDGPU] Fix double space in disassembly of s_set_gpr_idx_mode
Jay Foad [Thu, 29 Oct 2020 09:39:28 +0000 (09:39 +0000)]
[AMDGPU] Fix double space in disassembly of s_set_gpr_idx_mode

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

3 years ago[AMDGPU] Fix double space in disassembly of some DPP instructions
Jay Foad [Wed, 28 Oct 2020 16:59:29 +0000 (16:59 +0000)]
[AMDGPU] Fix double space in disassembly of some DPP instructions

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

3 years ago[MLIR] Support walks over regions and blocks
Frederik Gossen [Thu, 29 Oct 2020 13:48:07 +0000 (13:48 +0000)]
[MLIR] Support walks over regions and blocks

Add specializations for `walk` to allow traversal of regions and blocks.

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

3 years ago[SVE] Remove TypeSize comparison operators
David Sherwood [Mon, 26 Oct 2020 15:12:58 +0000 (15:12 +0000)]
[SVE] Remove TypeSize comparison operators

All known instances in the code where we relied upon the TypeSize
comparison operators have now been changed to either use scalar
interger comparisons or one of the TypeSize::isKnownXY functions.
It is now safe to remove the comparison operators.

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

3 years ago[VE] Add missing BCR format
Kazushi (Jam) Marukawa [Thu, 29 Oct 2020 11:57:00 +0000 (20:57 +0900)]
[VE] Add missing BCR format

Add missing "BCR %sy, 0, target" format instruction and a regression
test for this format.

Reviewed By: simoll

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

3 years agoRevert "clang-format: Add a consumer to diagnostics engine"
Nico Weber [Thu, 29 Oct 2020 14:29:53 +0000 (10:29 -0400)]
Revert "clang-format: Add a consumer to diagnostics engine"

This reverts commit df00267f1fdb0b098dc42f1caa8a59b29c8e0e5f.
clang-format should not depend on Frontend, see comment on
https://reviews.llvm.org/D90121.

3 years ago[VE] Add missing symbolic branch patterns
Kazushi (Jam) Marukawa [Thu, 29 Oct 2020 12:01:16 +0000 (21:01 +0900)]
[VE] Add missing symbolic branch patterns

Add missing symbolic branch patterns to a regression test.

Reviewed By: simoll

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

3 years ago[VE] Support register aliases in llvm-mc
Kazushi (Jam) Marukawa [Thu, 29 Oct 2020 11:38:04 +0000 (20:38 +0900)]
[VE] Support register aliases in llvm-mc

Support register aliases in MC layer to compile existing assembly
files with clang and integrated assembler.

Reviewed By: simoll

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

3 years ago[mlir][openacc] Add if and device_type to update op
Valentin Clement [Thu, 29 Oct 2020 13:54:31 +0000 (09:54 -0400)]
[mlir][openacc] Add if and device_type to update op

Update op is modelling the update directive (2.14.4) from the OpenACC specs.
An if condition and a device_type list can be attached to the directive. This patch add
these two information to the current op.

Reviewed By: rriddle

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