platform/upstream/llvm.git
3 years agoAMDGPU/GlobalISel: Remove dead check prefixes
Matt Arsenault [Sun, 7 Feb 2021 21:15:08 +0000 (16:15 -0500)]
AMDGPU/GlobalISel: Remove dead check prefixes

3 years ago[NVPTX][NewPM] Re-enable NVVMReflectPass
Arthur Eubanks [Mon, 8 Feb 2021 21:52:14 +0000 (13:52 -0800)]
[NVPTX][NewPM] Re-enable NVVMReflectPass

Disabled alongside NVVMIntrRangePass in https://reviews.llvm.org/D96166,
but turns out NVVMIntrRangePass was the issue.

Reviewed By: tra

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

3 years ago[flang][NFC] Add comment.
Eric Schweitz [Mon, 8 Feb 2021 21:49:16 +0000 (13:49 -0800)]
[flang][NFC] Add comment.

3 years ago[test] Fix unused check prefixes
Fangrui Song [Mon, 8 Feb 2021 21:44:29 +0000 (13:44 -0800)]
[test] Fix unused check prefixes

3 years ago[FileCheck] Default --allow-unused-prefixes to false
Fangrui Song [Mon, 8 Feb 2021 21:37:03 +0000 (13:37 -0800)]
[FileCheck] Default --allow-unused-prefixes to false

Link: https://lists.llvm.org/pipermail/llvm-dev/2020-October/146162.html
If a downstream project using lit needs time for transition,
add the following to `lit.local.cfg`:

```
from lit.llvm.subst import ToolSubst

fc = ToolSubst('FileCheck', unresolved='fatal')
config.substitutions.insert(0, (fc.regex, 'FileCheck --allow-unused-prefixes'))
```

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

3 years ago[Verifier] Allow DW_TAG_class_type/DW_TAG_union_type to have no filename
Fangrui Song [Mon, 8 Feb 2021 21:31:05 +0000 (13:31 -0800)]
[Verifier] Allow DW_TAG_class_type/DW_TAG_union_type to have no filename

`clang/lib/CodeGen/CGOpenMPRuntime.cpp` synthesized union
(`distinct !DICompositeType(tag: DW_TAG_union_type, name: "kmp_cmplrdata_t", size: 64, elements: <0x62b690>)`)
does not have meaningful filename/line number.

D94735 dropped the previously arbitrary and untested filename/line from the union and caused a verifier error here.

This fixes `check-libarcher` failures.

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

3 years ago[ARM] One-off identity shuffle
David Green [Mon, 8 Feb 2021 21:24:32 +0000 (21:24 +0000)]
[ARM] One-off identity shuffle

A One-Off Identity mask is a shuffle that is mostly an identity mask
from as single source but contains a single element out-of-place, either
from a different vector or from another position in the same vector. As
opposed to lowering this via a ARMISD::BUILD_VECTOR we can generate an
extract/insert pair directly. Under ARM with individually accessible
lane elements this often becomes a simple lane move.

This also alters the LowerVECTOR_SHUFFLEUsingMovs code to use v4f32 (not
v4i32), a more natural type for lane moves.

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

3 years ago[SimpleLoopUnswitch] Don't non-trivially unswitch loops that are unsafe to clone
Arthur Eubanks [Mon, 8 Feb 2021 20:52:20 +0000 (12:52 -0800)]
[SimpleLoopUnswitch] Don't non-trivially unswitch loops that are unsafe to clone

Non-trivial unswitching can clone loops.

The legacy -loop-unswitch pass also checks for this.

Fixes PR49085.

Reviewed By: asbirlea

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

3 years ago[gn build] reformat all gn files
Nico Weber [Mon, 8 Feb 2021 21:10:59 +0000 (16:10 -0500)]
[gn build] reformat all gn files

$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format

3 years ago[CMake] [MinGW] Enable use of LLVM_USE_SANITIZER in a MinGW environment
Markus Böck [Mon, 8 Feb 2021 21:04:04 +0000 (23:04 +0200)]
[CMake] [MinGW] Enable use of LLVM_USE_SANITIZER in a MinGW environment

Currently using LLVM_USE_SANITIZER with a MinGW target leads to a fatal
configuration error due to an unsupported platform. MinGW targets on
clang however implement a few sanitizers, currently ASAN and UBSAN.

This patch enables LLVM_USE_SANITIZER in a MinGW environment as well.

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

3 years ago[AArch64][GlobalISel] Support the 'returned' parameter attribute.
Amara Emerson [Wed, 3 Feb 2021 18:33:48 +0000 (10:33 -0800)]
[AArch64][GlobalISel] Support the 'returned' parameter attribute.

On AArch64 (which seems to be the only target that supports it), this
attribute allows codegen to avoid saving/restoring the value in x0
across a call.

Gives a 0.1% geomean -Os code size improvement on CTMark.

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

3 years agoRevert "[Test] Add failing test for PR49087"
Nico Weber [Mon, 8 Feb 2021 20:46:29 +0000 (15:46 -0500)]
Revert "[Test] Add failing test for PR49087"

This reverts commit 0fc1738eb75d613b9e16143b83e7cb80512e84eb.
The test passes (unexpectedly, due to the XFAIL: *) when x86 isn't
the default triple (such as on an arm machine).

3 years ago[AArch64] Use '//' as comment string for MSVC assembly
Martin Storsjö [Mon, 8 Feb 2021 13:24:42 +0000 (15:24 +0200)]
[AArch64] Use '//' as comment string for MSVC assembly

As the actual MSVC toolset doesn't use the GAS-style assembly that
Clang/LLVM produces and consumes, there's no reference for what
string to use for e.g. comments when building with a MSVC triple.

This frees up the use of semicolon as separator string, just like
was done for GNU targets in 23413195649d0cf6f3860ae8b5fb115b35032075.
(Previously, both the separator and comment strings were set to
the same, a semicolon.)

