platform/upstream/llvm.git
3 years agoAMDGPU: Fix verifier error with undef source producing s_bitset*
Matt Arsenault [Wed, 5 Aug 2020 13:42:14 +0000 (09:42 -0400)]
AMDGPU: Fix verifier error with undef source producing s_bitset*

This needs to preserve the undef flag.

3 years ago[InstSimplify] fold icmp with mul nsw and constant operands
Sanjay Patel [Wed, 5 Aug 2020 18:37:05 +0000 (14:37 -0400)]
[InstSimplify] fold icmp with mul nsw and constant operands

https://rise4fun.com/Alive/slvl

  Name: mul nsw with icmp eq
  Pre: (C2 % C1) != 0
  %a = mul nsw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = false

  Name: mul nsw with icmp ne
  Pre: (C2 % C1) != 0
  %a = mul nsw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = true

Follow-up to the 'nuw' variation added with:
rGf879c9b79621

3 years ago[lldb/test] Use realpath consistently for test root file paths.
Jordan Rupprecht [Wed, 5 Aug 2020 18:35:37 +0000 (11:35 -0700)]
[lldb/test] Use realpath consistently for test root file paths.

LLDB tests assume that tests are in the test tree (the `LLDB_TEST_SRC` env variable, configured by `dotest.py`).
If this assertion doesn't hold, tests fail in strange ways. An early place this goes wrong is in `compute_mydir` which does a simple length-based substring to get the relative path. Later, we use that path to chdir to. If the test file and test tree don't agree in realpath-ness (and therefore length), this will be a cryptic error of chdir-ing to a directory that does not exist.

The actual discrepency is that the places we look for `use_lldb_suite.py` don't use a realpath, but `dotest.py` does (see initialization of `configuration.testdirs`).

It doesn't particularly matter whether we use realpath or abspath to canonicalize things, but many places end up with implicit dependencies on the canonicalized pwd being a realpath, so make them realpath consistently. Also, in the `compute_mydir` method mentioned, raise an error if the path types don't agree.

Reviewed By: JDevlieghere

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

3 years ago[InstSimplify] fold icmp with mul nuw and constant operands
Sanjay Patel [Wed, 5 Aug 2020 17:41:05 +0000 (13:41 -0400)]
[InstSimplify] fold icmp with mul nuw and constant operands

https://rise4fun.com/Alive/pZEr

  Name: mul nuw with icmp eq
  Pre: (C2 %u C1) != 0
  %a = mul nuw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = false

  Name: mul nuw with icmp ne
  Pre: (C2 %u C1) != 0
  %a = mul nuw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = true

There are potentially several other transforms we need to add based on:
D51625
...but it doesn't look like there was follow-up to that patch.

3 years ago[InstSimplify] add vector tests for icmp with mul nuw; NFC
Sanjay Patel [Wed, 5 Aug 2020 17:09:20 +0000 (13:09 -0400)]
[InstSimplify] add vector tests for icmp with mul nuw; NFC

Also, the naming was off on a couple of tests.

3 years ago[clang-format] fix BreakBeforeBraces.MultiLine with for each macros
Mitchell Balan [Wed, 5 Aug 2020 18:29:57 +0000 (14:29 -0400)]
[clang-format] fix BreakBeforeBraces.MultiLine with for each macros
Summary:
The MultiLine option in BreakBeforeBraces was only handling standard
control statement, leading to invalid indentation with for each macros:

Previous behavior:

/* invalid: brace should be on the same line */
Q_FOREACH(int a; list)
{
    foo();
}

/* valid */
Q_FOREACH(int longVariable;
          list)
{
    foo();
}

To fix this, simply add the TT_ForEachMacro kind in the list of
recognized control statements for the multiline option.

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=44632

Reviewers: MyDeveloperDay, mitchell-stellar

Reviewed by: mitchell-stellar

Contributed by: vthib

Subscribers: cfe-commits

Tags: #clang, #clang-format, #clang-tools-extra

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

3 years ago[flang][NFC] Unify OpenMP and OpenACC structure checker
Valentin Clement [Wed, 5 Aug 2020 18:20:26 +0000 (14:20 -0400)]
[flang][NFC] Unify OpenMP and OpenACC structure checker

This patch remove duplicated code between the check-omp-structure and the check-acc-structure
and unify it into a check-directive-structure templated class.

Reviewed By: kiranchandramohan, sscalpone, ichoyjx

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

3 years ago[mlir][nfc] Rename `promoteMemRefDescriptors` to `promoteOperands`.
Alexander Belyaev [Wed, 5 Aug 2020 16:41:29 +0000 (18:41 +0200)]
[mlir][nfc] Rename `promoteMemRefDescriptors` to `promoteOperands`.

`promoteMemRefDescriptors` also converts types of every operand, not only
memref-typed ones. I think `promoteMemRefDescriptors` name does not imply that.

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

3 years ago[libFuzzer] Do not link pthreads on Android.
Matt Morehouse [Wed, 5 Aug 2020 18:11:42 +0000 (11:11 -0700)]
[libFuzzer] Do not link pthreads on Android.

Android has pthreads included in bionic and doesn't recognize -lpthread.

3 years ago[MLIR][LinAlg] Use AnyTypeOf for LinalgOperand for better error msg.
Vincent Zhao [Wed, 5 Aug 2020 18:06:17 +0000 (20:06 +0200)]
[MLIR][LinAlg] Use AnyTypeOf for LinalgOperand for better error msg.

Previously, `LinalgOperand` is defined with `Type<Or<..,>>`, which produces
not very readable error messages when it is not matched, e.g.,

```
'linalg.generic' op operand #0 must be anonymous_326, but got ....
```

It is simply because the `description` property is not properly set.

This diff switches to use `AnyTypeOf` for `LinalgOperand`, which automatically
generates a description based on the allowed types provided.

As a result, the error message now becomes:

```
'linalg.generic' op operand #0 must be ranked tensor of any type values or strided memref of any type values, but got ...
```

Which is clearer and more informative.

Reviewed By: nicolasvasilache

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

