platform/upstream/llvm.git
4 years ago[BPF] Add preserve_access_index attribute for record definition
Yonghong Song [Sat, 2 Nov 2019 05:16:59 +0000 (22:16 -0700)]
[BPF] Add preserve_access_index attribute for record definition

This is a resubmission for the previous reverted commit
943436040121 with the same subject. This commit fixed the
segfault issue and addressed additional review comments.

This patch introduced a new bpf specific attribute which can
be added to struct or union definition. For example,
  struct s { ... } __attribute__((preserve_access_index));
  union u { ... } __attribute__((preserve_access_index));
The goal is to simplify user codes for cases
where preserve access index happens for certain struct/union,
so user does not need to use clang __builtin_preserve_access_index
for every members.

The attribute has no effect if -g is not specified.

When the attribute is specified and -g is specified, any member
access defined by that structure or union, including array subscript
access and inner records, will be preserved through
  __builtin_preserve_{array,struct,union}_access_index()
IR intrinsics, which will enable relocation generation
in bpf backend.

The following is an example to illustrate the usage:
  -bash-4.4$ cat t.c
  #define __reloc__ __attribute__((preserve_access_index))
  struct s1 {
    int c;
  } __reloc__;

  struct s2 {
    union {
      struct s1 b[3];
    };
  } __reloc__;

  struct s3 {
    struct s2 a;
  } __reloc__;

  int test(struct s3 *arg) {
    return arg->a.b[2].c;
  }
  -bash-4.4$ clang -target bpf -g -S -O2 t.c

A relocation with access string "0:0:0:0:2:0" will be generated
representing access offset of arg->a.b[2].c.

forward declaration with attribute is also handled properly such
that the attribute is copied and populated in real record definition.

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

4 years agoFix comment spelling {addresing -> addressing} (NFC)
Matthew Malcomson [Wed, 13 Nov 2019 15:50:44 +0000 (15:50 +0000)]
Fix comment spelling {addresing -> addressing} (NFC)

4 years ago[profile] Factor out logic for mmap'ing merged profile, NFC
Vedant Kumar [Tue, 12 Nov 2019 18:23:12 +0000 (10:23 -0800)]
[profile] Factor out logic for mmap'ing merged profile, NFC

Split out the logic to get the size of a merged profile and to do a
compatibility check. This can be shared with both the continuous+merging
mode implementation, as well as the runtime-allocated counters
implementation planned for Fuchsia.

Lifted out of D69586.

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

4 years ago[InstCombine] propagate fast-math-flags (FMF) to select when inverting fcmp+select
Sanjay Patel [Wed, 13 Nov 2019 15:35:34 +0000 (10:35 -0500)]
[InstCombine] propagate fast-math-flags (FMF) to select when inverting fcmp+select

As noted by the FIXME comment, this is not correct based on our current FMF semantics.
We should be propagating FMF from the final value in a sequence (in this case the
'select'). So the behavior even without this patch is wrong, but we did not allow FMF
on 'select' until recently.

But if we do the correct thing right now in this patch, we'll inevitably introduce
regressions because we have not wired up FMF propagation for 'phi' and 'select' in
other passes (like SimplifyCFG) or other places in InstCombine. I'm not seeing a
better incremental way to make progress.

That said, the potential extra damage over the existing wrong behavior from this
patch is very limited. AFAIK, the only way to have different FMF on IR in the same
function is if we have LTO inlined IR from 2 modules that were compiled using
different fast-math settings.

As seen in the tests, we may actually see some improvements with this patch because
adding the FMF to the 'select' allows matching to min/max intrinsics that were
previously missed (in the common case, the 'fcmp' and 'select' should have identical
FMF to begin with).

Next steps in the transition:

    Make similar changes in instcombine as needed.
    Enable phi-to-select FMF propagation in SimplifyCFG.
    Remove dependencies on fcmp with FMF.
    Deprecate FMF on fcmp.

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

4 years agoDWARFDebugLoclists: Add an api to get the location lists of a DWARF unit
Pavel Labath [Fri, 8 Nov 2019 11:18:07 +0000 (12:18 +0100)]
DWARFDebugLoclists: Add an api to get the location lists of a DWARF unit

Summary:
This avoid the need to duplicate the location lists searching logic in
various users. The "inline location list dumping" code (which is the
only user actually updated to handle DWARF v5 location lists)  is
switched to this method. After adding v4 location list support, I'll
switch other users too.

Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoRemove commented out CHECK-NEXT to try and appease llvm-clang-x86_64-expensive-checks...
Simon Pilgrim [Wed, 13 Nov 2019 14:59:12 +0000 (14:59 +0000)]
Remove commented out CHECK-NEXT to try and appease llvm-clang-x86_64-expensive-checks-win buildbot

4 years agoPowerPC - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Wed, 13 Nov 2019 14:39:54 +0000 (14:39 +0000)]
PowerPC - fix uninitialized variable warnings. NFCI.

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Wed, 13 Nov 2019 14:39:19 +0000 (14:39 +0000)]
Fix uninitialized variable warning. NFCI.

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Wed, 13 Nov 2019 14:38:58 +0000 (14:38 +0000)]
Fix uninitialized variable warning. NFCI.

4 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Wed, 13 Nov 2019 14:38:36 +0000 (14:38 +0000)]
Fix uninitialized variable warning. NFCI.

4 years agoSparc - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Wed, 13 Nov 2019 14:15:17 +0000 (14:15 +0000)]
Sparc - fix uninitialized variable warnings. NFCI.

4 years agoPPCReduceCRLogicals - fix static analyzer warnings. NFC
Simon Pilgrim [Wed, 13 Nov 2019 13:46:43 +0000 (13:46 +0000)]
PPCReduceCRLogicals - fix static analyzer warnings. NFC
- Fix uninitialized variable warnings.
- Fix null dereference warnings.

4 years agoSLPVectorizer - make comparison operators + isInSchedulingRegion const
Simon Pilgrim [Wed, 13 Nov 2019 13:45:15 +0000 (13:45 +0000)]
SLPVectorizer - make comparison operators + isInSchedulingRegion const

Fixes cppcheck warnings.

4 years ago[clang][Tooling] Filter flags that generate output in SyntaxOnlyAdjuster
Kadir Cetinkaya [Wed, 13 Nov 2019 12:44:40 +0000 (13:44 +0100)]
[clang][Tooling] Filter flags that generate output in SyntaxOnlyAdjuster