Compiler-rt extensively uses separator chars in its assembly,
and that assembly should be buildable with clang-cl for MSVC too.

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

3 years agoDebugInfo/Symbolize: Allow STT_NOTYPE/STT_GNU_IFUNC symbols for .symtab symbolization
Fangrui Song [Mon, 8 Feb 2021 20:29:11 +0000 (12:29 -0800)]
DebugInfo/Symbolize: Allow STT_NOTYPE/STT_GNU_IFUNC symbols for .symtab symbolization

In assembly files, omitting `.type foo,@function` is common. Such functions have
type `STT_NOTYPE` and llvm-symbolizer reports `??` for them.

An ifunc symbol usually has an associated resolver symbol which is defined at
the same address. Returning either one is fine for symbolization. The resolver
symbol may not end up in the symbol table if (object file) `.L` is used (linked
image) .symtab is stripped while .dynsym is retained.

This patch allows ELF STT_NOTYPE/STT_GNU_IFUNC symbols for .symtab symbolization.

I have left TODO in the test files for an unimplemented STT_FILE heuristic.

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

3 years ago[scudo/standalone] Use .arch_extension memtag, not mte
Roland McGrath [Thu, 4 Feb 2021 03:28:29 +0000 (19:28 -0800)]
[scudo/standalone] Use .arch_extension memtag, not mte

GNU binutils accepts only `.arch_extension memtag` while Clang
accepts either that or `.arch_extension mte` to mean the same thing.

Reviewed By: pcc

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

3 years ago[flang][NFC] Update comments.
Eric Schweitz [Mon, 8 Feb 2021 20:10:43 +0000 (12:10 -0800)]
[flang][NFC] Update comments.

3 years ago[libomptarget][amdgcn] Fix language linkage post D95300, drop use of assert
Jon Chesterfield [Mon, 8 Feb 2021 20:07:51 +0000 (20:07 +0000)]
[libomptarget][amdgcn] Fix language linkage post D95300, drop use of assert

3 years ago[dfsan] Refactor visitCallBase
Jianzhou Zhao [Fri, 5 Feb 2021 21:50:15 +0000 (21:50 +0000)]
[dfsan] Refactor visitCallBase

To simplify the review of https://reviews.llvm.org/D95835.

Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D96177

3 years ago[lld-macho] Try to make ubsan happy
Jez Ng [Mon, 8 Feb 2021 19:50:13 +0000 (14:50 -0500)]
[lld-macho] Try to make ubsan happy

Summary: We should avoid passing a null pointer to memcpy.

3 years ago[RISCV] Use _COMMUTABLE fma pseudos for fixed vectors.
Craig Topper [Mon, 8 Feb 2021 19:25:50 +0000 (11:25 -0800)]
[RISCV] Use _COMMUTABLE fma pseudos for fixed vectors.

This matches what we do in the VLMAX SDNode patterns.

3 years ago[GWP-ASan] Add aligned allocations.
Mitch Phillips [Mon, 8 Feb 2021 18:46:45 +0000 (10:46 -0800)]
[GWP-ASan] Add aligned allocations.

Adds a new allocation API to GWP-ASan that handles size+alignment
restrictions.

Reviewed By: cryptoad, eugenis

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

3 years agoRevert "[Utils] Add a switch controlling prefix warnings in UpdateTestChecks"
Mircea Trofin [Mon, 8 Feb 2021 19:21:56 +0000 (11:21 -0800)]
Revert "[Utils] Add a switch controlling prefix warnings in UpdateTestChecks"

This reverts commit 87f8a08ce36e5bc72f11129d2cf36b5848f86f63.

3 years ago[RISCV] Add support for splat fixed length build_vectors using RVV.
Craig Topper [Mon, 8 Feb 2021 18:59:38 +0000 (10:59 -0800)]
[RISCV] Add support for splat fixed length build_vectors using RVV.

Building on the fixed vector support from D95705

I've added ISD nodes for vmv.v.x and vfmv.v.f and switched to
lowering the intrinsics to it. This allows us to share the same
isel patterns for both.

This doesn't handle splats of i64 on RV32 yet. The build_vector
gets converted to a vXi32 build_vector+bitcast during type
legalization. Not sure the best way to handle this at the moment.

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

3 years ago[RISCV] Add support for fixed vector FMA.
Craig Topper [Mon, 8 Feb 2021 18:45:45 +0000 (10:45 -0800)]
[RISCV] Add support for fixed vector FMA.

Follow up to D95705. Does not include the commuting support from D95800.

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

3 years ago[mlir][Linalg] Fix padding related bugs.
Nicolas Vasilache [Mon, 8 Feb 2021 15:28:29 +0000 (15:28 +0000)]
[mlir][Linalg] Fix padding related bugs.

This revision fixes the fact that the padding transformation did not have enough information to set the proper type for the padding value.
Additionally, the verifier for Yield in the presence of PadTensorOp is fixed to properly report incorrect number of results or operands. Previously, the error would be silently ignored which made the core issue difficult to debug.

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

3 years ago[lld-macho] Emit LSDA info in compact unwind
Jez Ng [Mon, 8 Feb 2021 18:47:34 +0000 (13:47 -0500)]
[lld-macho] Emit LSDA info in compact unwind

The LSDA pointers are encoded as offsets from the image base,
and arranged in one big contiguous array. Each second-level page records
the offset within that LSDA array which corresponds to the LSDA for its
first CU entry.

Reviewed By: clayborg

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

3 years ago[lld-macho] Emit personalities in compact unwind
Jez Ng [Mon, 8 Feb 2021 18:47:33 +0000 (13:47 -0500)]
[lld-macho] Emit personalities in compact unwind

Note that there is a triple indirection involved with
personalities and compact unwind:

1. Two bits of each CU encoding are used as an offset into the
   personality array.
2. Each entry of the personality array is an offset from the image base.
   The resulting address (after adding the image base) should point within the
   GOT.
3. The corresponding GOT entry contains the actual pointer to the
   personality function.

To further complicate things, when the personality function is in the
object file (as opposed to a dylib), its references in
`__compact_unwind` may refer to it via a section + offset relocation
instead of a symbol relocation. Since our GOT implementation can only
create entries for symbols, we have to create a synthetic symbol at the
given section offset.

Reviewed By: clayborg

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

3 years ago[RISCV] Add initial support for converting fixed vectors to scalable vectors during...
Craig Topper [Mon, 8 Feb 2021 18:32:32 +0000 (10:32 -0800)]
[RISCV] Add initial support for converting fixed vectors to scalable vectors during lowering to use RVV instructions.

This is an alternative to D95563.

This is modeled after a similar feature for AArch64's SVE that uses
predicated scalable vector instructions.a

Rather than use predication, this patch uses an explicit VL operand.
I've limited it to always use LMUL=1 for now, but we can improve this
in the future.

This requires a bunch of new ISD opcodes to carry the VL operand.
I think we can probably lower intrinsics to these ISD opcodes to
cut down on the size of the isel table. Which is why I've added
patterns for all integer/float types and not just LMUL=1.

I'm only testing one vector width right now, but the width is
programmable via the command line.

Reviewed By: frasercrmck

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

3 years ago[ELF] Inspect -EL & -EB for OUTPUT_FORMAT(default, big, little)
Fangrui Song [Mon, 8 Feb 2021 18:34:57 +0000 (10:34 -0800)]
[ELF] Inspect -EL & -EB for OUTPUT_FORMAT(default, big, little)

Choose big if -EB is specified, little if -EL is specified, or default if neither is specified.
The new behavior matches GNU ld.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1025

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

3 years ago[mlir] Drop deprecated syntax for LLVM dialect types
Alex Zinenko [Mon, 8 Feb 2021 17:22:23 +0000 (18:22 +0100)]
[mlir] Drop deprecated syntax for LLVM dialect types

After the LLVM dialect types were ported to use built-in types, the parser kept
supporting the old syntax for LLVM dialect types to produce built-in types for
compatibility. Drop this support.

Reviewed By: mehdi_amini

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

3 years ago[ConstraintElimination] Decompose a few more GEP indices.
Florian Hahn [Mon, 8 Feb 2021 17:28:34 +0000 (17:28 +0000)]
[ConstraintElimination] Decompose a few more GEP indices.

This patch adds handling for zero-extended GEP indices.

3 years ago[RISCV] Make scalable vector FMA commutable for register allocation.
Craig Topper [Mon, 8 Feb 2021 17:56:47 +0000 (09:56 -0800)]
[RISCV] Make scalable vector FMA commutable for register allocation.

This adds support for commuting operands and converting between
vfmadd and vfmacc to avoid register copies.

To avoid messing up intrinsic behavior, I've added new pseudo
instructions that have the isCommutable flag set. These pseudos also
force a tail agnostic policy. The intrinsic version still use
the tail undisturbed policy.

For best results it looks like we need to start with fmadd and only
pick fmacc if its beneficial. MachineCSE commutes without contraining
the operands and then commutes back if it didn't help with CSE. So
I've made sure that when the operand choice isn't constrained, we
will keep fmadd for MachineCSE and when it does the second commute,
we get back the original instruction.

Reviewed By: frasercrmck

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

3 years ago[Sanitizer] Fix failing sanitizer tests
Julian Lettner [Sat, 6 Feb 2021 05:31:22 +0000 (21:31 -0800)]
[Sanitizer] Fix failing sanitizer tests

The new pass manager was enabled by default [1].

The commit message states the following relevant differences:
  * The inliner works slightly differently
  * -O1 does some amount of inlining

These tests are affected because they specify `-O1` and then check the
reported stack trace.

[1] https://reviews.llvm.org/D95380

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

3 years ago[RISCV] Use SplatPat/SplatPat_simm5 to handle PseudoVMV_V_X_/PseudoVMV_V_I_ selection...
Craig Topper [Mon, 8 Feb 2021 17:48:25 +0000 (09:48 -0800)]
[RISCV] Use SplatPat/SplatPat_simm5 to handle PseudoVMV_V_X_/PseudoVMV_V_I_ selection as well.

This ensures that we'll match immediates consistently regardless
of whether we match them as a standalone splat or as part of
another operation.

While I was there I added complexities to the simm5/uimm5 patterns so
we didn't have to assume that the 1 on the non-immediate was lower
than what tablegen inferred.

I had to make a minor tweak to tablegen to fix one place that
didn't expect to see a ComplexPattern that wasn't a "leaf".

Reviewed By: frasercrmck

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

3 years ago[AMDGPU] Use named unified buffer format constant. NFC.
Jay Foad [Mon, 8 Feb 2021 17:34:27 +0000 (17:34 +0000)]
[AMDGPU] Use named unified buffer format constant. NFC.

3 years ago[lldb] [Process/FreeBSDRemote] Introduce mips64 support
Michał Górny [Thu, 28 Jan 2021 11:23:54 +0000 (12:23 +0100)]
[lldb] [Process/FreeBSDRemote] Introduce mips64 support

Introduce mips64 support to match the legacy FreeBSD plugin. Similarly
to the legacy plugin, the code does not support FPU registers at the
moment.  The support for them will be submitted separately as it
requires changes to the register context shared by both plugins.

This also includes software single-stepping support that is moved from
the Linux plugin into a common Utility class.  The FreeBSD code also
starts explicitly ignoring EINVAL from PT_CLEARSTEP since this is easier
to implement than checking whether hardware single-stepping were used.

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