3 years agoRemove Olesen from LLVM code owners
Paul C. Anagnostopoulos [Wed, 5 Aug 2020 18:09:12 +0000 (11:09 -0700)]
Remove Olesen from LLVM code owners

I contacted Jakob Olesen about TableGen and he replied that he is no longer involved with the project.

Reviewed By: dblaikie

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

3 years ago[clangd] Hide "swap if branch" tweak
Haojian Wu [Wed, 5 Aug 2020 18:03:21 +0000 (20:03 +0200)]
[clangd] Hide "swap if branch" tweak

This tweak is more like a demo, and doesn't provide much value in
practice.

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

3 years agoFix _ExtInt(1) to be a i1 in memory.
Erich Keane [Wed, 5 Aug 2020 17:52:42 +0000 (10:52 -0700)]
Fix _ExtInt(1) to be a i1 in memory.

The _ExtInt(1) in getTypeForMem was hitting the bool logic for expanding
to an 8 bit value.  The result was an assert, or store i1 %0, i8* %2, align 1
since the parameter IS an i1.  This patch changes the 'forMem' test to
exclude ext-int from the bool test.

3 years ago[LIBOMPTARGET]Fix order of mapper data for targetDataEnd function.
Alexey Bataev [Tue, 4 Aug 2020 15:42:26 +0000 (11:42 -0400)]
[LIBOMPTARGET]Fix order of mapper data for targetDataEnd function.

targetDataMapper function fills arrays with the mapping data in the
direct order. When this function is called by targetDataBegin or
tgt_target_update functions, it works as expected. But targetDataEnd
function processes mapped data in reverse order. In this case, the base
pointer might be deleted before the associated data is deleted. Need to
reverse data, mapped by mapper, too, since it always adds data that must
be deleted at the end of the buffer.
Fixes the test declare_mapper_target_update.cpp.
Also, reduces the memry fragmentation by preallocation the memory
buffers.

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

3 years ago[msan] Remove readnone and friends from call sites.
Evgenii Stepanov [Tue, 4 Aug 2020 23:46:35 +0000 (16:46 -0700)]
[msan] Remove readnone and friends from call sites.

MSan removes readnone/readonly and similar attributes from callees,
because after MSan instrumentation those attributes no longer apply.

This change removes the attributes from call sites, as well.

Failing to do this may cause DSE of paramTLS stores before calls to
readonly/readnone functions.

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

3 years ago[X86][SSE] Fold 128-bit PACK(EXTEND(X),EXTEND(Y)) -> CONCAT(X,Y) subvectors
Simon Pilgrim [Wed, 5 Aug 2020 17:09:22 +0000 (18:09 +0100)]
[X86][SSE] Fold 128-bit PACK(EXTEND(X),EXTEND(Y)) -> CONCAT(X,Y) subvectors

This is seen in the sub-128-bit vector trunc(ext()) of comparison results

Fixes pr46585.ll regression in D66004

3 years agoRevert "[LoopVectorizer] Inloop vector reductions"
Jordan Rupprecht [Wed, 5 Aug 2020 17:22:27 +0000 (10:22 -0700)]
Revert "[LoopVectorizer] Inloop vector reductions"

This reverts commit e9761688e41cb979a1fa6a79eb18145a75104933. It breaks the build:

```
~/src/llvm-project/llvm/lib/Analysis/IVDescriptors.cpp:868:10: error: no viable conversion from returned value of type 'SmallVector<[...], 8>' to function return type 'SmallVector<[...], 4>'
  return ReductionOperations;
```

3 years ago[TFUtils] Expose untyped accessor to evaluation result tensors
Mircea Trofin [Wed, 5 Aug 2020 17:22:45 +0000 (10:22 -0700)]
[TFUtils] Expose untyped accessor to evaluation result tensors

These were implementation detail, but become necessary for generic data
copying.

Also added const variations to them, and move assignment, since we had a
move ctor (and the move assignment helps in a subsequent patch).

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

3 years ago[lldb/test] Replace LLDB_TEST_SRC env variable with configuration
Jordan Rupprecht [Wed, 5 Aug 2020 15:50:41 +0000 (08:50 -0700)]
[lldb/test] Replace LLDB_TEST_SRC env variable with configuration

Reviewed By: JDevlieghere

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

3 years ago[ASan][Darwin] Adapt test for macOS 11+ version scheme
Julian Lettner [Wed, 5 Aug 2020 17:11:50 +0000 (10:11 -0700)]
[ASan][Darwin] Adapt test for macOS 11+ version scheme

This test depends on the versioning scheme of OSX.

3 years ago[LoopVectorizer] Inloop vector reductions
David Green [Wed, 5 Aug 2020 17:14:05 +0000 (18:14 +0100)]
[LoopVectorizer] Inloop vector reductions

Arm MVE has multiple instructions such as VMLAVA.s8, which (in this
case) can take two 128bit vectors, sign extend the inputs to i32,
multiplying them together and sum the result into a 32bit general
purpose register. So taking 16 i8's as inputs, they can multiply and
accumulate the result into a single i32 without any rounding/truncating
along the way. There are also reduction instructions for plain integer
add and min/max, and operations that sum into a pair of 32bit registers
together treated as a 64bit integer (even though MVE does not have a
plain 64bit addition instruction). So giving the vectorizer the ability
to use these instructions both enables us to vectorize at higher
bitwidths, and to vectorize things we previously could not.

In order to do that we need a way to represent that the reduction
operation, specified with a llvm.experimental.vector.reduce when
vectorizing for Arm, occurs inside the loop not after it like most
reductions. This patch attempts to do that, teaching the vectorizer
about in-loop reductions. It does this through a vplan recipe
representing the reductions that the original chain of reduction
operations is replaced by. Cost modelling is currently just done through
a prefersInloopReduction TTI hook (which follows in a later patch).

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

3 years ago[NFC][InstCombine] Negator: include all the needed headers, IWYU
Roman Lebedev [Wed, 5 Aug 2020 17:11:48 +0000 (20:11 +0300)]
[NFC][InstCombine] Negator: include all the needed headers, IWYU

3 years ago[lldb] Add an option to inherit TCC permissions from parent.
Jonas Devlieghere [Wed, 5 Aug 2020 17:02:51 +0000 (10:02 -0700)]
[lldb] Add an option to inherit TCC permissions from parent.