Summary:
Flags that generate output could result in failures when creating
syntax only actions. This patch introduces initial logic for filtering out
those. The first such flag is "save-temps", which saves intermediate
files(bitcode, assembly, etc.) into a specified directory.

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

Reviewers: hokein

Subscribers: ilya-biryukov, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Add bool return type to Index::refs API.
Haojian Wu [Wed, 13 Nov 2019 13:42:26 +0000 (14:42 +0100)]
[clangd] Add bool return type to Index::refs API.

Summary:
Similar to fuzzyFind, the bool indicates whether there are more xref
results.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

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

Tags: #clang

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

4 years ago[InstCombine] Avoid moving ops that do restrict undef across shuffles.
Florian Hahn [Wed, 13 Nov 2019 13:26:13 +0000 (13:26 +0000)]
[InstCombine] Avoid moving ops that do restrict undef across shuffles.

I think we have to be a bit more careful when it comes to moving
ops across shuffles, if the op does restrict undef. For example, without
this patch, we would move 'and %v, <0, 0, -1, -1>' over a
'shufflevector %a, undef, <undef, undef, 1, 2>'. As a result, the first
2 lanes of the result are undef after the combine, but they really
should be 0, unless I am missing something.

For ops that do fold to undef on undef operands, the current behavior
should be fine. I've add conservative check OpDoesRestrictUndef, maybe
there's a better existing utility?

Reviewers: spatel, RKSimon, lebedev.ri

Reviewed By: spatel

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

4 years agoRevert "[RISCV] Fix wrong CFI directives"
Luís Marques [Wed, 13 Nov 2019 13:28:33 +0000 (13:28 +0000)]
Revert "[RISCV] Fix wrong CFI directives"

test/DebugInfo/RISCV/relax-debug-frame.ll wasn't properly updated.

4 years ago[InstCombine] Precommit shuffle tests for D70093.
Florian Hahn [Mon, 11 Nov 2019 17:42:13 +0000 (17:42 +0000)]
[InstCombine] Precommit shuffle tests for D70093.

4 years ago[ARM][MVE] canTailPredicateLoop
Sjoerd Meijer [Wed, 13 Nov 2019 13:02:16 +0000 (13:02 +0000)]
[ARM][MVE] canTailPredicateLoop

This implements TTI hook 'preferPredicateOverEpilogue' for MVE.  This is a
first version and it operates on single block loops only. With this change, the
vectoriser will now determine if tail-folding scalar remainder loops is
possible/desired, which is the first step to generate MVE tail-predicated
vector loops.

This is disabled by default for now. I.e,, this is depends on option
-disable-mve-tail-predication, which is off by default.

I will follow up on this soon with a patch for the vectoriser to respect loop
hint 'vectorize.predicate.enable'. I.e., with this loop hint set to Disabled,
we don't want to tail-fold and we shouldn't query this TTI hook, which is
done in D70125.

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

4 years ago[RISCV] Fix wrong CFI directives
Luís Marques [Wed, 13 Nov 2019 12:58:00 +0000 (12:58 +0000)]
[RISCV] Fix wrong CFI directives

Summary: Removes CFI CFA directives that could incorrectly propagate
beyond the basic block they were inteded for. Specifically it removes
the epilogue CFI directives. See the branch_and_tail_call test for an
example of the issue. Should fix the stack unwinding issues caused by
the incorrect directives.

Reviewers: asb, lenary, shiva0217
Reviewed By: lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69723

4 years ago[ARM,MVE] Add intrinsics for contiguous load/stores.
Simon Tatham [Mon, 11 Nov 2019 17:02:39 +0000 (17:02 +0000)]
[ARM,MVE] Add intrinsics for contiguous load/stores.

This patch adds the ACLE intrinsics for all the MVE load and store
instructions not already handled by D69791. These ones don't need new
IR intrinsics, because they can be implemented in terms of standard
LLVM IR constructions.

Some of the load and store instructions access less than 128 bits of
memory, sign/zero extending each value to a wider vector lane on load
or truncating it on store. These are represented in IR by a load of a
shorter vector followed by a zext/sext, and conversely, a trunc
followed by a short store. Existing ISel patterns already recognize
those combinations and turn them into the right MVE instructions.

The predicated forms of all these instructions are represented in the
same way, except that the ordinary load/store operation is replaced
with the existing intrinsics @llvm.masked.{load,store}. These are
currently only code-generated as predicated MVE load/store
instructions if you give LLVM the `-enable-arm-maskedldst` option; so
I've done that in the LLVM codegen test. When we make that the
default, that option can be removed.

In the Tablegen backend, I've had to add a handful of extra support
features:

* We need to be able to make clang::Address objects out of a
  pointer and an alignment (previously we only needed these when the
  user passed us an existing one).

* We can now specify vector types that aren't 128 bits wide (for use
  in those intermediate values in IR), the parametrized type system
  can make one starting from two existing vector types (using the lane
  count of one and the element type of the other).