3 years ago[LLDB] Fix `Wunused-result` warning
Frederik Gossen [Mon, 8 Feb 2021 17:08:47 +0000 (18:08 +0100)]
[LLDB] Fix `Wunused-result` warning

3 years ago[ELF] Support aarch64_be
Fangrui Song [Mon, 8 Feb 2021 16:55:28 +0000 (08:55 -0800)]
[ELF] Support aarch64_be

This patch adds

* Big-endian values for `R_AARCH64_{ABS,PREL}{16,32,64}` and `R_AARCH64_PLT32`
* aarch64elfb & aarch64linuxb BFD emulations
* elf64-bigaarch64 output format (bfdname)

Link: https://github.com/ClangBuiltLinux/linux/issues/1288
Differential Revision: https://reviews.llvm.org/D96188

3 years ago[llvm-objdump] Support PLT decoding for aarch64_be
Fangrui Song [Mon, 8 Feb 2021 16:50:25 +0000 (08:50 -0800)]
[llvm-objdump] Support PLT decoding for aarch64_be

Reviewed By: jhenderson

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

3 years ago[flang][fir] Update FIR's character type.
Eric Schweitz [Fri, 5 Feb 2021 22:40:10 +0000 (14:40 -0800)]
[flang][fir] Update FIR's character type.

Upstream the changes made to the !fir.char type.

https://github.com/flang-compiler/f18-llvm-project/pull/269
https://github.com/flang-compiler/f18-llvm-project/pull/557

Author: Eric Schweitz, Jean Perier

Differention Revision: https://reviews.llvm.org/D96183

3 years ago[FE] Manipulate the first byte of guard variable type in both load and store operation
Xiangling Liao [Mon, 8 Feb 2021 16:14:23 +0000 (11:14 -0500)]
[FE] Manipulate the first byte of guard variable type in both load and store operation

As Itanium ABI[http://itanium-cxx-abi.github.io/cxx-abi/abi.html#once-ctor]
points out:

"The size of the guard variable is 64 bits. The first byte (i.e. the byte at
the address of the full variable) shall contain the value 0 prior to
initialization of the associated variable, and 1 after initialization is complete."

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

3 years ago[OpenCL] Fix pipe type printing in arg info metadata
Anastasia Stulova [Mon, 8 Feb 2021 16:01:44 +0000 (16:01 +0000)]
[OpenCL] Fix pipe type printing in arg info metadata

Pipe element type spelling for arg info metadata
should follow the same behavior as normal type spelling.

We should only use the canonical type spelling in the
base type field.

This patch also removed duplication in type handling.

Tags: #clang

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

3 years ago[AArch64AsmParser] Fix type-limits warning for VectorIndex.
Sander de Smalen [Mon, 8 Feb 2021 14:33:05 +0000 (14:33 +0000)]
[AArch64AsmParser] Fix type-limits warning for VectorIndex.

Making VectorIndex an `int` instead of `unsigned`, silences the warning:
  comparison of unsigned expression in ‘>= 0’ is always true

in:
  template <int Min, int Max>
  DiagnosticPredicate isVectorIndex() const {
    ...
    if (VectorIndex.Val >= Min && VectorIndex.Val <= Max)
      return DiagnosticPredicateTy::Match;
    ...
  }

when Min is 0.

3 years ago[libc++] Add a wait step in the BuildKite pipeline to shield macOS builders
Louis Dionne [Mon, 8 Feb 2021 15:04:38 +0000 (10:04 -0500)]
[libc++] Add a wait step in the BuildKite pipeline to shield macOS builders

We don't have many of those and they are rather slow, so we'd rather not run
those jobs if we know other jobs in the pipeline failed anyway.

3 years agoAArch64: use a constpool for blockaddress(...) on MachO
Tim Northover [Mon, 8 Feb 2021 14:47:14 +0000 (14:47 +0000)]
AArch64: use a constpool for blockaddress(...) on MachO

More MachO madness for everyone. MachO relocations are only 32-bits, which
means the ARM64_RELOC_ADDEND one only actually has 24 (signed) bits for the
actual addend. This is a problem when calculating the address of a basic block;
because it has no symbol of its own, the sequence

adrp x0, Ltmp0@PAGE
add x0, x0, x0 Ltmp0@PAGEOFF

is represented by relocation with an addend that contains the offset from the
function start to Ltmp, and so the largest function where this is guaranteed to
work is 8MB. That's not quite big enough that we can call it user error (IMO).

So this patch puts the any blockaddress into a constant-pool, where the addend
is instead stored in the (x)word being relocated, which is obviously big enough
for any function.

3 years agoIntroduce -print-changed=[diff | diff-quiet] which show changes in patch-like format
Jamie Schmeiser [Mon, 8 Feb 2021 15:09:34 +0000 (10:09 -0500)]
Introduce -print-changed=[diff | diff-quiet] which show changes in patch-like format
Summary:
Introduce base classes that hold a textual represent of the IR
based on basic blocks and a base class for comparing this
representation.  A new change printer is introduced that uses these
classes to save and compare representations of the IR before and after
each pass.  It only reports when changes are made by a pass (similar to
-print-changed) except that the changes are shown in a patch-like format
with those lines that are removed shown in red prefixed with '-' and those
added shown in green with '+'.  This functionality was introduced in my
tutorial at the 2020 virtual developer's meeting.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks)
Differential Revision: https://reviews.llvm.org/D91890

3 years ago[DAG] visitVECTOR_SHUFFLE - move shuffle legality check into MergeInnerShuffle lamda...
Simon Pilgrim [Mon, 8 Feb 2021 13:46:31 +0000 (13:46 +0000)]
[DAG] visitVECTOR_SHUFFLE - move shuffle legality check into MergeInnerShuffle lamda. NFCI.

This is going to be necessary for a future reuse of MergeInnerShuffle