Add an option that allows the user to decide to not make the inferior is
responsible for its own TCC permissions. If you don't make the inferior
responsible, it inherits the permissions of its parent. The motivation
is the scenario of running the LLDB test suite from an external hard
drive. If the inferior is responsible, every test needs to be granted
access to the external volume. When the permissions are inherited,
approval needs to be granted only once.

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

3 years ago[lldb] Make SBTarget::LaunchSimple start form the target's LaunchInfo
Jonas Devlieghere [Wed, 5 Aug 2020 16:34:18 +0000 (09:34 -0700)]
[lldb] Make SBTarget::LaunchSimple start form the target's LaunchInfo

Currently SBTarget::LaunchSimple creates a new LaunchInfo which means it
ignores any target properties that have been set. Instead, it should
start from the target's LaunchInfo and populated the specified fields.

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

3 years agoRemove special Hexagon packet traversal code
Ted Woodward [Thu, 30 Jul 2020 18:37:43 +0000 (13:37 -0500)]
Remove special Hexagon packet traversal code

On Hexagon, breakpoints need to be on the first instruction of a packet.
When the LLVM disassembler for Hexagon returned 32 bit instructions, we
needed code to find the start of the current packet. Now that the LLVM
disassembler for Hexagon returns packets instead of instructions, we always
have the first instruction of the packet. Remove the packet traversal code
because it can cause problems when the next packet has more than one
instruction.

Reviewed By: clayborg

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

3 years ago[InstCombine] Negator: 0 - (X + Y) --> (-X) - Y iff a single operand negated
Roman Lebedev [Wed, 5 Aug 2020 16:17:56 +0000 (19:17 +0300)]
[InstCombine] Negator: 0 - (X + Y)  -->  (-X) - Y  iff a single operand negated

This was the most obvious regression in
f5df5cd5586ae9cfb2d9e53704dfc76f47aff149.f5df5cd5586ae9cfb2d9e53704dfc76f47aff149

We really don't want to do this if the original/outermost subtraction
isn't a negation, and therefore doesn't go away - just sinking negation
isn't a win. We are actually appear to be missing folds so hoist it.

https://rise4fun.com/Alive/tiVe

3 years ago[NFC][InstCombine] Tests for negation of `add` w/ single negatible operand
Roman Lebedev [Wed, 5 Aug 2020 16:06:40 +0000 (19:06 +0300)]
[NFC][InstCombine] Tests for negation of `add` w/ single negatible operand

3 years ago[InstSimplify] add tests for icmp with 'mul nuw' operand; NFC
Sanjay Patel [Wed, 5 Aug 2020 16:26:56 +0000 (12:26 -0400)]
[InstSimplify] add tests for icmp with 'mul nuw' operand; NFC

3 years ago[MLIR][NFC] Fix clang-tidy warnings in std to llvm conversion
Uday Bondhugula [Wed, 5 Aug 2020 16:33:35 +0000 (22:03 +0530)]
[MLIR][NFC] Fix clang-tidy warnings in std to llvm conversion

Fix clang-tidy warnings in std to llvm conversion.

3 years ago[mlir] Fix rank bitwidth in UnrankedMemRefType conversion.
Alexander Belyaev [Wed, 5 Aug 2020 13:30:21 +0000 (15:30 +0200)]
[mlir] Fix rank bitwidth in UnrankedMemRefType conversion.

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