* I've added support for code generation of pointer casts, and for
  specifying LLVM types as operands to IRBuilder operations (for zext
  and sext, though I think they'll come in useful again).

* Now not all IR construction operations need to be specified as
  Builder.CreateFoo; some don't involve a Builder at all, and one
  passes it as a parameter to a tiny static helper function in
  CGBuiltin.cpp.

Reviewers: ostannard, MarkMurrayARM, dmgreen

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

Tags: #clang, #llvm

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

4 years ago[X86][AVX] Add plausible schedule classes to MASKPAIR/VP2INTERSECT/VDPBF16PS instructions
Simon Pilgrim [Wed, 13 Nov 2019 11:58:19 +0000 (11:58 +0000)]
[X86][AVX] Add plausible schedule classes to MASKPAIR/VP2INTERSECT/VDPBF16PS instructions

These are really just placeholders that use approximately the right resources - once we have CPUs scheduler models that support these instructions they will need revisiting.

In the meantime this means that all instructions have a class of some kind., meaning models can be more easily flagged as complete.

4 years ago[libomptarget] Move supporti.h to support.cu
JonChesterfield [Wed, 13 Nov 2019 11:36:30 +0000 (11:36 +0000)]
[libomptarget] Move supporti.h to support.cu

Summary:
[libomptarget] Move supporti.h to support.cu
Reimplementation of D69652, without the unity build and refactors.
Will need a clean build of libomptarget as the cmakelists changed.

Reviewers: ABataev, jdoerfert

Reviewed By: jdoerfert

Subscribers: mgorny, jfb, openmp-commits

Tags: #openmp

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

4 years agoRevert 57dd4b0 "[ValueTracking] Allow context-sensitive nullness check for non-pointers"
Hans Wennborg [Wed, 13 Nov 2019 10:59:22 +0000 (11:59 +0100)]
Revert 57dd4b0 "[ValueTracking] Allow context-sensitive nullness check for non-pointers"

This caused miscompiles of Chromium (https://crbug.com/1023818). The reduced
repro is small enough to fit here:

  $ cat /tmp/a.c
  unsigned char f(unsigned char *p) {
    unsigned char result = 0;
    for (int shift = 0; shift < 1; ++shift)
      result |= p[0] << (shift * 8);
    return result;
  }
  $ bin/clang -O2 -S -o - /tmp/a.c | grep -A4 f:
  f:                                      # @f
          .cfi_startproc
  # %bb.0:                                # %entry
          xorl    %eax, %eax
          retq

That's nicely optimized, but I don't think it's the right result :-)

> Same as D60846 but with a fix for the problem encountered there which
> was a missing context adjustment in the handling of PHI nodes.
>
> The test that caused D60846 to be reverted was added in e15ab8f277c7.
>
> Reviewers: nikic, nlopes, mkazantsev,spatel, dlrobertson, uabelho, hakzsam
>
> Subscribers: hiraditya, bollu, llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D69571

This reverts commit 57dd4b03e4806bbb4760ab6150940150d884df20.

4 years ago[Mips] Add rematerialization support for ldi.fmt
Mirko Brkusanin [Wed, 13 Nov 2019 10:22:35 +0000 (11:22 +0100)]
[Mips] Add rematerialization support for ldi.fmt

Instruction ldi.fmt can be considered cheap enough to avoid spill and restore
of value that it produces since it's loaded from immediate.

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

4 years ago[mips] Show an error if 64-bit target triple provided with 32-bit CPU
Simon Atanasyan [Wed, 13 Nov 2019 09:08:38 +0000 (12:08 +0300)]
[mips] Show an error if 64-bit target triple provided with 32-bit CPU

When a 64-bit triple is used emit an error if the CPU only supports
32-bit code.

Patch by Miloš Stojanović.

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

4 years ago[mips][test] Add Mips CPU tests. NFC
Simon Atanasyan [Wed, 13 Nov 2019 09:06:01 +0000 (12:06 +0300)]
[mips][test] Add Mips CPU tests. NFC

Adding tests check all available CPUs on Mips.

Patch by Miloš Stojanović.

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

4 years ago[OpenCL] Add remaining vector data builtin functions
Sven van Haastregt [Wed, 13 Nov 2019 10:16:33 +0000 (10:16 +0000)]
[OpenCL] Add remaining vector data builtin functions

Add the remaining half (fp16) vector data load and store builtin
functions from the OpenCL C specification.

Patch by Pierre Gondois and Sven van Haastregt.

4 years agoTemporarily revert "[InstCombine] Fold PHIs with equal incoming pointers"
Daniil Suchkov [Wed, 13 Nov 2019 10:14:11 +0000 (17:14 +0700)]
Temporarily revert "[InstCombine] Fold PHIs with equal incoming pointers"

Revert due to sanitizer-windows buildbot failure.

This reverts commit bbb29738b58aaf6f6518269abdcf8f64131665a9.

4 years ago[DebugInfo] Avoid creating entry values for clobbered registers
David Stenberg [Wed, 13 Nov 2019 09:37:53 +0000 (10:37 +0100)]
[DebugInfo] Avoid creating entry values for clobbered registers

Summary:
Entry values are considered for parameters that have register-described
DBG_VALUEs in the entry block (along with other conditions).

If a parameter's value has been propagated from the caller to the
callee, then the parameter's DBG_VALUE in the entry block may be
described using a register defined by some instruction, and entry values
should not be emitted for the parameter, which can currently occur.
One such case was seen in the attached test case, in which the second
parameter, which is described by a redefinition of the first parameter's
register, would incorrectly get an entry value using the first
parameter's register. This commit intends to solve such cases by keeping
track of register defines, and ignoring DBG_VALUEs in the entry block
that are described by such registers.

In a RelWithDebInfo build of clang-8, the average size of the set was
27, and in a RelWithDebInfo+ASan build it was 30.

Reviewers: djtodoro, NikolaPrica, aprantl, vsk

Reviewed By: djtodoro, vsk

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

4 years ago[DebugInfo] Add helper for finding entry value candidates [NFC]
David Stenberg [Wed, 13 Nov 2019 09:36:13 +0000 (10:36 +0100)]
[DebugInfo] Add helper for finding entry value candidates [NFC]

Summary:
The conditions that are used to determine if entry values should be
emitted for a parameter are quite many, and will grow slightly
in a follow-up commit, so move those to a helper function, as was
suggested in the code review for D69889.

Reviewers: djtodoro, NikolaPrica

Reviewed By: djtodoro

Subscribers: probinson, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AArch64] Extend storeRegToStackSlot to spill SVE registers.
Sander de Smalen [Wed, 13 Nov 2019 09:57:51 +0000 (09:57 +0000)]
[AArch64] Extend storeRegToStackSlot to spill SVE registers.

This patch allows the register allocator to spill SVE registers to the stack.

Reviewers: ostannard, efriedma, rengolin, cameron.mcinally

Reviewed By: efriedma

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

4 years ago[InstCombine] Fold PHIs with equal incoming pointers
Daniil Suchkov [Fri, 8 Nov 2019 07:29:04 +0000 (14:29 +0700)]
[InstCombine] Fold PHIs with equal incoming pointers

In case when all incoming values of a PHI are equal pointers, this
transformation inserts a definition of such a pointer right after
definition of the base pointer and replaces with this value both PHI and
all it's incoming pointers. Primary goal of this transformation is
canonicalization of this pattern in order to enable optimizations that
can't handle PHIs. Non-inbounds pointers aren't currently supported.

Reviewers: spatel, RKSimon, lebedev.ri, apilipenko

Reviewed By: apilipenko

Tags: #llvm

Subscribers: hiraditya, llvm-commits

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

4 years ago[AArch64][SVE] Allocate locals that are scalable vectors.
Sander de Smalen [Wed, 13 Nov 2019 08:31:49 +0000 (08:31 +0000)]
[AArch64][SVE] Allocate locals that are scalable vectors.

This patch adds a target interface to set the StackID for a given type,
which allows scalable vectors (e.g. `<vscale x 16 x i8>`) to be assigned a
'sve-vec' StackID, so it is allocated in the SVE area of the stack frame.

Reviewers: ostannard, efriedma, rengolin, cameron.mcinally

Reviewed By: efriedma

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

4 years ago[ARM,MVE] Use VMOV.{S8,S16} for sign-extended extractelement.
Simon Tatham [Tue, 12 Nov 2019 14:48:22 +0000 (14:48 +0000)]
[ARM,MVE] Use VMOV.{S8,S16} for sign-extended extractelement.

MVE includes instructions that extract an 8- or 16-bit lane from a
vector and sign-extend it into the output 32-bit GPR. `ARMInstrMVE.td`
already included isel patterns to select those instructions in
response to the `ARMISD::VGETLANEs` selection-DAG node type. But
`ARMISD::VGETLANEs` was never actually generated, because the code
that creates it was conditioned on NEON only.

It's an easy fix to enable the same code for integer MVE, and now IR
that sign-extends the result of an extractelement (whether explicitly
or as part of the function call ABI) will use `vmov.s8` instead of
`vmov.u8` followed by `sxtb`.

Reviewers: SjoerdMeijer, dmgreen, ostannard

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libcxx testing] Fix -Wtautological-overlap-compare bug
David Zarzycki [Wed, 13 Nov 2019 08:55:19 +0000 (10:55 +0200)]
[libcxx testing] Fix -Wtautological-overlap-compare bug