3 years ago[RISCV] Use std::make_tuple to make some toolchains happy again
Mikael Holmen [Mon, 8 Feb 2021 13:30:48 +0000 (14:30 +0100)]
[RISCV] Use std::make_tuple to make some toolchains happy again

My toolchain (LLVM 8.0, libstdc++ 5.4.0) complained with:

12:38:19 ../lib/Target/RISCV/RISCVISelLowering.cpp:1717:12: error: chosen constructor is explicit in copy-initialization
12:38:19     return {RISCVISD::VECREDUCE_FADD, Op.getOperand(0),
12:38:19            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:38:19 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
12:38:19         constexpr tuple(_UElements&&... __elements)
12:38:19                   ^
12:38:19 ../lib/Target/RISCV/RISCVISelLowering.cpp:1720:12: error: chosen constructor is explicit in copy-initialization
12:38:19     return {RISCVISD::VECREDUCE_SEQ_FADD, Op.getOperand(1), Op.getOperand(0)};
12:38:19            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:38:19 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
12:38:19         constexpr tuple(_UElements&&... __elements)
12:38:19                   ^
12:38:19 2 errors generated.

This commit adds explicit calls to std::make_tuple to work around
the problem.

3 years ago[CodeGen][AArch64] Add TargetInstrInfo hook to modify the TailDuplicateSize default...
Nicholas Guy [Thu, 28 Jan 2021 17:22:21 +0000 (17:22 +0000)]
[CodeGen][AArch64] Add TargetInstrInfo hook to modify the TailDuplicateSize default threshold

Different targets might handle branch performance differently, so this patch allows for
targets to specify the TailDuplicateSize threshold. Said threshold defines how small a branch
can be and still be duplicated to generate straight-line code instead.
This patch also specifies said override values for the AArch64 subtarget.

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

3 years ago[MLIR][SPIRV] NFC: Split serialization code among multiple files.
KareemErgawy-TomTom [Mon, 8 Feb 2021 11:45:11 +0000 (12:45 +0100)]
[MLIR][SPIRV] NFC: Split serialization code among multiple files.

Following up on https://reviews.llvm.org/D94360, this patch splits the
serialization code into multiple source files to provide a better
structure and allow parallel compilation.

Reviewed By: antiagainst

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

3 years ago[ConstraintElimination] Improve index handing during constraint building.
Florian Hahn [Mon, 8 Feb 2021 12:28:52 +0000 (12:28 +0000)]
[ConstraintElimination] Improve index handing during constraint building.

This patch improves the index management during constraint building.
Previously, the code rejected constraints which used values that were not
part of Value2Index, but after combining the coefficients of the new
indices were 0 (if ShouldAdd was 0).

In those cases, no new indices need to be added. Instead of adding to
Value2Index directly, add new indices to the NewIndices map. The caller
can then check if it needs to add any new indices.

This enables checking constraints like `a + x <= a + n` to `x <= n`,
even if there is no constraint for `a` directly.

3 years ago[AMDGPU] Generate test checks and add GFX10 test coverage
Jay Foad [Fri, 5 Feb 2021 15:03:04 +0000 (15:03 +0000)]
[AMDGPU] Generate test checks and add GFX10 test coverage

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

3 years agoRevert "Re-land D94976 after revert in e29552c5aff6"
Jeremy Morse [Mon, 8 Feb 2021 12:33:56 +0000 (12:33 +0000)]
Revert "Re-land D94976 after revert in e29552c5aff6"

Maskray has reported a fault with .debug_gnu_pubnames in the comments on
D94976, caused by this patch, reverting to investigate.

This reverts commit 8998f5843503773c2f51fd475e2c77c687a65ee6.

3 years agoRevert "DebugInfo: Temporarily work around -gsplit-dwarf + LTO .debug_gnu_pubnames...
Jeremy Morse [Mon, 8 Feb 2021 11:37:53 +0000 (11:37 +0000)]
Revert "DebugInfo: Temporarily work around -gsplit-dwarf + LTO .debug_gnu_pubnames regression after D94976"

Backing out this workaround to focus on fixing whatever's wrong with
.debug_gnu_pubnames, I'll revert the cause, (8998f584) in the next commit.

This reverts commit 56fa34ae3570a34fd0f4c2cf1bfaf095da01a959.

3 years agoRevert "[Sema] Fix -Warray-bounds false negative when casting an out-of-bounds array...
einvbri [Mon, 8 Feb 2021 12:38:31 +0000 (06:38 -0600)]
Revert "[Sema] Fix -Warray-bounds false negative when casting an out-of-bounds array item"

This reverts commit e48f444751cf781c42934b242b81f549da77bad0.

thakis noticed false reports, so reverting this change for now until
those can be sorted out.

See https://reviews.llvm.org/D71714

3 years ago[clang][CodeComplete] Fix crash on ParenListExprs
Kadir Cetinkaya [Wed, 3 Feb 2021 11:45:46 +0000 (12:45 +0100)]
[clang][CodeComplete] Fix crash on ParenListExprs

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

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

3 years agoReapply "[clang][cli] Report result of ParseLangArgs"
Jan Svoboda [Mon, 8 Feb 2021 09:38:01 +0000 (10:38 +0100)]
Reapply "[clang][cli] Report result of ParseLangArgs"

This reverts commit 6039f821 and reapplies bff6d9bb.

Clang's Index/implicit-attrs.m test invokes c-index-test with -fobjc-arc. This flag is not compatible with -fobjc-runtime=gcc, which gets implied on Linux.

The original commit uncovered this by correctly reporting issues when parsing -cc1 command line.

This commit fixes the test to explicitly provide ObjectiveC runtime compatible with ARC.

3 years ago[lldb/tests] Removed add_test_categories decorator for python API tests, NFC
Tatyana Krasnukha [Wed, 3 Feb 2021 22:02:31 +0000 (01:02 +0300)]
[lldb/tests] Removed add_test_categories decorator for python API tests, NFC

There is a .categories file in the python_api directory that makes all nested tests
belong to the category "pyapi". The decorator is unnecessary for these tests.

3 years ago[lldb/tests] Un-skip TestGuiBasicDebug.py on Arm and AArch64
Tatyana Krasnukha [Wed, 3 Feb 2021 20:35:35 +0000 (23:35 +0300)]
[lldb/tests] Un-skip TestGuiBasicDebug.py on Arm and AArch64

The test was timing out because of https://reviews.llvm.org/D92164, it should pass now.

3 years agoReland "[lldb] Make CommandInterpreter's execution context the same as debugger's...
Tatyana Krasnukha [Fri, 18 Dec 2020 13:36:15 +0000 (16:36 +0300)]
Reland "[lldb] Make CommandInterpreter's execution context the same as debugger's one"

3 years ago[lldb] Debugger: reuse ExecutionContextRef to create ExecutionContext from Target
Tatyana Krasnukha [Mon, 1 Feb 2021 19:24:30 +0000 (22:24 +0300)]
[lldb] Debugger: reuse ExecutionContextRef to create ExecutionContext from Target

The Debugger didn't take the Process's run lock, that causes deadlocks and races
after applying https://reviews.llvm.org/D92164 revision. Since ExecutionContextRef
does the same job correctly, Debugger::GetSelectedExecutionContext just can use it
to build execution context upon the selected target.

3 years ago[AMDGPU]: Fixes an invalid clamp selection pattern.
Thomas Symalla [Tue, 2 Feb 2021 17:01:48 +0000 (18:01 +0100)]
[AMDGPU]: Fixes an invalid clamp selection pattern.

When running the tests on PowerPC and x86, the lit test GlobalISel/trunc.ll fails at the memory sanitize step. This seems to be due to wrong invalid logic (which matches even if it shouldn't) and likely missing variable initialisation."

Reviewed By: arsenm

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

3 years ago[MLIR][LangRef doc] Fix a small typo.
KareemErgawy-TomTom [Mon, 8 Feb 2021 11:22:01 +0000 (12:22 +0100)]
[MLIR][LangRef doc] Fix a small typo.

Reviewed By: mehdi_amini

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

3 years ago[ARM] Make v2f64 scalar_to_vector legal
David Green [Mon, 8 Feb 2021 11:34:55 +0000 (11:34 +0000)]
[ARM] Make v2f64 scalar_to_vector legal

Because we mark all operations as expand for v2f64, scalar_to_vector
would end up lowering through a stack store/reload. But it is pretty
simple to implement, only inserting a D reg into an undef vector. This
helps clear up some inefficient codegen from soft calling conventions.

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

3 years ago[AMDGPU][MC] Corrected error position for invalid dim modifiers
Dmitry Preobrazhensky [Mon, 8 Feb 2021 11:31:08 +0000 (14:31 +0300)]
[AMDGPU][MC] Corrected error position for invalid dim modifiers

Fixed bug 49054.

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

3 years agoFollow up to e05c10380ce7: add aarch64 to test XFails
Jeremy Morse [Mon, 8 Feb 2021 11:30:55 +0000 (11:30 +0000)]
Follow up to e05c10380ce7: add aarch64 to test XFails

3 years ago[ARM] Testing for stored extracted values. NFC
David Green [Mon, 8 Feb 2021 11:12:39 +0000 (11:12 +0000)]
[ARM] Testing for stored extracted values. NFC

3 years ago[ARM] Add some float Biquad cases showing difficult shuffling. NFC
David Green [Mon, 8 Feb 2021 10:50:23 +0000 (10:50 +0000)]
[ARM] Add some float Biquad cases showing difficult shuffling. NFC

3 years ago[AMDGPU][MC][GFX10] Improved errors reporting for invalid MIMG NSA operands
Dmitry Preobrazhensky [Mon, 8 Feb 2021 10:47:24 +0000 (13:47 +0300)]
[AMDGPU][MC][GFX10] Improved errors reporting for invalid MIMG NSA operands

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

3 years ago[ValueTypes] Fix size of nxv1f16 (32 -> 16).
Sander de Smalen [Fri, 5 Feb 2021 20:44:46 +0000 (20:44 +0000)]
[ValueTypes] Fix size of nxv1f16 (32 -> 16).

Clearly seems like this was a typo.

3 years ago[OpenCL] Do not enforce ASTContext for OCL2Qual
Sven van Haastregt [Mon, 8 Feb 2021 10:56:39 +0000 (10:56 +0000)]
[OpenCL] Do not enforce ASTContext for OCL2Qual

Do not enforce that the expression to obtain the QualType for an
OpenCL type starts with an ASTContext.  This adds the required
flexibility for handling the remaining missing argument types such as
enums.

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

3 years ago[LLDB] Fix buildbot regression in symbol-binding.test
Muhammad Omair Javaid [Mon, 8 Feb 2021 10:18:05 +0000 (15:18 +0500)]
[LLDB] Fix buildbot regression in symbol-binding.test

This patch fixes regression in symbol-binding.test due to change in
symbol order.

3 years ago[DebugInfo] Re-engineer a test to be stricter, add XFails
Jeremy Morse [Mon, 8 Feb 2021 09:54:01 +0000 (09:54 +0000)]
[DebugInfo] Re-engineer a test to be stricter, add XFails

In the LLVM-IR for this test, the inlined argument "b" in the "a" function
is optimized out on certain architectures, not on others. This hasn't been
reported as a test failure since 93faeecd8fa and ff2073a51 because we would
create a variable that looks like this:

  DW_TAG_formal_parameter
    DW_AT_abstract_origin

With no further information (and no location). With D95617 however, we
stop emitting such variables.

Prior to landing D95617: make this test stricter by checking that the
variable mentioned above has a location. We have to accept that on certain
architectures this goes missing, so add those to the XFail list.

I've run a few experiments, and right now it looks likely only powerpc64
still drops the variable location.

3 years ago[RISCV] Support the scalable-vector fadd reduction intrinsic
Fraser Cormack [Tue, 2 Feb 2021 14:34:51 +0000 (14:34 +0000)]
[RISCV] Support the scalable-vector fadd reduction intrinsic

This patch adds support for both the fadd reduction intrinsic, in both
the ordered and unordered modes.

The fmin and fmax intrinsics are not currently supported due to a
discrepancy between the LLVM semantics and the RVV ISA behaviour with
regards to signaling NaNs. This behaviour is likely fixed in version 2.3
of the RISC-V F/D/Q extension, but until then the intrinsics can be left
unsupported.

Reviewed By: craig.topper

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

3 years ago[Analysis] Remove unused functions from TargetLibraryInfo
David Sherwood [Wed, 3 Feb 2021 11:15:17 +0000 (11:15 +0000)]
[Analysis] Remove unused functions from TargetLibraryInfo

A simple clean-up to remove dead code.

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

3 years agoRevert "Revert "Reorder MLIRContext location in BuiltinAttributes.h""
Tres Popp [Mon, 8 Feb 2021 08:44:03 +0000 (09:44 +0100)]
Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h""

This reverts commit 511dd4f4383b1c2873beac4dbea2df302f1f9d0c along with
a couple fixes.

Original message:
Now the context is the first, rather than the last input.

This better matches the rest of the infrastructure and makes
it easier to move these types to being declaratively specified.

Phabricator: https://reviews.llvm.org/D96111

3 years ago[WebAssembly] Fix multiclass template parameter types. NFC.
Simon Pilgrim [Mon, 8 Feb 2021 09:35:59 +0000 (09:35 +0000)]
[WebAssembly] Fix multiclass template parameter types. NFC.

Fixes TableGen parser errors reported by D95874 due to incompatible types being used on multiclass templates.

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

3 years agoRevert "[clang][cli] Report result of ParseLangArgs"
Jan Svoboda [Mon, 8 Feb 2021 09:18:15 +0000 (10:18 +0100)]
Revert "[clang][cli] Report result of ParseLangArgs"

This reverts commit bff6d9bb

The change causes failure of Clang's Index/implicit-attrs.m test.

3 years ago[clang][cli] NFC: Mirror CreateFromArgs order in generateCC1CommandLine
Jan Svoboda [Mon, 8 Feb 2021 09:02:08 +0000 (10:02 +0100)]
[clang][cli] NFC: Mirror CreateFromArgs order in generateCC1CommandLine

3 years agoUse remote regnums in expedited list, value regs and invalidate regs
Muhammad Omair Javaid [Mon, 8 Feb 2021 09:08:19 +0000 (14:08 +0500)]
Use remote regnums in expedited list, value regs and invalidate regs

Native register descriptions in LLDB specify lldb register numbers in
value_regs and invalidate_regs lists. These register numbers may not
match with Process gdb-remote register numbers which are generated by
native process after counting all registers in its register sets.

It was coincidentally not causing any problems as we never came across
a native target with dynamically changing register sets and register
numbers generated by counter matched with LLDB native register numbers.
This came up while testing target AArch64 SVE which can choose register
sets based on underlying hardware.

This patch fixes this behavior and always tries to use remote register
numbers while reading/writing registers over gdb-remote protocol.

Reviewed By: labath

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

3 years ago[LLDB] Disable TestExprsChar.py, still fails on Arm/Linux
Muhammad Omair Javaid [Mon, 8 Feb 2021 09:05:31 +0000 (14:05 +0500)]
[LLDB] Disable TestExprsChar.py, still fails on Arm/Linux

TestExprsChar.py was enabled on Arm as it passes on apple silicon but
still fails on Arm/Linux.

3 years ago[clang][cli] Report result of ParseLangArgs
Jan Svoboda [Mon, 8 Feb 2021 08:44:11 +0000 (09:44 +0100)]
[clang][cli] Report result of ParseLangArgs

This patch correctly reports success/failure of `ParseLangArgs`. Besides being consistent with  other `Parse` functions, this is required to make round-tripping of `LangOptions` work.

Reviewed By: dexonsmith

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

3 years ago[modules] Put Frontend/OpenMP headers into a Clang module to fix the module build
Raphael Isemann [Mon, 8 Feb 2021 08:52:09 +0000 (09:52 +0100)]
[modules] Put Frontend/OpenMP headers into a Clang module to fix the module build

These headers can be in a Clang module like the rest. This also fixes the
modules build that is currently struggling with these headers being textually
included in several other modules.

3 years ago[clang][index] Mark file as C++ in parse-all-comments test
Jan Svoboda [Mon, 8 Feb 2021 08:36:28 +0000 (09:36 +0100)]
[clang][index] Mark file as C++ in parse-all-comments test

`CompilerInvocation::CreateFromArgs` doesn't always report command line parsing failures through the return value. Sometimes, errors are only reported via diagnostics.

Some clients like `c-index-test` only check the return value and don't check the state of `DiagnosticsEngine`.

If we were to start returning the correct return value from `CreateFromArgs`, this index test starts to fail, because it specifies `-std=c++11` for a C input, which is invalid.

This patch fixes that issue by adding forgotten `-x c++` argument.

Reviewed By: dexonsmith

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

3 years ago[ARM] i16 insert-of-extract to VINS pattern
David Green [Mon, 8 Feb 2021 08:41:07 +0000 (08:41 +0000)]
[ARM] i16 insert-of-extract to VINS pattern

This adds another tablegen fold that converts an i16 odd-lane-insert of
an even-lane-extract into a VINS. We extract the existing f32 value from
the destination register and VINS the new value into it. The rest of the
backend then is able to optimize the INSERT_SUBREG / COPY_TO_REGCLASS /
EXTRACT_SUBREG.

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

3 years ago[clang][cli] Generate and round-trip preprocessor options
Jan Svoboda [Mon, 8 Feb 2021 08:27:17 +0000 (09:27 +0100)]
[clang][cli] Generate and round-trip preprocessor options

This patch implements generation of remaining preprocessor options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

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

3 years agoRevert "Reorder MLIRContext location in BuiltinAttributes.h"
Tres Popp [Mon, 8 Feb 2021 08:32:27 +0000 (09:32 +0100)]
Revert "Reorder MLIRContext location in BuiltinAttributes.h"

This reverts commit 7827753f9810e846fb702f3e8dcff0bfb37344e1.

3 years agoReorder MLIRContext location in BuiltinAttributes.h
Tres Popp [Fri, 5 Feb 2021 08:19:57 +0000 (09:19 +0100)]
Reorder MLIRContext location in BuiltinAttributes.h

Now the context is the first, rather than the last input.

This better matches the rest of the infrastructure and makes
it easier to move these types to being declaratively specified.

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

3 years ago[clang][cli] Generate and round-trip analyzer options
Jan Svoboda [Mon, 8 Feb 2021 08:04:21 +0000 (09:04 +0100)]
[clang][cli] Generate and round-trip analyzer options

This patch implements generation of remaining analyzer options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

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

3 years ago[elf-core] Improve reading memory from core file
Djordje Todorovic [Wed, 30 Dec 2020 08:38:20 +0000 (00:38 -0800)]
[elf-core] Improve reading memory from core file

This patch tries to improve memory-read from core files
(in order to improve disassembly functionality).

I am using RHEL 7.7 (linux kernel 3.10) and for a lot of cases,
I was not able to disassemble some functions from backtrace when
debugging crashes from core files. It outputs some dummy code.

The cause of the problem was the fact we are returning all the zeros
from ProcessElfCore::ReadMemory() that is being called within
Disassembler::ParseInstructions() and it disassembles some dummy
opcodes from the buffer returned. Therefore, we are removing zero
bytes filling (padding) completely.

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

3 years ago[mlir][ODS] Allow to specify custom namespace for `NativeOpTrait`
Vladislav Vinogradov [Fri, 5 Feb 2021 12:55:59 +0000 (15:55 +0300)]
[mlir][ODS] Allow to specify custom namespace for `NativeOpTrait`

This will allow to use `NativeOpTrait` and Operations
declared outside of `mlir` namespace.

Reviewed By: ftynse

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

3 years ago[Test] Add failing test for PR49087
Max Kazantsev [Mon, 8 Feb 2021 06:18:22 +0000 (13:18 +0700)]
[Test] Add failing test for PR49087

3 years ago[scan-build-py] Update scan-build-py to allow outputing as SARIF
Daniel Hwang [Mon, 8 Feb 2021 02:22:03 +0000 (18:22 -0800)]
[scan-build-py] Update scan-build-py to allow outputing as SARIF

clang static analysis reports can be generated in html, plist, or sarif
format. This updates scan-build-py to be able to specify SARIF as the
desired output format, as previously it only support plist and html
formats.

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

3 years agoELFObjectWriter: Don't de-duplicate STT_FILE symbols
Fangrui Song [Mon, 8 Feb 2021 02:21:36 +0000 (18:21 -0800)]
ELFObjectWriter: Don't de-duplicate STT_FILE symbols

3 years agoELFObjectWriter: Make STT_FILE precede associated local symbols
Fangrui Song [Mon, 8 Feb 2021 01:51:40 +0000 (17:51 -0800)]
ELFObjectWriter: Make STT_FILE precede associated local symbols

3 years ago[MC][test] Improve STT_FILE tests
Fangrui Song [Mon, 8 Feb 2021 01:39:48 +0000 (17:39 -0800)]
[MC][test] Improve STT_FILE tests

3 years agoELFObjectWriter: Don't sort local symbols
Fangrui Song [Sun, 7 Feb 2021 23:47:10 +0000 (15:47 -0800)]
ELFObjectWriter: Don't sort local symbols

GNU as does not sort local symbols. This has several advantages:

* The .symtab order is roughly the symbol occurrence order.
* The closest preceding STT_SECTION symbol is the definition of a local symbol.
* The closest preceding STT_FILE symbol is the defining file of a local symbol, if there are multiple default-version .file directives. (Not implemented in MC.)

3 years ago[ConstraintElimination] Decompose zext for unsigned compares.
Florian Hahn [Sun, 7 Feb 2021 20:53:06 +0000 (20:53 +0000)]
[ConstraintElimination] Decompose zext for unsigned compares.

For unsigned compares, zext should be a no-op and we can add the
extended value to the constraint system.

3 years ago[LV] Replace some uses of VectorLoopValueMap with VPTransformState (NFC)
Florian Hahn [Sun, 7 Feb 2021 17:53:47 +0000 (17:53 +0000)]
[LV] Replace some uses of VectorLoopValueMap with VPTransformState (NFC)

This patch updates some places where VectorLoopValueMap is accessed
directly to instead go through VPTransformState.

As we move towards managing created values exclusively in VPTransformState,
this ensures the use always can fetch the correct value.

This is in preparation for D92285, which switches to managing scalarized
values through VPValues.

In the future, the various fix* functions should be moved directly into
the VPlan codegen stage.

Reviewed By: gilr

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

3 years ago[ConstraintElimination] Add additional tests.
Florian Hahn [Sun, 7 Feb 2021 11:54:35 +0000 (11:54 +0000)]
[ConstraintElimination] Add additional tests.

Adds additional test cases with zexts, conditions that require temporary
indices.