3 years ago[ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD
Fangrui Song [Wed, 5 Aug 2020 16:30:23 +0000 (09:30 -0700)]
[ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD

GNU ld allows sections after a non-SHF_ALLOC section to be covered by PT_LOAD
(PR37607) and assigns addresses to non-SHF_ALLOC output sections (similar to
SHF_ALLOC NOBITS sections. The location counter is not advanced).

This patch tries to fix PR37607 (remove a special case in
`Writer<ELFT>::createPhdrs`). To make the created PT_LOAD meaningful, we cannot
reset dot to 0 for a middle non-SHF_ALLOC output section. This results in
removal of two special cases in LinkerScript::assignOffsets. Non-SHF_ALLOC
non-orphan sections can have non-zero addresses like in GNU ld.

The zero address rule for non-SHF_ALLOC sections is weakened to apply to orphan
only. This results in a special case in createSection and findOrphanPos, respectively.

Reviewed By: jhenderson

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

3 years ago[ELF] --icf: don't fold text sections with LSDA
Fangrui Song [Tue, 4 Aug 2020 23:05:14 +0000 (16:05 -0700)]
[ELF] --icf: don't fold text sections with LSDA

Fix PR36272 and PR46835

A .eh_frame FDE references a text section and (optionally) a LSDA (in
.gcc_except_table).  Even if two text sections have identical content and
relocations (e.g. a() and b()), we cannot fold them if their LSDA are different.

```
void foo();
void a() {
  try { foo(); } catch (int) { }
}
void b() {
  try { foo(); } catch (float) { }
}
```

Scan .eh_frame pieces with LSDA and disallow referenced text sections to be
folded. If two .gcc_except_table have identical semantics (usually identical
content with PC-relative encoding), we will lose folding opportunity.
For ClickHouse (an exception-heavy application), this can reduce --icf=all efficiency
from 9% to 5%. There may be some percentage we can reclaim without affecting
correctness, if we analyze .eh_frame and .gcc_except_table sections.

gold 2.24 implemented a more complex fix (resolution to
https://sourceware.org/bugzilla/show_bug.cgi?id=21066) which combines the
checksum of .eh_frame CIE/FDE pieces.

Reviewed By: grimar

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

3 years ago[ELF] --oformat=binary: use LMA to compute file offsets
Fangrui Song [Wed, 5 Aug 2020 16:04:56 +0000 (09:04 -0700)]
[ELF] --oformat=binary: use LMA to compute file offsets

--oformat=binary is rare (used in a few places in FreeBSD, see `stand/i386/mbr/Makefile` `LDFLAGS_BIN`)
The result should be identical to a normal output transformed by `objcopy -O binary`.

The current implementation ignores addresses and lays out sections by
respecting output section alignments. It can fail when an output section
address is specified, e.g. `.rodata ALIGN(16) :` (PR33651).

Fix PR33651 by respecting LMA. The code is similar to
`tools/llvm-objcop/ELF/Object.cpp` BinaryWriter::finalize after D71035 and D79229.
Unforunately for an output section without PT_LOAD, we assume its LMA is equal
to its VMA. So the result is still incorrect when an output section LMA
(`AT(...)`) is specified

Also drop `alignTo(off, config->wordsize)`. GNU ld does not round up the file size.

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

3 years agoAdd libFuzzer shared object build output
Matt Morehouse [Wed, 5 Aug 2020 15:15:57 +0000 (08:15 -0700)]
Add libFuzzer shared object build output

This change adds a CMake rule to produce shared object versions of
libFuzzer (no-main). Like the static library versions, these shared
libraries have a copy of libc++ statically linked in. For i386 we don't
link with libc++ since i386 does not support mixing position-
independent and non-position-independent code in the same library.

Patch By: IanPudney

Reviewed By: morehouse

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

3 years ago[JITLink][AArch64] Handle addends on PAGE21 / PAGEOFF12 relocations.
Lang Hames [Wed, 5 Aug 2020 04:25:48 +0000 (21:25 -0700)]
[JITLink][AArch64] Handle addends on PAGE21 / PAGEOFF12 relocations.

3 years ago[JITLink][AArch64] Improve debug output for addend relocations.
Lang Hames [Wed, 5 Aug 2020 04:01:41 +0000 (21:01 -0700)]
[JITLink][AArch64] Improve debug output for addend relocations.

3 years agoMachO: support `-syslibroot`
Saleem Abdulrasool [Sat, 20 Jun 2020 04:13:03 +0000 (21:13 -0700)]
MachO: support `-syslibroot`

This adds support for the `-syslibroot` option.  This is required to
make the library search order actually function.  With this, it is now
possible to link a test Darwin x86_64 program with lld on Darwin.

Differential Revision: https://reviews.llvm.org/D82252
Reviewed By: Jez Ng

3 years ago[InstSimplify] reduce code duplication in simplifyICmpWithMinMax(); NFC
Sanjay Patel [Wed, 5 Aug 2020 15:30:25 +0000 (11:30 -0400)]
[InstSimplify] reduce code duplication in simplifyICmpWithMinMax(); NFC

3 years ago[clangd] Fix a crash in DefineInline
Kadir Cetinkaya [Wed, 5 Aug 2020 11:34:05 +0000 (13:34 +0200)]
[clangd] Fix a crash in DefineInline

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

3 years agoBump forgotten version nbr in llvm/docs/conf.py
Hans Wennborg [Wed, 5 Aug 2020 15:11:59 +0000 (17:11 +0200)]
Bump forgotten version nbr in llvm/docs/conf.py

3 years ago[libc] [obvious] Add ctype functions to linux api.
Chris Gyurgyik [Wed, 5 Aug 2020 15:05:50 +0000 (11:05 -0400)]
[libc] [obvious] Add ctype functions to linux api.

Adds isspace, isprint, and isxdigit to Linux API to fix failed integration test.

3 years ago[libc] Add isspace, isprint, isxdigit implementations.
cgyurgyik [Wed, 5 Aug 2020 14:42:30 +0000 (10:42 -0400)]
[libc] Add isspace, isprint, isxdigit implementations.

Reviewed By: sivachandra

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

3 years ago[X86] isHorizontalBinOp - only update LHS/RHS references on success
Simon Pilgrim [Wed, 5 Aug 2020 14:09:37 +0000 (15:09 +0100)]
[X86] isHorizontalBinOp - only update LHS/RHS references on success

We've had issues in the past where isHorizontalBinOp calls would affect later combines as the LHS/RHS references had been commuted but still failed to match.

3 years ago[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for integer...
Simon Pilgrim [Wed, 5 Aug 2020 13:30:26 +0000 (14:30 +0100)]
[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for integer types

3 years ago[llvm-readobj] - Make decode_relrs() don't return Expected<>. NFCI.
Georgii Rymar [Wed, 5 Aug 2020 13:30:28 +0000 (16:30 +0300)]
[llvm-readobj] - Make decode_relrs() don't return Expected<>. NFCI.

The `decode_relrs` helper is declared as:

`Expected<std::vector<Elf_Rel>> decode_relrs(Elf_Relr_Range relrs) const;`

it never returns an error though and hence can be simplified to return
a vector.

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

3 years ago[OpenMP] Fix `omp target update` for array extension
Joel E. Denny [Wed, 5 Aug 2020 13:00:12 +0000 (09:00 -0400)]
[OpenMP] Fix `omp target update` for array extension

OpenMP TR8 sec. 2.15.6 "target update Construct", p. 183, L3-4 states:

> If the corresponding list item is not present in the device data
> environment and there is no present modifier in the clause, then no
> assignment occurs to or from the original list item.

L10-11 states:

> If a present modifier appears in the clause and the corresponding
> list item is not present in the device data environment then an
> error occurs and the program termintates.

(OpenMP 5.0 also has the first passage but without mention of the
present modifier of course.)

In both passages, I assume "is not present" includes the case of
partially but not entirely present.  However, without this patch, the
target update directive misbehaves in this case both with and without
the present modifier.  For example:

```
 #pragma omp target enter data map(to:arr[0:3])
 #pragma omp target update to(arr[0:5]) // might fail on data transfer
 #pragma omp target update to(present:arr[0:5]) // might fail on data transfer
```

The problem is that `DeviceTy::getTgtPtrBegin` does not return a null
pointer in that case, so `target_data_update` sees the data as fully
present, and the data transfer then might fail depending on the target
device.  However, without the present modifier, there should never be
a failure.  Moreover, with the present modifier, there should always
be a failure, and the diagnostic should mention the present modifier.

This patch fixes `DeviceTy::getTgtPtrBegin` to return null when
`target_data_update` is the caller.  I'm wondering if it should do the
same for more callers.

Reviewed By: grokos, jdoerfert

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

3 years ago[OpenMP][Docs] Mark `present` map type modifier as done
Joel E. Denny [Wed, 5 Aug 2020 12:55:22 +0000 (08:55 -0400)]
[OpenMP][Docs] Mark `present` map type modifier as done

3 years ago[OpenMP][Docs] Add map clause reordering status as unclaimed
Joel E. Denny [Wed, 5 Aug 2020 12:53:58 +0000 (08:53 -0400)]
[OpenMP][Docs] Add map clause reordering status as unclaimed

3 years ago[OpenMP] Fix `present` for exit from `omp target data`
Joel E. Denny [Wed, 5 Aug 2020 12:45:33 +0000 (08:45 -0400)]
[OpenMP] Fix `present` for exit from `omp target data`

Without this patch, the following example fails but shouldn't
according to OpenMP TR8:

```
 #pragma omp target enter data map(alloc:i)
 #pragma omp target data map(present, alloc: i)
 {
   #pragma omp target exit data map(delete:i)
 } // fails presence check here
```

OpenMP TR8 sec. 2.22.7.1 "map Clause", p. 321, L23-26 states:

> If the map clause appears on a target, target data, target enter
> data or target exit data construct with a present map-type-modifier
> then on entry to the region if the corresponding list item does not
> appear in the device data environment an error occurs and the
> program terminates.

There is no corresponding statement about the exit from a region.
Thus, the `present` modifier should:

1. Check for presence upon entry into any region, including a `target
   exit data` region.  This behavior is already implemented correctly.

2. Should not check for presence upon exit from any region, including
   a `target` or `target data` region.  Without this patch, this
   behavior is not implemented correctly, breaking the above example.

In the case of `target data`, this patch fixes the latter behavior by
removing the `present` modifier from the map types Clang generates for
the runtime call at the end of the region.

In the case of `target`, we have not found a valid OpenMP program for
which such a fix would matter.  It appears that, if a program can
guarantee that data is present at the beginning of a `target` region
so that there's no error there, that data is also guaranteed to be
present at the end.  This patch adds a comment to the runtime to
document this case.

Reviewed By: grokos, RaviNarayanaswamy, ABataev

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

3 years ago[Statepoints] Operand folding in presense of tied registers.
Denis Antrushin [Wed, 10 Jun 2020 13:01:19 +0000 (20:01 +0700)]
[Statepoints] Operand folding in presense of tied registers.

Implement proper folding of statepoint meta operands (deopt and GC)
when statepoint uses tied registers.
For deopt operands it is just about properly preserving tiedness
in new instruction.
For tied GC operands folding is a little bit more tricky.
We can fold tied GC operands only from InlineSpiller, because it knows
how to properly reload tied def after it was turned into memory operand.
Other users (e.g. peephole) cannot properly fold such operands as they
do not know how (or when) to reload them from memory.
We do this by un-tieing operand we want to fold in InlineSpiller
and allowing to fold only untied operands in foldPatchpoint.

3 years ago[clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp
Bruno Ricci [Wed, 5 Aug 2020 13:12:05 +0000 (14:12 +0100)]
[clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp

3 years ago[mlir] Initial version of C APIs
Alex Zinenko [Wed, 5 Aug 2020 12:36:16 +0000 (14:36 +0200)]
[mlir] Initial version of C APIs

    Introduce an initial version of C API for MLIR core IR components: Value, Type,
    Attribute, Operation, Region, Block, Location. These APIs allow for both
    inspection and creation of the IR in the generic form and intended for wrapping
    in high-level library- and language-specific constructs. At this point, there
    is no stability guarantee provided for the API.

Reviewed By: stellaraccident, lattner

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

3 years agoRecommit "[InstCombine] Negator: -(X << C) --> X * (-1 << C)"
Roman Lebedev [Wed, 5 Aug 2020 11:55:29 +0000 (14:55 +0300)]
Recommit "[InstCombine] Negator: -(X << C)  -->  X * (-1 << C)"

This reverts commit ac70b37a00dc02bd8923e0a4602d26be4581c570
which reverted commit 8aeb2fe13a4100b4c2e78d6ef75119304100cb1f
because codegen tests got broken and i needed time to investigate.

This shows some regressions in tests, but they are all around GEP's,
so i'm not really sure how important those are.

https://rise4fun.com/Alive/1Gn

3 years ago[gn build] (manually) merge 3ab01550b
Nico Weber [Wed, 5 Aug 2020 12:52:55 +0000 (08:52 -0400)]
[gn build] (manually) merge 3ab01550b

This reverts commit 0bbaacc8cae0373d4500c4e3f6f128d21f9033b7 and
2ad56119f5dc6c6af2b8ddfd9fc8c6460a7507c8 which merged 10b1b4a23
(and follow-ups), since that change was reverted in 3ab01550b.

3 years ago[clang][NFC] DeclPrinter: use NamedDecl::getDeclName instead of NamedDecl::printName...
Bruno Ricci [Wed, 5 Aug 2020 11:10:16 +0000 (12:10 +0100)]
[clang][NFC] DeclPrinter: use NamedDecl::getDeclName instead of NamedDecl::printName to print the name of enumerations, namespaces and template parameters.

NamedDecl::printName will print the pretty-printed name of the entity, which
is not what we want here (we should print "enum { e };" instead of "enum
(unnamed enum at input.cc:1:5) { e };").

For now only DecompositionDecl and MDGuidDecl have an overloaded printName so
this does not result in any functional change, but this change is needed since
I will be adding overloads to better handle unnamed entities in diagnostics.

3 years ago[clang][NFCI] Get rid of ConstantMatrixTypeBitfields to avoid increasing the size...
Bruno Ricci [Wed, 5 Aug 2020 10:53:24 +0000 (11:53 +0100)]
[clang][NFCI] Get rid of ConstantMatrixTypeBitfields to avoid increasing the size of every type.

sizeof(ConstantMatrixTypeBitfields) > 8 which increases the size of every type.
This was not detected because no corresponding static_assert for its size was
added.

To prevent this from occuring again replace the various static_asserts for
the size of each of the bit-field classes by a single static_assert for the
size of Type.

I have left ConstantMatrixType::MaxElementsPerDimension unchanged since
the limit is exercised by multiple tests.

3 years ago[clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString
Bruno Ricci [Wed, 5 Aug 2020 10:48:09 +0000 (11:48 +0100)]
[clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString

`OS << ND->getDeclName();` is equivalent to `OS << ND->getNameAsString();`
without the extra temporary string.

This is not quite a NFC since two uses of `getNameAsString` in a
diagnostic are replaced, which results in the named entity being
quoted with additional "'"s (ie: 'var' instead of var).

3 years ago[clang][NFC] Document NamedDecl::printName
Bruno Ricci [Wed, 5 Aug 2020 10:43:39 +0000 (11:43 +0100)]
[clang][NFC] Document NamedDecl::printName

3 years ago[clang][NFC] Remove an old workaround for MSVC 2013
Bruno Ricci [Wed, 5 Aug 2020 10:42:48 +0000 (11:42 +0100)]
[clang][NFC] Remove an old workaround for MSVC 2013

3 years ago[clang][NFC] Add a test showcasing an unnamed template parameter in a diagnostic
Bruno Ricci [Wed, 5 Aug 2020 10:41:51 +0000 (11:41 +0100)]
[clang][NFC] Add a test showcasing an unnamed template parameter in a diagnostic

3 years ago[clang][NFC] Remove spurious +x flag on DeclTemplate.cpp and DeclTemplate.h
Bruno Ricci [Wed, 5 Aug 2020 10:39:36 +0000 (11:39 +0100)]
[clang][NFC] Remove spurious +x flag on DeclTemplate.cpp and DeclTemplate.h

3 years ago[mlir] Remove LLVMTypeTestDialect
Alex Zinenko [Tue, 4 Aug 2020 16:52:42 +0000 (18:52 +0200)]
[mlir] Remove LLVMTypeTestDialect

This dialect was introduced during the bring-up of the new LLVM dialect type
system for testing purposes. The main LLVM dialect now uses the new type system
and the test dialect is no longer necessary, so remove it.

Reviewed By: rriddle

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

3 years ago[CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc
Yaxun (Sam) Liu [Tue, 4 Aug 2020 16:13:16 +0000 (12:13 -0400)]
[CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

nvcc supports accessing file-scope static device variables in host code by host APIs
like cudaMemcpyToSymbol etc.

CUDA/HIP let users access device variables in host code by shadow variables. In host compilation,
clang emits a shadow variable for each device variable, and calls __*RegisterVariable to
register it in init function. The address of the shadow variable and the device side mangled
name of the device variable is passed to __*RegisterVariable. Runtime looks up the symbol
by name in the device binary  to find the address of the device variable.

The problem with static device variables is that they have internal linkage, therefore their
name may be changed by the linker if there are multiple symbols with the same name. Also
they end up as local symbols in the elf file, whereas the runtime only looks up the global symbols.

Another reason for making the static device variables external linkage is that they may be
initialized externally by host code and their final value may be accessed by host code
after kernel execution, therefore they actually have external linkage. Giving them internal
linkage will cause incorrect optimizations on them.

To support accessing static device var in host code for -fno-gpu-rdc mode, change the intnernal
linkage to external linkage. The name does not need change since there is only one TU for
-fno-gpu-rdc mode. Also the externalization is done only if the device static var is referenced
by host code.

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

3 years ago[ARM][CostModel] Implement getCFInstrCost
Sam Parker [Wed, 5 Aug 2020 08:37:53 +0000 (09:37 +0100)]
[ARM][CostModel] Implement getCFInstrCost

As with other targets, set the throughput cost of control-flow
instructions to free so that we don't miss out of vectorization
opportunities.

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

3 years agoDWARFVerifier.h - remove unnecessary forward declarations and includes. NFCI.
Simon Pilgrim [Wed, 5 Aug 2020 11:42:09 +0000 (12:42 +0100)]
DWARFVerifier.h - remove unnecessary forward declarations and includes. NFCI.

3 years ago[mlir] Fix convert-to-llvmir.mlir test broken due to syntax change
Alex Zinenko [Wed, 5 Aug 2020 11:29:35 +0000 (13:29 +0200)]
[mlir] Fix convert-to-llvmir.mlir test broken due to syntax change

The syntax of the LLVM dialect types changed between the time the code
was written and it was submitted, leading to a test failure. Update the
syntax.

3 years ago[obj2yaml] Add support for dumping the .debug_aranges section.
Xing GUO [Wed, 5 Aug 2020 11:18:33 +0000 (19:18 +0800)]
[obj2yaml] Add support for dumping the .debug_aranges section.

This patch adds support for dumping DWARF sections to obj2yaml. The
.debug_aranges section is used to illustrate the basic idea.

Reviewed By: jhenderson

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

3 years agoSupport member expressions in bugprone-bool-pointer-implicit-conversion.
Alex Cameron [Wed, 5 Aug 2020 11:14:28 +0000 (07:14 -0400)]
Support member expressions in bugprone-bool-pointer-implicit-conversion.

This addresses PR45189.

3 years agoGISelWorkList.h - remove unnecessary includes. NFCI.
Simon Pilgrim [Wed, 5 Aug 2020 11:00:12 +0000 (12:00 +0100)]
GISelWorkList.h - remove unnecessary includes. NFCI.

3 years agoCallLowering.h - remove unnecessary CCState forward declaration. NFCI.
Simon Pilgrim [Wed, 5 Aug 2020 10:35:11 +0000 (11:35 +0100)]
CallLowering.h - remove unnecessary CCState forward declaration. NFCI.

Already defined in CallingConvLower.h

3 years ago[X86][AVX] Add test showing unnecessary duplicate HADD instructions
Simon Pilgrim [Wed, 5 Aug 2020 10:33:02 +0000 (11:33 +0100)]
[X86][AVX] Add test showing unnecessary duplicate HADD instructions

Taken from internal fuzz test

3 years agoRevert "[CMake] Simplify CMake handling for zlib"
Hans Wennborg [Wed, 5 Aug 2020 10:14:07 +0000 (12:14 +0200)]
Revert "[CMake] Simplify CMake handling for zlib"

This quietly disabled use of zlib on Windows even when building with
-DLLVM_ENABLE_ZLIB=FORCE_ON.

> Rather than handling zlib handling manually, use find_package from CMake
> to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
> HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
> set to YES, which requires the distributor to explicitly select whether
> zlib is enabled or not. This simplifies the CMake handling and usage in
> the rest of the tooling.
>
> This is a reland of abb0075 with all followup changes and fixes that
> should address issues that were reported in PR44780.
>
> Differential Revision: https://reviews.llvm.org/D79219

This reverts commit 10b1b4a231a485f1711d576e6131f6755e008abe and follow-ups
64d99cc6abed78c00a2a7863b02ce54911a5264f and
f9fec0447e12da9e8cf4b628f6d45f4941e7d182.

3 years ago[SVE] Add lowering for fixed length vector and, or & xor operations.
Paul Walker [Wed, 5 Aug 2020 10:21:34 +0000 (11:21 +0100)]
[SVE] Add lowering for fixed length vector and, or & xor operations.

Since there are no ill effects when performing these operations
with undefined elements, they are lowered to the already supported
unpredicated scalable vector equivalents.

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

3 years ago[DAG] Fold vector (aext (load x)) -> (zext (truncate (zextload x)))
Simon Pilgrim [Wed, 5 Aug 2020 10:22:07 +0000 (11:22 +0100)]
[DAG] Fold vector (aext (load x)) -> (zext (truncate (zextload x)))

We currently don't do anything to fold any_extend vector loads as no target has such an instruction.

Instead I've added support for folding to a zextload, SimplifyDemandedBits does a good job of adjusting the zext(truncate(()) stages as required later on.

We still need the custom scalar extload handling instead of using the tryToFoldExtOfLoad helper as it has different legality tests - we can probably tweak that to reduce most of the code duplication.

Fixes the regression I mentioned in rG99a971cadff7

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

3 years ago[lldb] expect TestGuiBasicDebug.py failure on aarch64
Luboš Luňák [Wed, 5 Aug 2020 10:18:38 +0000 (12:18 +0200)]
[lldb] expect TestGuiBasicDebug.py failure on aarch64

http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/7287/steps/test/logs/stdio
fails, and the output suggests that gui 'finish' (='thread step-out') is broken
on aarch64.

3 years ago[mlir] Conversion of ViewOp with memory space to LLVM.
Arpith C. Jacob [Wed, 5 Aug 2020 10:16:17 +0000 (12:16 +0200)]
[mlir] Conversion of ViewOp with memory space to LLVM.

Handle the case where the ViewOp takes in a memref that has
an memory space.

Reviewed By: ftynse, bondhugula, nicolasvasilache

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

3 years ago[mlir] Lower RankOp to LLVM for unranked memrefs.
Alexander Belyaev [Wed, 5 Aug 2020 10:12:45 +0000 (12:12 +0200)]
[mlir] Lower RankOp to LLVM for unranked memrefs.

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

3 years ago[llvm-readobj/elf] - Add a testing for --stackmap and refine the implementation.
Georgii Rymar [Tue, 4 Aug 2020 12:19:36 +0000 (15:19 +0300)]
[llvm-readobj/elf] - Add a testing for --stackmap and refine the implementation.

Currently, we only test the `--stackmap` option here:
https://github.com/llvm/llvm-project/blob/master/llvm/test/Object/stackmap-dump.test
it uses a precompiled MachO binary currently and I've found no tests for this option for ELF.

The implementation also has issues. For example, it might assert on a wrong version
of the .llvm-stackmaps section. Or it might crash on an empty or truncated section.

This patch introduces a new tools/llvm-readobj/ELF test file as well as implements a few
basic checks to catch simple crashes/issues

It also eliminates `unwrapOrError` calls in `printStackMap()`.

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

3 years ago[llvm-symbolizer] Add legacy aliases -demangle=true and -demangle=false.
Benjamin Kramer [Wed, 5 Aug 2020 10:03:30 +0000 (12:03 +0200)]
[llvm-symbolizer] Add legacy aliases -demangle=true and -demangle=false.

This is used in the wild, don't break compatibility for no good reason.
https://github.com/google/pprof/blob/master/internal/binutils/addr2liner_llvm.go

3 years ago[docs] Document pattern of using CHECK-SAME to skip irrelevant lines
Jordan Rupprecht [Tue, 4 Aug 2020 23:23:03 +0000 (00:23 +0100)]
[docs] Document pattern of using CHECK-SAME to skip irrelevant lines

This came up during the review for D67656. It's nice but also subtle, so documenting it as an idiom will make tests easier to understand.

Reviewed By: probinson

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

3 years agoRevert "[lldb] temporary commit to see why a test is failing only on lldb-aarch64...
Luboš Luňák [Wed, 5 Aug 2020 09:55:02 +0000 (11:55 +0200)]
Revert "[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu"

This reverts commit 21f142ce1df10fe6cf5721e263fc6e91aea93938.

3 years ago[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu
Luboš Luňák [Wed, 5 Aug 2020 09:54:14 +0000 (11:54 +0200)]
[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu

3 years ago[MLIR][Shape] Expose extent tensor type builder
Frederik Gossen [Wed, 5 Aug 2020 09:41:42 +0000 (09:41 +0000)]
[MLIR][Shape] Expose extent tensor type builder

The extent tensor type is a `tensor<?xindex>` that is used in the shape dialect.
To facilitate the use of this type when working with the shape dialect, we
expose the helper function for its construction.

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

3 years ago[compiler-rt] Normalize some in/out doxygen parameter in interface
Pierre Gousseau [Wed, 5 Aug 2020 09:17:25 +0000 (10:17 +0100)]
[compiler-rt] Normalize some in/out doxygen parameter in interface
headers. NFC.

Reviewed By: vitalybuka

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

3 years ago[lldb] Suppress MSVC warning C4065
Tatyana Krasnukha [Tue, 4 Aug 2020 17:53:30 +0000 (20:53 +0300)]
[lldb] Suppress MSVC warning C4065

MSVC reports "switch statement contains 'default' but no 'case' labels". Suppress,
as this was intended behavior.

3 years ago[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize
Tatyana Krasnukha [Tue, 4 Aug 2020 17:52:48 +0000 (20:52 +0300)]
[lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize

PyUnicode_GetSize is deprecated since Python version 3.3.

3 years ago[lldb/TestingSupport] Manually disable GTEST_HAS_TR1_TUPLE
Tatyana Krasnukha [Tue, 4 Aug 2020 14:15:29 +0000 (17:15 +0300)]
[lldb/TestingSupport] Manually disable GTEST_HAS_TR1_TUPLE

Gtest 1.8.0 uses tr1::tuple which is deprecated on MSVC. We have to force it off
to avoid the compiler warnings, which will become errors after switching on C++17
(https://devblogs.microsoft.com/cppblog/c17-feature-removals-and-deprecations).

3 years agoDo not map read-only data memory sections with EXECUTE flags.
David Turner [Wed, 5 Aug 2020 08:50:06 +0000 (10:50 +0200)]
Do not map read-only data memory sections with EXECUTE flags.

The code in SectionMemoryManager.cpp unnecessarily maps
read-only data sections with the READ+EXECUTE flags. This is
undesirable from a security stand-point.

Moreover, on the Fuchsia platform, which is now very strict
about mapping pages with the EXECUTE permission, this simply
fails, because the section's pages were initially allocated
with only the READ+WRITE flags.

A more detailed description of the issue can be found in this
public SwiftShader bug:

  https://issuetracker.google.com/issues/154586551

This patch just restrict the mapping to the READ flag for ROData
sections. Code sections are still mapped with READ+EXECUTE as
expected.

Reviewed By: lhames

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

3 years ago[AArch64][SVE] Disable tail calls if callee does not preserve SVE regs.
Sander de Smalen [Wed, 5 Aug 2020 08:17:57 +0000 (09:17 +0100)]
[AArch64][SVE] Disable tail calls if callee does not preserve SVE regs.

This fixes an issue triggered by the following code, where emitEpilogue
got confused when trying to restore the SVE registers after the call,
whereas the call to bar() is implemented as a TCReturn:

  int non_sve();
  int sve(svint32_t x) { return non_sve(); }

Reviewed By: efriedma

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

3 years ago[MLIR][SPIRVToLLVM] Updated LLVM types in the documentation
George Mitenkov [Wed, 5 Aug 2020 08:18:38 +0000 (11:18 +0300)]
[MLIR][SPIRVToLLVM] Updated LLVM types in the documentation

Updated the documentation with new MLIR LLVM types for
vectors, pointers, arrays and structs. Also, changed remaining
tabs to spaces.

Reviewed By: ftynse

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

3 years ago[AMDGPU] Propagate fast math flags in frem lowering
Jay Foad [Fri, 24 Jul 2020 11:55:12 +0000 (12:55 +0100)]
[AMDGPU] Propagate fast math flags in frem lowering

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

3 years ago[AMDGPU] Precommit tests for D84518 Propagate fast math flags in frem lowering
Jay Foad [Fri, 24 Jul 2020 11:52:36 +0000 (12:52 +0100)]
[AMDGPU] Precommit tests for D84518 Propagate fast math flags in frem lowering

3 years ago[AMDGPU] Lower frem f16
Jay Foad [Fri, 24 Jul 2020 11:05:46 +0000 (12:05 +0100)]
[AMDGPU] Lower frem f16

Without this it would fail to select on subtargets that have 16-bit
instructions.

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

3 years ago[Flang] Fix multi-config generator builds
Andrzej Warzynski [Sat, 1 Aug 2020 19:53:27 +0000 (20:53 +0100)]
[Flang] Fix multi-config generator builds

Based on https://reviews.llvm.org/D84022 with additional changes to
maintain out-of-tree builds.

Original commit message:
Currently the binaries are output directly into the bin subdirectory of
the build directory. This doesn't work correctly with multi-config
generators which should output the binaries into <CONFIG_NAME>/bin
instead.

The original patch was implemented by David Truby and the additional
changes added here were also proposed by David Truby.

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

Co-authored-by: David Truby <david.truby@arm.com>
3 years ago[lldb][gui] add a test for 'b' (toggle breakpoint)
Luboš Luňák [Mon, 3 Aug 2020 06:32:16 +0000 (08:32 +0200)]
[lldb][gui] add a test for 'b' (toggle breakpoint)

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

3 years ago[lldb][gui] move TestGuiBasicDebug.py to lldb/test and update it
Luboš Luňák [Mon, 3 Aug 2020 05:09:03 +0000 (07:09 +0200)]
[lldb][gui] move TestGuiBasicDebug.py to lldb/test and update it

Between the time it was created and it was pushed upstream,
99451b4453688a94c6014cac233d371ab4cc342d has moved the existing
gui gui tests to lldb/test, so move this one too.
And update it to contain TestGuiBasic.py changes since the time
when it was based on that test.

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

3 years ago[lldb][gui] implement breakpoint removal on breakpoint toggling
Luboš Luňák [Sun, 2 Aug 2020 20:03:21 +0000 (22:03 +0200)]
[lldb][gui] implement breakpoint removal on breakpoint toggling

It says it toggles breakpoints, so if one already exists
on the selected location, remove it instead of adding.

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

3 years ago[lldb][gui] implement shift+tab for going back in views
Luboš Luňák [Sun, 2 Aug 2020 11:18:41 +0000 (13:18 +0200)]
[lldb][gui] implement shift+tab for going back in views

Also simplify the code for going forward.

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

3 years ago[lldb][gui] implement TerminalSizeChanged()
Luboš Luňák [Sun, 2 Aug 2020 10:58:22 +0000 (12:58 +0200)]
[lldb][gui] implement TerminalSizeChanged()

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

3 years ago[lldb] fix building with panel.h being in /usr/include/ncurses/
Luboš Luňák [Tue, 4 Aug 2020 16:37:34 +0000 (18:37 +0200)]
[lldb] fix building with panel.h being in /usr/include/ncurses/

My openSUSE 15.2 has /usr/include/curses.h as a symlink to
/usr/include/ncurses/curses.h , but there's no such symlink
for panel.h . Prefer using /usr/include/ncurses for the includes
if they are found there by the CMake check.

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