4 years ago[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (4)
joanlluch [Wed, 13 Nov 2019 08:23:08 +0000 (09:23 +0100)]
[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (4)

Summary:
Replaces
```
unsigned getShiftAmountThreshold(EVT VT)
```
by

```
bool shouldAvoidTransformToShift(EVT VT, unsigned amount)
```
thus giving more flexibility for targets to decide whether particular shift amounts must be considered expensive or not.

Updates the MSP430 target with a custom implementation.

This continues  D69116, D69120, D69326 and updates them, so all of them must be committed before this.

Existing tests apply, a few more have been added.

Reviewers: asl, spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Remove setOperationAction for FP_TO_SINT v8i16.
Craig Topper [Wed, 13 Nov 2019 06:44:48 +0000 (22:44 -0800)]
[X86] Remove setOperationAction for FP_TO_SINT v8i16.

This is no longer needed after widening legalization as we
custom legalize v8i8 ourselves.

Added entries to the cost model, but bumped the cost slightly
to account for the truncate shuffle that wasn't costed before.

4 years ago[GPGPU] Fix regression test after 395124.
Michael Kruse [Wed, 13 Nov 2019 06:20:17 +0000 (06:20 +0000)]
[GPGPU] Fix regression test after 395124.

Commit 395124 "NVPTX: Don't insert an extra empty line at the end of the last section"
changed the length of the kernel payload. Update the regression test to the new binary size.

4 years ago[Reproducer] Discard reproducer directory if not generated.
Jonas Devlieghere [Wed, 13 Nov 2019 04:16:33 +0000 (20:16 -0800)]
[Reproducer] Discard reproducer directory if not generated.

If lldb was run in capture mode, but no reproducer was generated, make
sure we clean up the reproducer directory.

4 years ago[VFABI] Add LLVM internal mangling for vector functions.
Francesco Petrogalli [Mon, 11 Nov 2019 16:48:51 +0000 (16:48 +0000)]
[VFABI] Add LLVM internal mangling for vector functions.

Summary:
This patch adds a custom ISA for vector functions for internal use
in LLVM. The <isa> token is set to "_LLVM_", and it is not attached
to any specific instruction Vector ISA, or Vector Function ABI.

The ISA is used as a token for handling Vector Function ABI-style
vectorization for those vector functions that are not directly
associated to any existing Vector Function ABI (for example, some of
the vector functions exposed by TargetLibraryInfo). The demangling
function for this ISA in a Vector Function ABI context is set to be
the same as the common one shared between X86 and AArch64.

Reviewers: jdoerfert, sdesmalen, simoll

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAdd 8548 CPU definition and attributes
Justin Hibbits [Thu, 24 Oct 2019 21:22:47 +0000 (16:22 -0500)]
Add 8548 CPU definition and attributes

8548 CPU is GCC's name for the e500v2, so accept this in clang.  The
e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well,
as GCC does.

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

4 years agoAMDGPU: Extend add x, (ext setcc) combine to sub
Matt Arsenault [Tue, 12 Nov 2019 03:41:00 +0000 (09:11 +0530)]
AMDGPU: Extend add x, (ext setcc) combine to sub

This is the same as the add case, but inverts the operation type.

This avoids regressions in a future patch.

4 years agoAMDGPU: Switch backend default max workgroup size to 1024
Matt Arsenault [Tue, 27 Aug 2019 16:34:40 +0000 (12:34 -0400)]
AMDGPU: Switch backend default max workgroup size to 1024

Previously this would default to 256, not the maximum supported size
of 1024. Using a maximum lower than the hardware maximum requires
language runtimes to enforce this limit for correctness, which no
language has correctly done. Switch the default to the conservatively
correct maximum, and force frontends to opt-in to the more optimal 256
default maximum.

I don't really understand why the changes in occupancy-levels.ll
increased the computed occupancy, which I expected to decrease. I'm
not sure if these tests should be forcing the old maximum.

4 years agoAMDGPU Reduce reported maximum group size to 1024
Matt Arsenault [Tue, 27 Aug 2019 17:03:36 +0000 (13:03 -0400)]
AMDGPU Reduce reported maximum group size to 1024

While some targets allow encoding 2048, this was never tested or
supported.

4 years ago[GlobalsAA] Reenable test.
Alina Sbirlea [Wed, 13 Nov 2019 00:19:14 +0000 (16:19 -0800)]
[GlobalsAA] Reenable test.

4 years ago[LLDB] Add core definition for armv8l and armv7l
Muhammad Omair Javaid [Wed, 13 Nov 2019 00:30:25 +0000 (05:30 +0500)]
[LLDB] Add core definition for armv8l and armv7l

This patch adds core definitions in lldb ArchSpecs for armv8l and armv7l cores.

This was needed because on Linux running on 32-bit Arm v8 we are returned
armv8l in case we are running 32-bit sysroot on 64bit kernel. In case of 32-bit
kernel and 32-bit sysroot running on arm v8 hardware we are returned armv7l.
This is quite common when we run 32 bit arm using docker container.

Signed-off-by: Muhammad Omair Javaid <omair.javaid@linaro.org>
Differential Revision: https://reviews.llvm.org/D69904

4 years agoDon't assume that the clang binary's resolved name includes the string
Richard Smith [Wed, 13 Nov 2019 00:35:36 +0000 (16:35 -0800)]
Don't assume that the clang binary's resolved name includes the string
'clang'.

This is not true in practice in some content-addressed file systems.

4 years ago[Sema] Add MacroQualified case for FunctionTypeUnwrapper
Leonard Chan [Wed, 13 Nov 2019 00:22:13 +0000 (16:22 -0800)]
[Sema] Add MacroQualified case for FunctionTypeUnwrapper

This is a fix for PR43315. An assertion error is hit for this minimal example:

```
//clang -cc1 -triple x86_64-- -S tstVMStructRC-min.cpp
int (a b)();  // Assertion `Chunk.Kind == DeclaratorChunk::Function' failed.
```

This is because we do not cover the case in the FunctionTypeUnwrapper where it
receives a MacroQualifiedType. We have not run into this earlier because this
is a unique case where the __attribute__ contains both __cdecl__ and
__regparm__ (in that order), and we are compiling for x86_64. Changing the
architecture or the order of __cdecl__ and __regparm__ does not raise the
assertion.

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

4 years agoTemporarily disable test.
Alina Sbirlea [Tue, 12 Nov 2019 23:56:53 +0000 (15:56 -0800)]
Temporarily disable test.

4 years agoTemporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken python...
Eric Christopher [Tue, 12 Nov 2019 23:51:51 +0000 (15:51 -0800)]
Temporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken python 3.6.

Reverting to figure out if it's a problem in python or the compiler for now.

This reverts commit 885a05f48a5d320946c89590b73a764e5884fe4f.

4 years ago[LLDB] Only set FRAMEWORK when we're actually building a framework.
Jonas Devlieghere [Tue, 12 Nov 2019 23:42:07 +0000 (15:42 -0800)]
[LLDB] Only set FRAMEWORK when we're actually building a framework.

4 years ago[LLDB] Remove debug message in AddLLDB.cmake
Jonas Devlieghere [Tue, 12 Nov 2019 23:32:50 +0000 (15:32 -0800)]
[LLDB] Remove debug message in AddLLDB.cmake

4 years agoAdd a shim for setenv on PS4 since it does not exist.
Douglas Yung [Tue, 12 Nov 2019 23:05:45 +0000 (15:05 -0800)]
Add a shim for setenv on PS4 since it does not exist.

A few years back a similar change was made for getenv since neither function is supported on the PS4 platform.

Recently, commit d889d1e added a call to setenv in compiler-rt which was causing linking errors because the symbol was not found. This fixes that issue by putting in a shim similar to how we previously dealt with the lack of getenv.

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

4 years ago[X86] Don't consider v64i1 as a legal type unless v64i8 is also a legal type.
Craig Topper [Tue, 12 Nov 2019 21:17:00 +0000 (13:17 -0800)]
[X86] Don't consider v64i1 as a legal type unless v64i8 is also a legal type.

This avoids some nasty issues with argument passing and lowering of
arbitrary v64i8 shuffles.

4 years ago[X86] Only pass v64i8/v32i16 as v16i32 on non-avx512bw targets if the v16i32 type...
Craig Topper [Tue, 12 Nov 2019 20:26:18 +0000 (12:26 -0800)]
[X86] Only pass v64i8/v32i16 as v16i32 on non-avx512bw targets if the v16i32 type won't be split by prefer-vector-width=256

Otherwise just let the v64i8/v32i16 types be split to v32i8/v16i16.

In reality this shouldn't happen because it means we have a 512-bit
vector argument, but min-legal-vector-width says a value less than
512. But a 512-bit argument should have been factored into the
preferred vector width.

4 years agoFix include guard and properly order __deregister_frame_info.
Sterling Augustine [Fri, 8 Nov 2019 23:51:35 +0000 (15:51 -0800)]
Fix include guard and properly order __deregister_frame_info.

Summary:
This patch fixes two problems with the crtbegin.c as written:

1. In do_init, register_frame_info is not guarded by a #define, but in
do_fini, deregister_frame_info is guarded by #ifndef
CRT_HAS_INITFINI_ARRAY. Thus when CRT_HAS_INITFINI_ARRAY is not
defined, frames are registered but then never deregistered.

The frame registry mechanism builds a linked-list from the .so's
static variable do_init.object, and when the .so is unloaded, this
memory becomes invalid and should be deregistered.

Further, libgcc's crtbegin treats the frame registry as independent
from the initfini array mechanism.

This patch fixes this by adding a new #define,
"EH_USE_FRAME_INFO_REGISTRY", which is set by the cmake option
COMPILER_RT_CRT_USE_EH_FRAME_REGISTRY Currently, do_init calls
register_frame_info, and then calls the binary's constructors. This
allows constructors to safely use libunwind. However, do_fini calls
deregister_frame_info and then calls the binary's destructors. This
prevents destructors from safely using libunwind.

This patch also switches that ordering, so that destructors can safely
use libunwind. As it happens, this is a fairly common scenario for
thread sanitizer.

4 years agoAdd -Wtautological-compare to -Wall
Weverything [Tue, 12 Nov 2019 21:46:03 +0000 (13:46 -0800)]
Add -Wtautological-compare to -Wall

Some warnings in -Wtautological-compare subgroups are DefaultIgnore.
Adding this group to -Wmost, which is part of -Wall, will aid in their
discoverability.

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

4 years ago[BPF] generate BTF_KIND_VARs for all non-static globals
Yonghong Song [Tue, 12 Nov 2019 19:31:52 +0000 (11:31 -0800)]
[BPF] generate BTF_KIND_VARs for all non-static globals

Enable to generate BTF_KIND_VARs for non-static
default-section globals which is not allowed previously.
Modified the existing test case to accommodate the new change.

Also removed unused linkage enum members VAR_GLOBAL_TENTATIVE and
VAR_GLOBAL_EXTERNAL.

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

4 years ago[GlobalsAA] Restrict ModRef result if any internal method has its address taken.
Alina Sbirlea [Thu, 31 Oct 2019 19:35:46 +0000 (12:35 -0700)]
[GlobalsAA] Restrict ModRef result if any internal method has its address taken.

Summary:
If there are any internal methods whose address was taken, conclude there is nothing known in relation of any other internal method and a global.

Reviewers: nlopes, sanjoy.google

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[LLDB] Fix/silence CMake developer warning for LLDB framework.
Jonas Devlieghere [Tue, 12 Nov 2019 22:15:06 +0000 (14:15 -0800)]
[LLDB] Fix/silence CMake developer warning for LLDB framework.

This fixes the following warning for developers:

  Target 'liblldb' was changed to a FRAMEWORK sometime after install().  This
  may result in the wrong install DESTINATION.  Set the FRAMEWORK property
  earlier.

The solution is to pass the FRAMEWORK flag to add_lldb_library and set
the target property before install(). For now liblldb is the only
customer.

4 years ago[GVNHoist] Preserve AAResults.
Alina Sbirlea [Tue, 12 Nov 2019 22:07:32 +0000 (14:07 -0800)]
[GVNHoist] Preserve AAResults.

Resolves PR38906, PR40898.

4 years agoAllow additional file suffixes/extensions considered as source in main include grouping
mydeveloperday [Tue, 12 Nov 2019 21:15:17 +0000 (21:15 +0000)]
Allow additional file suffixes/extensions considered as source in main include grouping

Summary:
By additional regex match, grouping of main include can be enabled in files that are not normally considered as a C/C++ source code.
For example, this might be useful in templated code, where template implementations are being held in *Impl.hpp files.
On the occassion, 'assume-filename' option description was reworded as it was misleading. It has nothing to do with `style=file` option and it does not influence sourced style filename.

Reviewers: rsmith, ioeric, krasimir, sylvestre.ledru, MyDeveloperDay

Reviewed By: MyDeveloperDay

Subscribers: MyDeveloperDay, cfe-commits

Patch by:  furdyna

Tags: #clang

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

4 years ago[LLDB] Always remove debugserver from LLVM_DISTRIBUTION_COMPONENTS
Jonas Devlieghere [Tue, 12 Nov 2019 20:57:00 +0000 (12:57 -0800)]
[LLDB] Always remove debugserver from LLVM_DISTRIBUTION_COMPONENTS

Centralize the logic to remove debugserver from
LLVM_DISTRIBUTION_COMPONENTS when LLDB_USE_SYSTEM_DEBUGSERVER is
enabled. Now this happens regardless of whether the tests are enabled.

4 years ago[AArch64] Update for Exynos
Evandro Menezes [Tue, 12 Nov 2019 20:28:25 +0000 (14:28 -0600)]
[AArch64] Update for Exynos

Fix the modeling for loads and stores using the register offset addresing mode.

4 years ago[AArch64] Fix addressing mode predicates
Evandro Menezes [Tue, 12 Nov 2019 20:13:30 +0000 (14:13 -0600)]
[AArch64] Fix addressing mode predicates

Fix predicates related to the register offset addressing mode.

4 years ago[CodeGen] Fix getArrayAccessFor crashes as in bug 32534 with -polly-vectorizer=polly.
Michael Kruse [Tue, 12 Nov 2019 19:48:07 +0000 (13:48 -0600)]
[CodeGen] Fix getArrayAccessFor crashes as in bug 32534 with -polly-vectorizer=polly.

Root cause is VectorBlockGenerator::copyStmt iterates all instructions
in basic block, however some load instructions may be not unnecessary
thus removed by simplification. As a result, these load instructions
don't have a corresponding array.

Looking at BlockGenerator::copyBB, it only iterates instructions list
of ScopStmt. Given it must be a block type scop in case of
vectorization, I think we should do the same in
VectorBlockGenerator::copyStmt.

Patch by bin.narwal <bin.narwal@gmail.com>

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

4 years ago[Analyzer] Use a reference in a range-based for
Mark de Wever [Tue, 12 Nov 2019 19:51:06 +0000 (20:51 +0100)]
[Analyzer] Use a reference in a range-based for

Let the checkers use a reference instead of a copy in a range-based
for loop.

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[OpenMP] Use an explicit copy in a range-based for
Mark de Wever [Tue, 12 Nov 2019 19:48:11 +0000 (20:48 +0100)]
[OpenMP] Use an explicit copy in a range-based for

The std::pair<const clang::ValueDecl *, llvm::ArrayRef<clang::OMPClauseMappableExprCommon::MappableComponent>>
type will be copied in a range-based for loop. Make the copy explicit to
avoid the -Wrange-loop-analysis warning.

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[AST] Use an explicit copy in a range-based for
Mark de Wever [Tue, 12 Nov 2019 19:46:19 +0000 (20:46 +0100)]
[AST] Use an explicit copy in a range-based for

The AssociationIteratorTy type will be copied in a range-based for loop.
Make the copy explicit to avoid the -Wrange-loop-analysis warning.

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[LLDB][Formatters] Re-enable std::function formatter with fixes to improve non-cached...
shafik [Tue, 12 Nov 2019 19:23:38 +0000 (11:23 -0800)]
[LLDB][Formatters] Re-enable std::function formatter with fixes to improve non-cached lookup performance

Performance issues lead to the libc++ std::function formatter to be disabled. We addressed some of those performance issues by adding caching see D67111
This PR fixes the first lookup performance by not using FindSymbolsMatchingRegExAndType(...) and instead finding the compilation unit the std::function wrapped callable should be in and then searching for the callable directly in the CU.

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

4 years ago[llvm-objcopy][COFF] Implement --redefine-sym and --redefine-syms
Fangrui Song [Sat, 9 Nov 2019 00:19:33 +0000 (16:19 -0800)]
[llvm-objcopy][COFF] Implement --redefine-sym and --redefine-syms

The parsing error tests in ELF/redefine-symbols.test are not specific to ELF.
Move them to redefine-symbols.test.
Add COFF/redefine-symbols.test for COFF specific tests.

Also fix the documentation regarding --redefine-syms: the old and new
names are separated by whitespace, not an equals sign.

Reviewed By: mstorsjo

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

4 years ago[ObjectFileMachO] Fix the build for __arm64__.
Davide Italiano [Tue, 12 Nov 2019 19:10:36 +0000 (11:10 -0800)]
[ObjectFileMachO] Fix the build for __arm64__.

Catch up with an API change.

4 years agoARM: Don't emit R_ARM_NONE relocations to compact unwinding decoders in .ARM.exidx...
Peter Collingbourne [Fri, 8 Nov 2019 19:03:34 +0000 (11:03 -0800)]
ARM: Don't emit R_ARM_NONE relocations to compact unwinding decoders in .ARM.exidx on Android.

These relocations are specified by the ARM EHABI (section 6.3). As I understand
it, their purpose is to accommodate unwinder implementations that wish to
reduce code size by placing the implementations of the compact unwinding
decoders in a separate translation unit, and using extern weak symbols to
refer to them from the main unwinder implementation, so that they are only
linked when something in the binary needs them in order to unwind.

However, neither of the unwinders used on Android (libgcc, LLVM libunwind)
use this technique, and in fact emitting these relocations ends up being
counterproductive to code size because they cause a copy of the unwinder
to be statically linked into most binaries, regardless of whether it is
actually needed. Furthermore, these relocations create circular dependencies
(between libc and the unwinder) in cases where the unwinder is dynamically
linked and libc contains compact unwind info.

Therefore, deviate from the EHABI here and stop emitting these relocations
on Android.

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

4 years agoFix build with shared libraries. NFC.
Michael Liao [Tue, 12 Nov 2019 18:37:27 +0000 (13:37 -0500)]
Fix build with shared libraries. NFC.

- Dependent components need linking directly.

4 years ago[OPENMP]Use copy constructors instead of assignment operators in declare
Alexey Bataev [Tue, 12 Nov 2019 16:19:26 +0000 (11:19 -0500)]
[OPENMP]Use copy constructors instead of assignment operators in declare
reduction initializers.

Better to use copy constructor at the initialization of the declare
reduction construct rather than assignment operator.

4 years ago[libcxxabi] Prevent cmake from removing our explicit system C++ include paths
Sam Clegg [Thu, 7 Nov 2019 22:51:25 +0000 (14:51 -0800)]
[libcxxabi] Prevent cmake from removing our explicit system C++ include paths

We build with `-nostdinc++` and add our own header path via
`LIBCXXABI_LIBCXX_INCLUDES`.  However cmake tried to be clever and if
`LIBCXXABI_LIBCXX_INCLUDES` happens to match the compilers system path
it will remove the `-I` flag meaning we can't access any C++ headers.

Ideally cmake would be able see that we are using `-nostdinc++` and
disable this behaviour.

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

4 years ago[Hexagon] Update PS_aligna with max stack alignment once isel completes
Krzysztof Parzyszek [Tue, 12 Nov 2019 17:42:27 +0000 (11:42 -0600)]
[Hexagon] Update PS_aligna with max stack alignment once isel completes

4 years agoPerformance: Add a set of visited SymbolFiles to the other FindFiles variant.
Adrian Prantl [Tue, 12 Nov 2019 17:25:59 +0000 (09:25 -0800)]
Performance: Add a set of visited SymbolFiles to the other FindFiles variant.

This is basically the same bug as in r260434.

SymbolFileDWARF::FindTypes has exponential worst-case when digging
through dependency DAG of .pcm files because each object file and .pcm
file may depend on an already-visited .pcm file, which may again have
dependencies. Fixed here by carrying a set of already visited
SymbolFiles around.

rdar://problem/56993424

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

4 years ago[lit] Better/earlier errors for empty runs
Julian Lettner [Tue, 12 Nov 2019 16:24:26 +0000 (08:24 -0800)]
[lit] Better/earlier errors for empty runs

Fail early, when we discover no tests at all, or filter out all of them.

There is also `--allow-empty-runs` to disable test to allow workflows
like `LIT_FILTER=abc ninja check-all`.  Apparently `check-all` invokes
lit multiple times if certain projects are enabled, which would produce
unwanted "empty runs". Specify via `LIT_OPTS=--allow-empty-runs`.

There are 3 causes for empty runs:
1) No tests discovered.  This is always an error.  Fix test suite config
   or command line.
2) All tests filtered out.  This is an error by default, but can be
   suppressed via `--alow-empty-runs`.  Should prevent accidentally
   passing empty runs, but allow the workflow above.
3) The number of shards is greater than the number of tests.  Currently,
   this is never an error.  Personally, I think we should consider
   making this an error by default; if this happens, you are doing
   something wrong. I added a warning but did not change the behavior,
   since this warrants more discussion.

Reviewed By: atrick, jdenny

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

4 years agoclang/Modules: Error if ReadASTBlock does not find the main module
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 21:14:52 +0000 (13:14 -0800)]
clang/Modules: Error if ReadASTBlock does not find the main module

If ReadASTBlock does not find its top-level submodule, there's something
wrong the with the PCM.  Error in that case, to avoid hitting problems
further from the source.

Note that the Swift compiler sometimes hits a case in
CompilerInstance::loadModule where the top-level submodule mysteriously
does not have Module::IsFromModuleFile set.  That will emit a confusing
warn_missing_submodule, which was never intended for the main module.
The recent audit of error-handling in ReadAST may have rooted out the
real problem.  If not, this commit will help to clarify the real
problem, and replace a confusing warning with an error pointing at the
malformed PCM file.

We're specifically sniffing out whether the top-level submodule was
found/processed, in case there is a malformed module file that is
missing it.  If there is an error encountered during ReadSubmoduleBlock
the return status should already propagate through.  It would be nice to
detect other missing submodules around here to catch other instances of
warn_missing_submodule closer to the source, but that's left as a future
exercise.

https://reviews.llvm.org/D70063

4 years ago[SLP] add test for miscompile with reduction (PR43948); NFC
Sanjay Patel [Tue, 12 Nov 2019 16:36:41 +0000 (11:36 -0500)]
[SLP] add test for miscompile with reduction (PR43948); NFC

4 years ago[Hexagon] Fix vector spill expansion to use proper alignment
Krzysztof Parzyszek [Mon, 11 Nov 2019 15:05:21 +0000 (09:05 -0600)]
[Hexagon] Fix vector spill expansion to use proper alignment

1. Add pseudos PS_vloadrv_ai and PS_vstorerv_ai: those are now used
   for single vector registers in loadRegFromStackSlot (and store...).
2. Remove pseudos PS_vloadrwu_ai and PS_vstorerwu_ai. The alignment is
   now checked when expanding spill pseudos (both in frame lowering
   and in expand-post-ra-pseudos), and a proper instruction is generated.
3. Update MachineMemOperands when dealigning vector spill slots.
4. Return vector predicate registers in getCallerSavedRegs.

4 years ago[Hexagon] Convert stack object offsets to int64, NFC
Krzysztof Parzyszek [Mon, 11 Nov 2019 14:49:07 +0000 (08:49 -0600)]
[Hexagon] Convert stack object offsets to int64, NFC

This will print [SP-56] instead of [SP+4294967240].

4 years ago[Hexagon] Handle stack realignment in hexagon-vextract
Krzysztof Parzyszek [Sat, 9 Nov 2019 01:07:02 +0000 (19:07 -0600)]
[Hexagon] Handle stack realignment in hexagon-vextract

4 years ago[Hexagon] Require PS_aligna whenever variable-sized objects are present
Krzysztof Parzyszek [Sat, 9 Nov 2019 01:05:28 +0000 (19:05 -0600)]
[Hexagon] Require PS_aligna whenever variable-sized objects are present

4 years ago[PowerPC] Remove allow-deprecated-dag-overlap and fix broken tests
Jinsong Ji [Tue, 12 Nov 2019 15:00:09 +0000 (15:00 +0000)]
[PowerPC] Remove allow-deprecated-dag-overlap and fix broken tests

Summary:
This is found during review of https://reviews.llvm.org/D67088.

CHECK-DAG is non-overlapping after https://reviews.llvm.org/D47106.
-allow-deprecated-dag-overlap was introduced to temporary accept old
behavior.

But it actually hide some broken tests, eg: `test/CodeGen/PowerPC/swaps-le-1.ll`
The codegen has changed, but the CHECK-DAG still PASS due to allowing `overlap`.

This patch remove the deprecated options, and fix the broken tests.

Reviewers: #powerpc, hfinkel, nemanjai, steven.zhang, shchenz

Reviewed By: shchenz

Subscribers: shchenz, llvm-commits

Tags: #llvm

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

4 years ago[DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable...
Tom Weaver [Tue, 12 Nov 2019 15:17:04 +0000 (15:17 +0000)]
[DBG][OPT] Attempt to salvage or undef debug info when removing trivially deletable instructions in the Reassociate Expression pass.

Reviewed By: aprantl, vsk

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

4 years ago[PowerPC][NFC]Fix typo in desc for enable-ppc-prefetching
Jinsong Ji [Tue, 12 Nov 2019 14:46:57 +0000 (14:46 +0000)]
[PowerPC][NFC]Fix typo in desc for enable-ppc-prefetching

4 years ago[Examples] Add IRTransformations directory to examples.
Florian Hahn [Tue, 12 Nov 2019 14:06:12 +0000 (14:06 +0000)]
[Examples] Add IRTransformations directory to examples.

This patch adds a new IRTransformations directory to llvm/examples/. This is
intended to serve as a new home for example transformations/analysis
code used by various tutorials.

If LLVM_BUILD_EXAMPLES is enabled, the ExamplesIRTransforms library is
linked into the opt binary and the example passes become available.

To start off with, it contains the CFG simplifications used in the IR
part of the 'Getting Started With LLVM: Basics' tutorial at the US LLVM
Developers Meeting 2019.

Reviewers: paquette, jfb, meikeb, lhames, kbarton

Reviewed By: paquette

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

4 years agoRevert "Fix lookup of symbols at the same address with no size vs. size"
Muhammad Omair Javaid [Tue, 12 Nov 2019 13:48:32 +0000 (18:48 +0500)]
Revert "Fix lookup of symbols at the same address with no size vs. size"

This reverts commit 3f594ed1686b44138bee245c708773e526643aaf.

This change has cause LLDB expression evaluation to fail on Arm Linux.

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

4 years ago[lldb] Fix more -Wdeprecated-copy warnings
Pavel Labath [Tue, 12 Nov 2019 13:25:18 +0000 (14:25 +0100)]
[lldb] Fix more -Wdeprecated-copy warnings

This warning triggers when a class defines a copy constructor but not a
copy-assignment operator (which then gets auto-generated by the
compiler). Fix the warning by deleting the other operator too, as the
default implementation works just fine.

4 years ago[lldb] Fix some warnings in the python plugin
Pavel Labath [Tue, 12 Nov 2019 13:33:52 +0000 (14:33 +0100)]
[lldb] Fix some warnings in the python plugin

4 years agoMark llvm::ConstantExpr::getAsInstruction as const
Alex Denisov [Tue, 12 Nov 2019 09:57:32 +0000 (10:57 +0100)]
Mark llvm::ConstantExpr::getAsInstruction as const

Summary:
getAsInstruction is the only non-const member method.
It is impossible to enforce const-correctness because of it.

Reviewers: jmolloy, majnemer

Reviewed By: jmolloy

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAArch64: add arm64_32 support to Clang.
Tim Northover [Tue, 18 Sep 2018 09:34:39 +0000 (10:34 +0100)]
AArch64: add arm64_32 support to Clang.

4 years ago[lldb] [Process/NetBSD] Use PT_STOP to stop the process [NFCI]
Michał Górny [Sun, 10 Nov 2019 17:39:55 +0000 (18:39 +0100)]
[lldb] [Process/NetBSD] Use PT_STOP to stop the process [NFCI]

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

4 years ago[AArch64ExpandPseudos] Preserve renamable state when expanding MOVi64 & co.
Florian Hahn [Tue, 12 Nov 2019 10:35:31 +0000 (10:35 +0000)]
[AArch64ExpandPseudos] Preserve renamable state when expanding MOVi64 & co.

If the MOVi operand was renamable, the operands of the expanded
instructions are also renamable.

Reviewers: thegameg, samparker, zatrazz

Reviewed By: thegameg

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

4 years ago[InstCombine] Skip scalable vectors in combineLoadToOperationType
Diana Picus [Thu, 7 Nov 2019 12:09:32 +0000 (13:09 +0100)]
[InstCombine] Skip scalable vectors in combineLoadToOperationType

Don't try to canonicalize loads to scalable vector types to loads
of integers.

This removes one assertion when trying to use a TypeSize as a parameter
to DataLayout::isLegalInteger. It does not handle the second part of the
function (which looks at bitcasts).

This patch also contains a NFC fix for Load Analysis, where a variable
initialization that would cause the same assertion is moved closer to
its use. This allows us to run the new test for InstCombine without
having to teach LocationSize to play nicely with scalable vectors.

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

4 years ago[X86] Cleanup prefixes + regenerate for fp-intrinsics-fma.ll
Simon Pilgrim [Tue, 12 Nov 2019 11:24:00 +0000 (11:24 +0000)]
[X86] Cleanup prefixes + regenerate for fp-intrinsics-fma.ll

4 years agoFileCheckPattern::FindRegexVarEnd - make helper function static. NFC
Simon Pilgrim [Tue, 12 Nov 2019 11:14:03 +0000 (11:14 +0000)]
FileCheckPattern::FindRegexVarEnd - make helper function static. NFC

Fixes cppcheck warning.