platform/upstream/llvm.git
2 years ago[HIP] Add HIP scope atomic operations
Yaxun (Sam) Liu [Mon, 22 Nov 2021 19:37:02 +0000 (14:37 -0500)]
[HIP] Add HIP scope atomic operations

Add an AtomicScopeModel for HIP and support for OpenCL builtins
that are missing in HIP.

Patch by: Michael Liao

Revised by: Anshil Ghandi

Reviewed by: Yaxun Liu

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

2 years ago[PowerPC] Remove FreeBSD test in mm-malloc.c due to cross-compilation limitation
Jinsong Ji [Tue, 23 Nov 2021 15:08:49 +0000 (15:08 +0000)]
[PowerPC] Remove FreeBSD test in mm-malloc.c due to cross-compilation limitation

Fix failures on powerpc BE buildbots
https://lab.llvm.org/buildbot/#/builders/93/builds/6031
https://lab.llvm.org/buildbot/#/builders/100/builds/10836
https://lab.llvm.org/buildbot/#/builders/52/builds/12719

2 years ago[InstCombine] enhance bitwise select matching
Sanjay Patel [Tue, 23 Nov 2021 14:50:24 +0000 (09:50 -0500)]
[InstCombine] enhance bitwise select matching

I noticed that adding a seemingly unrelated fold for xor caused
regressions on similar patterns, and this is one of the
underlying causes.

This could also be a variation for code as seen in:
https://llvm.org/PR34047
...although that exact example should be fixed after:
D113035 / c36b7e21bd8f

The vector test shows that we are actually missing a potential
canonicalization for bitcast-of-sext-of-not or the inverse.
The scalar test shows that even if we had that canonicalization,
it would still be possible to see this pattern due to extra uses.

https://alive2.llvm.org/ce/z/y2BAgi

2 years ago[InstCombine] add tests for logical select; NFC
Sanjay Patel [Tue, 23 Nov 2021 13:55:49 +0000 (08:55 -0500)]
[InstCombine] add tests for logical select; NFC

2 years ago[libc++] Tidy up how %T and %t are created during configuration checks
Louis Dionne [Mon, 22 Nov 2021 20:40:12 +0000 (15:40 -0500)]
[libc++] Tidy up how %T and %t are created during configuration checks

Instead of having ad-hoc cleanup in various places, handle all creation
and removal of temporary files and directories inside _makeConfigTest.

As a fly-by, also remove testPrefix since we don't keep any source file
around anymore. Setting a prefix for the files is hence not useful anymore.

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

2 years ago[ARM] Expand rev.ll test with more triples. NFC
David Green [Tue, 23 Nov 2021 14:24:58 +0000 (14:24 +0000)]
[ARM] Expand rev.ll test with more triples. NFC

Useful in showing Thumb2 and Thumb1 rev instructions as well as the arm
already tested, as well as testing the more canonical llvm.bswap.i16
form.

2 years agoRevert "The _Float16 type is supported on x86 systems with SSE2 enabled."
Zahira Ammarguellat [Tue, 23 Nov 2021 13:00:57 +0000 (08:00 -0500)]
Revert "The _Float16 type is supported on x86 systems with SSE2 enabled."

This reverts commit 6623c02d70c3732dbea59c6d79c69501baf9627b.
The change seems to be breaking build of compiler-rt on Debian.

2 years ago[mlir][Vector] Thread 0-d vectors through InsertElementOp.
Nicolas Vasilache [Tue, 23 Nov 2021 12:01:53 +0000 (12:01 +0000)]
[mlir][Vector] Thread 0-d vectors through InsertElementOp.

This revision makes concrete use of 0-d vectors to extend the semantics of
InsertElementOp.

Reviewed By: dcaballe, pifon2a

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

2 years ago[mlir][Vector] Thread 0-d vectors through ExtractElementOp.
Nicolas Vasilache [Tue, 23 Nov 2021 12:01:12 +0000 (12:01 +0000)]
[mlir][Vector] Thread 0-d vectors through ExtractElementOp.

This revision starts making concrete use of 0-d vectors to extend the semantics of
ExtractElementOp.
In the process a new VectorOfAnyRank Tablegen OpBase.td is added to allow progressive transition to supporting 0-d vectors by gradually opting in.

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

2 years ago[mlir][linalg][bufferize][NFC] Specify bufferize traversal in `bufferize`
Matthias Springer [Tue, 23 Nov 2021 12:27:03 +0000 (21:27 +0900)]
[mlir][linalg][bufferize][NFC] Specify bufferize traversal in `bufferize`

The interface method `bufferize` controls how (and it what order) nested ops are traversed. This simplifies bufferization of scf::ForOps and scf::IfOps, which used to need special rules in scf::YieldOp.

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

2 years ago[fir] Set !fir.len_param_index conversion to unimplemented
Diana Picus [Thu, 18 Nov 2021 12:40:48 +0000 (12:40 +0000)]
[fir] Set !fir.len_param_index conversion to unimplemented

This patch is part of the upstreaming effort from fir-dev.

The conversion of len_param_index in fir-dev is incomplete, so for now
we're marking this as unimplemented until we can settle on a design for
the runtime support of LEN parameters.

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years ago[lldb] Fix lookup for global constants in namespaces
Tonko Sabolčec [Tue, 23 Nov 2021 11:43:46 +0000 (12:43 +0100)]
[lldb] Fix lookup for global constants in namespaces

LLDB uses mangled name to construct a fully qualified name for global
variables. Sometimes DW_TAG_linkage_name attribute is missing from
debug info, so LLDB has to rely on parent entries to construct the
fully qualified name.

Currently, the fallback is handled when the parent DW_TAG is either
DW_TAG_compiled_unit or DW_TAG_partial_unit, which may not work well
for global constants in namespaces. For example:

  namespace ns {
    const int x = 10;
  }

may produce the following debug info:

  <1><2a>: Abbrev Number: 2 (DW_TAG_namespace)
     <2b>   DW_AT_name        : (indirect string, offset: 0x5e): ns
  <2><2f>: Abbrev Number: 3 (DW_TAG_variable)
     <30>   DW_AT_name        : (indirect string, offset: 0x61): x
     <34>   DW_AT_type        : <0x3c>
     <38>   DW_AT_decl_file   : 1
     <39>   DW_AT_decl_line   : 2
     <3a>   DW_AT_const_value : 10

Since the fallback didn't handle the case when parent tag is
DW_TAG_namespace, LLDB wasn't able to match the variable by its fully
qualified name "ns::x". This change fixes this by additional check
if the parent is a DW_TAG_namespace.

Reviewed By: werat, clayborg

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

2 years ago[AMDGPU] Fix the name of a test case
Jay Foad [Tue, 23 Nov 2021 11:33:10 +0000 (11:33 +0000)]
[AMDGPU] Fix the name of a test case

2 years agotsan: new runtime (v3)
Dmitry Vyukov [Tue, 27 Apr 2021 11:55:41 +0000 (13:55 +0200)]
tsan: new runtime (v3)

This change switches tsan to the new runtime which features:
 - 2x smaller shadow memory (2x of app memory)
 - faster fully vectorized race detection
 - small fixed-size vector clocks (512b)
 - fast vectorized vector clock operations
 - unlimited number of alive threads/goroutimes

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

2 years ago[clang-format] [NFC] build clang-format with -Wall
mydeveloperday [Tue, 23 Nov 2021 10:43:27 +0000 (10:43 +0000)]
[clang-format] [NFC] build clang-format with -Wall

When building clang-format with -Wall on Visual Studio 20119 we see the following, prevent this the only -Wall error
```
..FormatTokenLexer.cpp(45) : warning C4868: compiler may not enforce left-to-right evaluation order in braced initializer list
```
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D113844

2 years ago[clang-format] [PR52527] can join * with /* to form an outside of comment error C4138
mydeveloperday [Tue, 23 Nov 2021 10:35:05 +0000 (10:35 +0000)]
[clang-format] [PR52527] can join * with /* to form an outside of comment error C4138

https://bugs.llvm.org/show_bug.cgi?id=52527

The follow patch ensures there is always a space between * and /* to prevent transforming
```
void foo(* /* comment */)(int bar);
```
into
```
void foo(*/* comment */)(int bar);
```

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

2 years ago[DSE][NFC] Introduce "doesn't overwrite" return code for isOverwrite
Evgeniy Brevnov [Mon, 22 Nov 2021 12:52:57 +0000 (19:52 +0700)]
[DSE][NFC] Introduce "doesn't overwrite" return code for isOverwrite

Add OR_None code to indicate that there is no overwrite. This has no any effect for current uses but will be used in one of the next patches building support for PHI translation.

Reviewed By: fhahn

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

2 years ago[ThreadPool] Do not return shared futures.
Florian Hahn [Tue, 23 Nov 2021 10:06:08 +0000 (10:06 +0000)]
[ThreadPool] Do not return shared futures.

The only users of returned futures from ThreadPool is llvm-reduce after
D113857.

There should be no cases where multiple threads wait on the same future,
so there should be no need to return std::shared_future<>. Instead return
plain std::future<>.

If users need to share a future between multiple threads, they can share
the futures themselves.

Reviewed By: Meinersbur, mehdi_amini

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

2 years agoRevert "Revert "[mlir] Move AllocationOpInterface to Bufferize/IR/AllocationOpInterfa...
Alexander Belyaev [Tue, 23 Nov 2021 09:04:47 +0000 (10:04 +0100)]
Revert "Revert "[mlir] Move AllocationOpInterface to Bufferize/IR/AllocationOpInterface.td.""

This reverts and fixes commit de18b7dee6a81e5e790c8e8060065b1ef72d13ed.

2 years ago[SDAG] Use UnknownSize for masked load/store MMO size
David Green [Tue, 23 Nov 2021 09:47:56 +0000 (09:47 +0000)]
[SDAG] Use UnknownSize for masked load/store MMO size

A masked load or store will load a potentially unknown number of bytes
from a memory location - that is not generally known at compile time.
They do not necessarily load/store the entire vector width, and treating
them as such can lead to incorrect aliasing information (for example, if
the underlying object is smaller than the size of the vector).

This makes sure that the MMO is given an unknown size to represent this.
which is less accurate that "may load/store from up to 16 bytes", but
less incorrect that "will load/store from 16 bytes".

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

2 years ago[PowerPC] Implement more fusion types for Power10
Qiu Chaofan [Tue, 23 Nov 2021 09:21:17 +0000 (17:21 +0800)]
[PowerPC] Implement more fusion types for Power10

This implements the rest of Power10 instruction fusion pairs, according
to user manual, including 'wide immediate', 'load compare', 'zero move'
and 'SHA3 assist'.

Only 'SHA3 assist' is enabled by default.

Reviewed By: shchenz

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

2 years ago[X86] Regenerate X86/vmaskmov-offset.ll check lines as per new mir format. NFC
David Green [Tue, 23 Nov 2021 08:41:47 +0000 (08:41 +0000)]
[X86] Regenerate X86/vmaskmov-offset.ll check lines as per new mir format. NFC

2 years ago[ARM] Add an test for showing the incorrect aliasing info around masked loads/stores...
David Green [Tue, 23 Nov 2021 08:27:06 +0000 (08:27 +0000)]
[ARM] Add an test for showing the incorrect aliasing info around masked loads/stores. NFC

2 years ago[LLD] [COFF] Omit section symbols and IMAGE_SYM_CLASS_LABEL from the PE symbol table
Martin Storsjö [Sat, 13 Nov 2021 08:13:42 +0000 (10:13 +0200)]
[LLD] [COFF] Omit section symbols and IMAGE_SYM_CLASS_LABEL from the PE symbol table

The section symbols aren't of much practical use when looking at
a linked image. This shrinks one observed mingw style unstripped
binary by 14%.

IMAGE_SYM_CLASS_LABEL is in spirit the same as a temporary assembler
label that isn't emitted on the object file level at all.

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

2 years ago[AArch64] [COFF] Move jump tables back to the readonly section
Martin Storsjö [Wed, 10 Nov 2021 17:10:43 +0000 (19:10 +0200)]
[AArch64] [COFF] Move jump tables back to the readonly section

This essentially reverts f5884d255e78305d41c28c6e001a460ff83981d8
(D57277).

That commit was made as a workaround since LLVM back then didn't
support cross-section relative relocations (IMAGE_REL_ARM64_REL32)
in COFF for ARM64. Support for this was implemented later,
in d5c5cf5ce8d921fc8c5e1b608c298a1ffa688d37 (D99572) and
382c505d9cfca8adaec47aea2da7bbcbc00fc05c (D102217).

The commit that moved jump tables to the function section noted
that it woud be ideal to utilize IMAGE_REL_ARM64_REL32.

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

2 years ago[LLD] [COFF] Interpret the immediate in ARM64 adr/adrp relocations as signed 21 bit
Martin Storsjö [Sat, 20 Nov 2021 17:55:18 +0000 (19:55 +0200)]
[LLD] [COFF] Interpret the immediate in ARM64 adr/adrp relocations as signed 21 bit

This matches how MS link.exe interprets this relocation.

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

2 years ago[COFF] [ARM64] Create symbols with regular intervals for relocations against temporar...
Martin Storsjö [Fri, 19 Nov 2021 23:05:07 +0000 (01:05 +0200)]
[COFF] [ARM64] Create symbols with regular intervals for relocations against temporary symbols

For relocations against temporary symbols (that don't persist in
the object file), we normally adjust them to reference the start of
the section.

For adrp relocations, the immediate offset from the referenced
symbol is stored in the opcode as the 21 bit signed immediate; this
means that the symbol referenced must be within +/- 1 MB from the
referenced symbol.

Create label symbols with regular intervals (1 MB intervals). For
relocations against temporary symbols, pick the preceding added
offset symbol and make the relocation against that instead of
against the start of the section.

This should fix the root issue behind
https://bugs.llvm.org/show_bug.cgi?id=52378.

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

2 years ago[mlir][Vector] Add a vblendps-based impl for transpose8x8 (both intrin and inline_asm)
Nicolas Vasilache [Mon, 22 Nov 2021 10:22:37 +0000 (10:22 +0000)]
[mlir][Vector] Add a vblendps-based impl for transpose8x8 (both intrin and inline_asm)

This revision follows up on the conversation titled:

```[llvm-dev] Understanding and controlling some of the AVX shuffle emission paths```

The revision adds a vblendps-based implementation for transpose8x8 and further distinguishes between and intrinsics and an inline_asm implementation.

This results in roughly 20% fewer cycles as reported by llvm-mca:

After this revision (intrinsic version, resolves to virtually identical assembly as per the llvm-dev discussion, no vblendps instruction is emitted):
```
Iterations:        100
Instructions:      5900
Total Cycles:      2415
Total uOps:        7300

Dispatch Width:    6
uOps Per Cycle:    3.02
IPC:               2.44
Block RThroughput: 24.0

Cycles with backend pressure increase [ 89.90% ]
Throughput Bottlenecks:
  Resource Pressure       [ 89.65% ]
  - SKXPort1  [ 0.04% ]
  - SKXPort2  [ 12.42% ]
  - SKXPort3  [ 12.42% ]
  - SKXPort5  [ 89.52% ]
  Data Dependencies:      [ 37.06% ]
  - Register Dependencies [ 37.06% ]
  - Memory Dependencies   [ 0.00% ]
```

After this revision (inline_asm version, vblendps instructions are indeed emitted):
```
Iterations:        100
Instructions:      6300
Total Cycles:      2015
Total uOps:        7700

Dispatch Width:    6
uOps Per Cycle:    3.82
IPC:               3.13
Block RThroughput: 20.0

Cycles with backend pressure increase [ 83.47% ]
Throughput Bottlenecks:
  Resource Pressure       [ 83.18% ]
  - SKXPort0  [ 14.49% ]
  - SKXPort1  [ 14.54% ]
  - SKXPort2  [ 19.70% ]
  - SKXPort3  [ 19.70% ]
  - SKXPort5  [ 83.03% ]
  - SKXPort6  [ 14.49% ]
  Data Dependencies:      [ 39.75% ]
  - Register Dependencies [ 39.75% ]
  - Memory Dependencies   [ 0.00% ]
```

An accessible copy of the conversation is available [here](https://gist.github.com/nicolasvasilache/68c7f34012584b0e00f335bcb374ede0).

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

2 years ago[mlir] Refactoring a few Parser APIs
Sandeep Dasgupta [Tue, 23 Nov 2021 06:05:41 +0000 (06:05 +0000)]
[mlir] Refactoring a few Parser APIs

Refactored two new parser APIs parseGenericOperationAfterOperands and
 parseCustomOperationName out of parseGenericOperation and parseCustomOperation.

Motivation: Sometimes an op can be printed in a special way if certain criteria
is met. While parsing, we need to handle all the versions.
`parseGenericOperationAfterOperands` is handy in situation where we already
parsed the operands and decide to fall back to default parsing.

`parseCustomOperationName` is useful when we need to know details (dialect,
operation name etc.) about a parsed token meant to be an mlir operation.

Reviewed By: rriddle

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

2 years ago[llvm] Use range-based for loops (NFC)
Kazu Hirata [Tue, 23 Nov 2021 04:33:27 +0000 (20:33 -0800)]
[llvm] Use range-based for loops (NFC)

2 years ago[mlir][linalg][bufferize] Limited support for scf.execute_region
Matthias Springer [Tue, 23 Nov 2021 03:19:53 +0000 (12:19 +0900)]
[mlir][linalg][bufferize] Limited support for scf.execute_region

Add support for analysis only.

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

2 years ago[mlir][linalg][bufferize][NFC] Move helper function to op interface
Matthias Springer [Tue, 23 Nov 2021 02:20:27 +0000 (11:20 +0900)]
[mlir][linalg][bufferize][NFC] Move helper function to op interface

This is in preparation of changing the op traversal during bufferization.

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

2 years ago[mlir][linalg][bufferize][NFC] Remove special casing of CallOps
Matthias Springer [Tue, 23 Nov 2021 02:12:38 +0000 (11:12 +0900)]
[mlir][linalg][bufferize][NFC] Remove special casing of CallOps

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

2 years ago[mlir][linalg][bufferize][NFC] Clean up headers and function visibility
Matthias Springer [Tue, 23 Nov 2021 01:27:57 +0000 (10:27 +0900)]
[mlir][linalg][bufferize][NFC] Clean up headers and function visibility

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

2 years agoAttempt to fix e3dea5cf0e326366ab95a49d167fde8b0816e292
Walter Erquinigo [Tue, 23 Nov 2021 00:33:11 +0000 (16:33 -0800)]
Attempt to fix e3dea5cf0e326366ab95a49d167fde8b0816e292

https://lab.llvm.org/buildbot/#/builders/17/builds/13728 found an issue
in the optional formatter.

2 years ago[flang] Correct the argument keyword for AIMAG(Z=...)
Peter Klausler [Fri, 19 Nov 2021 23:17:55 +0000 (15:17 -0800)]
[flang] Correct the argument keyword for AIMAG(Z=...)

It was X= in the intrinsics table.

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

2 years ago[formatters] Add a formatter for libstdc++ optional
Walter Erquinigo [Mon, 22 Nov 2021 21:46:49 +0000 (13:46 -0800)]
[formatters] Add a formatter for libstdc++ optional

Besides adding the formatter and the summary, this makes the libcxx
tests also work for this case.

This is the polished version of https://reviews.llvm.org/D114266,
authored by Danil Stefaniuc.

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

2 years ago[InstCombine] Enable fold select into operand for FAdd, FMul, FSub and FDiv.
Huihui Zhang [Mon, 22 Nov 2021 22:58:15 +0000 (14:58 -0800)]
[InstCombine] Enable fold select into operand for FAdd,  FMul, FSub and FDiv.

For FAdd, FMul, FSub and FDiv, fold select into one of the operands to enable
further optimizations, i.e., floating-point reduction detection.

Turn code:
  %C = fadd %A, %B
  %D = select %cond, %C, %A

into:
  %C = select %cond, %B, -0.000000e+00
  %D = fadd %A, %C

Alive2 verification (with --disable-undef-input), timed out otherwise.
FAdd - https://alive2.llvm.org/ce/z/eUxN4Y
FMul - https://alive2.llvm.org/ce/z/5SWZz4
FSub - https://alive2.llvm.org/ce/z/Dhj8dU
FDiv - https://alive2.llvm.org/ce/z/Yj_NA2

Reviewed By: spatel

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

2 years ago[flang] Remove typo that affected complex namelist input
Peter Klausler [Fri, 19 Nov 2021 23:49:16 +0000 (15:49 -0800)]
[flang] Remove typo that affected complex namelist input

A recent patch to real/complex formatted input included what must
have been an editing hiccup: "++ ++p" instead of "++p".  This
compiles, and it broke the consumption of the trailing ')' of a
complex value in namelist input by skipping over the character.

Extend existing test to cover this case.

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

2 years ago[MachO] Fix struct size assertion
Shoaib Meenai [Mon, 22 Nov 2021 22:34:42 +0000 (14:34 -0800)]
[MachO] Fix struct size assertion

std::vector can have different sizes depending on the STL's debug level,
so account for its size separately. (You could argue that we should be
accounting for all the other members separately as well, but that would
be very unergonomic, and std::vector is the only one that's caused
problems so far.)

2 years ago[openmp][amdgpu] Make plugin robust to presence of explicit implicit arguments
Jon Chesterfield [Mon, 22 Nov 2021 23:00:19 +0000 (23:00 +0000)]
[openmp][amdgpu] Make plugin robust to presence of explicit implicit arguments

OpenMP (compiler) does not currently request any implicit kernel
arguments. OpenMP (runtime) allocates and initialises a reasonable guess at
the implicit kernel arguments anyway.

This change makes the plugin check the number of explicit arguments, instead
of all arguments, and puts the pointer to hostcall buffer in both the current
location and at the offset expected when implicit arguments are added to the
metadata by D113538.

This is intended to keep things running while fixing the oversight in the
compiler (in D113538). Once that patch lands, and a following one marks
openmp kernels that use printf such that the backend emits an args element
with the right type (instead of hidden_node), the over-allocation can be
removed and the hardcoded 8*e+3 offset replaced with one read from the
.offset of the corresponding metadata element.

Reviewed By: estewart08

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

2 years ago[ELF] Simplify a condition with config->copyRelocs. NFC
Fangrui Song [Mon, 22 Nov 2021 21:59:23 +0000 (13:59 -0800)]
[ELF] Simplify a condition with config->copyRelocs. NFC

2 years ago[mlir][memref] Fix expanded shape ops memref.cast folding with changed type
Benjamin Kramer [Mon, 22 Nov 2021 21:11:45 +0000 (22:11 +0100)]
[mlir][memref] Fix expanded shape ops memref.cast folding with changed type

`memref.expand_shape` has verification logic to make sure
result dim must be static if all the collapsing src dims are static.

This can be relaxed once expand_shape supports more dynamism.

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

2 years ago[Driver] Default to libc++ on FreeBSD
Jan Beich [Mon, 22 Nov 2021 16:32:58 +0000 (11:32 -0500)]
[Driver] Default to libc++ on FreeBSD

All supported FreeBSD releases use libc++, so default to it if the
target's major version is not specified.

Reviewed by: dim, emaste
Differential Revision: https://reviews.llvm.org/D77776

2 years ago[mlir] FlatAffineConstraint parsing for unit tests
Christian Ulmann [Mon, 22 Nov 2021 21:30:02 +0000 (03:00 +0530)]
[mlir] FlatAffineConstraint parsing for unit tests

This patch adds functionality to parse FlatAffineConstraints from a
StringRef with the intention to be used for unit tests. This should
make the construction of FlatAffineConstraints easier for testing
purposes.

The patch contains an example usage of the functionality in a unit test that
uses FlatAffineConstraints.

Reviewed By: bondhugula, grosser

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

2 years ago[memprof] Remove the "Live on exit:" print for text format.
Snehasish Kumar [Fri, 19 Nov 2021 21:13:02 +0000 (13:13 -0800)]
[memprof] Remove the "Live on exit:" print for text format.

We dropped the printing of live on exit blocks in rG1243cef245f6 -
the commit changed the insertOrMerge logic. Remove the message since it
is no longer needed (all live blocks are inserted into the hashmap)
before serializing/printing the profile. Furthermore, the original
intent was to capture evicted blocks so it wasn't entirely correct.

Also update the binary format test invocation to remove the redundant
print_text directive now that it is the default.

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

2 years ago[MLIR] Fix incorrect removal of source loop in loop fusion
Groverkss [Mon, 22 Nov 2021 21:18:03 +0000 (02:48 +0530)]
[MLIR] Fix incorrect removal of source loop in loop fusion

This patch fixes a bug in loop fusion pass where the source loop was removed
even when the fused loop did not cover all iterations of the source loop.

This was because the fast hueristic check for checking if source loop and
fused loop have same iterations did not take into account steps in loop.

Reviewed By: dcaballe, bondhugula

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

2 years ago[llvm-diff] Implement diff of PHI nodes
Bill Wendling [Mon, 22 Nov 2021 21:21:24 +0000 (13:21 -0800)]
[llvm-diff] Implement diff of PHI nodes

Implement diff of PHI nodes

Reviewed By: dblaikie

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

2 years ago[ThreadPool] Support returning futures with results.
Florian Hahn [Mon, 22 Nov 2021 21:20:55 +0000 (21:20 +0000)]
[ThreadPool] Support returning futures with results.

This patch adjusts ThreadPool::async to return futures that wrap
the result type of the passed in callable.

To do so, ThreadPool::asyncImpl first creates a shared promise. The
result of the promise is set in a new callable that first executes the
task. The callable is added to the task queue.

Reviewed By: mehdi_amini

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

2 years ago[HWASan] Move LTO test to separate file.
Matt Morehouse [Mon, 22 Nov 2021 21:12:47 +0000 (13:12 -0800)]
[HWASan] Move LTO test to separate file.

The test fails on Android for an unknown reason but is still worth
having for x86.

2 years agoRevert "[lldb] Load the fblldb module automatically"
Walter Erquinigo [Mon, 22 Nov 2021 21:13:43 +0000 (13:13 -0800)]
Revert "[lldb] Load the fblldb module automatically"

This reverts commit 2e6a0a8b81d7be948491ce39d241695dc1385429.

It was pushed by mistake..

2 years ago[formatters] Add a libstdcpp formatter for for unordered_map, unordered_set, unorder...
Danil Stefaniuc [Mon, 22 Nov 2021 20:54:28 +0000 (12:54 -0800)]
[formatters] Add a libstdcpp formatter for  for unordered_map, unordered_set, unordered_multimap, unordered_multiset

This diff adds a data formatter and tests for libstdcpp's unordered_map, unordered_set, unordered_multimap, unordered_multiset

Reviewed By: wallace

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

2 years ago[lldb] Load the fblldb module automatically
Walter Erquinigo [Thu, 24 Jun 2021 20:35:11 +0000 (13:35 -0700)]
[lldb] Load the fblldb module automatically

Summary:
```
// Facebook only:
// We want to load automatically the fblldb python module as soon as lldb or
// lldb-vscode start. This will ensure that logging and formatters are enabled
// by default.
//
// As we want to have a mechanism for not triggering this by default, if the
// user is starting lldb disabling .lldbinit support, then we also don't load
// this module. This is equivalent to appending this line to all .lldbinit
// files.
//
// We don't have the fblldb module on windows, so we don't include it for that
// build.
```

Test Plan:
the fbsymbols module is loaded automatically

```
./bin/lldb
(lldb) help fbsymbols
Facebook {mini,core}dump utility.  Expects 'raw' input (see 'help raw-input'.)
```

Reviewers: wanyi

Reviewed By: wanyi

Subscribers: mnovakovic, serhiyr, phabricatorlinter

Differential Revision: https://phabricator.intern.facebook.com/D29372804

Tags: accept2ship

Signature: 29372804:1624567770:07836e50e576bd809124ed80a6bc01082190e48f

[lldb] Load fblldbinit instead of fblldb

Summary: Once accepted, it'll merge it with the existing commit in our branch so that we keep the commit list as short as possible.

Test Plan: https://www.internalfb.com/diff/D30293094

Reviewers: aadsm, wanyi

Reviewed By: aadsm

Subscribers: mnovakovic, serhiyr

Differential Revision: https://phabricator.intern.facebook.com/D30293211

Tags: accept2ship

Signature: 30293211:1628880953:423e2e543cade107df69da0ebf458e581e54ae3a

2 years ago[gn build] Port 8e2fd879e6f9
LLVM GN Syncbot [Mon, 22 Nov 2021 20:49:36 +0000 (20:49 +0000)]
[gn build] Port 8e2fd879e6f9

2 years ago[compiler-rt] Explicitly set dependency on libcxx for MemProfUnitTest
Haowei Wu [Fri, 19 Nov 2021 18:43:31 +0000 (10:43 -0800)]
[compiler-rt] Explicitly set dependency on libcxx for MemProfUnitTest

MemProfUnitTest now depends on libcxx but the dependency is not
explicitly expressed in build system, causing build races. This patch
addresses this issue.

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

2 years ago[flang] Move IsCoarray() to fix shared library build
Peter Klausler [Mon, 22 Nov 2021 20:42:51 +0000 (12:42 -0800)]
[flang] Move IsCoarray() to fix shared library build

The predicate IsCoarray() needs to be in libFortranEvaluate so that
IsSaved() can call it without breaking the shared library build.

Pushed without pre-commit review as I'm moving code around and
the fix to the shared build is confirmed.

2 years ago[PowerPC] [Clang] Enable Intel intrinsics support on FreeBSD
Alfredo Dal'\''Ava Junior [Mon, 22 Nov 2021 18:55:35 +0000 (18:55 +0000)]
[PowerPC] [Clang] Enable Intel intrinsics support on FreeBSD

This enables Intel intrinsics support on FreeBSD.

Thanks to @pkubaj who noticed this feature was missing

Reviewed By: jsji

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

2 years ago[NFC][llvm] Inclusive language: replace master with main in 2007-04-02-RegScavengerAs...
Quinn Pham [Fri, 19 Nov 2021 21:04:22 +0000 (15:04 -0600)]
[NFC][llvm] Inclusive language: replace master with main in 2007-04-02-RegScavengerAssert.ll

[NFC] As part of using inclusive language within the llvm project, this patch
replaces master with main in `2007-04-02-RegScavengerAssert.ll`.

Reviewed By: dblaikie

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

2 years ago[AMDGPU] Allow VOP3 source modifiers in fpow expansion
Jay Foad [Mon, 22 Nov 2021 10:53:18 +0000 (10:53 +0000)]
[AMDGPU] Allow VOP3 source modifiers in fpow expansion

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

2 years agoRevert "[mlir] Move AllocationOpInterface to Bufferize/IR/AllocationOpInterface.td."
Alexander Belyaev [Mon, 22 Nov 2021 20:35:20 +0000 (21:35 +0100)]
Revert "[mlir] Move AllocationOpInterface to Bufferize/IR/AllocationOpInterface.td."

This reverts commit 3028bca6a987e424365ca67f6dc29e037e52ea11.
For some reason using FallbackModel works with CMake and does not work
with bazel. Using `ExternalModel` works. I will check what's going on
and resubmit tomorrow.

2 years ago[NFC][clang] Inclusive language: rename master variable to controller in debug-info...
Quinn Pham [Wed, 17 Nov 2021 18:21:58 +0000 (12:21 -0600)]
[NFC][clang] Inclusive language: rename master variable to controller in debug-info tests

[NFC] As part of using inclusive language within the llvm project, this patch
replaces master with controller in these tests.

Reviewed By: rjmccall

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

2 years ago[mlir] Move AllocationOpInterface to Bufferize/IR/AllocationOpInterface.td.
Alexander Belyaev [Mon, 22 Nov 2021 19:59:45 +0000 (20:59 +0100)]
[mlir] Move AllocationOpInterface to Bufferize/IR/AllocationOpInterface.td.

Remove the interface from op defs in MemRefOps.td and make it an external model.

This is the first PR of many that will move bufferization-related ops, interfaces, passes to Dialect/Bufferize.
RFC: https://llvm.discourse.group/t/rfc-dialect-for-bufferization-related-ops/4712
It is still debated if the comprehensive bufferization has to be moved there as well, so for now I am just moving the "gradual" bufferization.

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

2 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Mon, 22 Nov 2021 19:33:06 +0000 (14:33 -0500)]
[InstCombine] regenerate test checks; NFC

Avoid phantom (cosmetic value naming) diffs in potential future patches.

2 years ago[InstCombine] avoid 'tmp' usage in test files; NFC
Sanjay Patel [Mon, 22 Nov 2021 19:29:01 +0000 (14:29 -0500)]
[InstCombine] avoid 'tmp' usage in test files; NFC

The update script ( utils/update_test_checks.py ) warns against this
because it can conflict with the default FileCheck names given to
anonymous values in the IR.

2 years ago[InstCombine] move/add tests for binops with sext operand; NFC
Sanjay Patel [Sun, 21 Nov 2021 16:23:00 +0000 (11:23 -0500)]
[InstCombine] move/add tests for binops with sext operand; NFC

2 years ago[Driver] correct typo in FreeBSD 14 test
Ed Maste [Mon, 22 Nov 2021 16:26:55 +0000 (11:26 -0500)]
[Driver] correct typo in FreeBSD 14 test

The test specified amd64-unknown-freebsd40.0 rather than 14.0.  Since
40 is greater than 14 the test (for behaviour new in FreeBSD 14) worked
despite the typo.

Fixes: 699d47472c3f
Reviewed by: dim (in D77776)

2 years agoRevert "[mlir][Vector] Add a vblendps-based impl for transpose8x8 (both intrin and...
Mehdi Amini [Mon, 22 Nov 2021 19:23:18 +0000 (19:23 +0000)]
Revert "[mlir][Vector] Add a vblendps-based impl for transpose8x8 (both intrin and inline_asm)"

This reverts commit a9e236bed835c58be381dadb973a1db0681e4795.
This broke the Windows build:

mlir\include\mlir/Dialect/X86Vector/Transforms.h(28): error C2061: syntax error: identifier 'uint'

2 years ago[HWASan] Remove -Wa,-mrelax-relocations=no flag.
Matt Morehouse [Mon, 22 Nov 2021 18:32:28 +0000 (10:32 -0800)]
[HWASan] Remove -Wa,-mrelax-relocations=no flag.

We no longer need it after https://reviews.llvm.org/D113220.

Reviewed By: vitalybuka

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

2 years ago[lld-macho] Don't replace local personality symbol with LazySymbol
Vy Nguyen [Fri, 19 Nov 2021 15:56:58 +0000 (10:56 -0500)]
[lld-macho] Don't replace local personality symbol with LazySymbol

Follup-up to D107533, where we replaced local syms with non-local.
It doesn't make sense to replace local symbol with lazy.

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

2 years ago[docs] Incorprate first round of feedback on D114325
Philip Reames [Mon, 22 Nov 2021 19:00:53 +0000 (11:00 -0800)]
[docs] Incorprate first round of feedback on D114325

This builds on the text landed in 73d52ee78, and incorporates the points that Renato brought up.

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

2 years ago[InstCombine] (~(a | b) & c) | ~(c | (a ^ b)) -> ~((a | b) & (c | (b ^ a)))
Stanislav Mekhanoshin [Thu, 11 Nov 2021 20:08:27 +0000 (12:08 -0800)]
[InstCombine] (~(a | b) & c) | ~(c | (a ^ b)) -> ~((a | b) & (c | (b ^ a)))

Transform
```
(~(a | b) & c) | ~(c | (a ^ b)) -> ~((a | b) & (c | (b ^ a)))
```
And swapped case:
```
(a | ~(b & c)) & ~(a & (b ^ c)) --> ~(a | b) | (a ^ b ^ c)
```

```
----------------------------------------
define i3 @src(i3 %a, i3 %b, i3 %c) {
%0:
  %or1 = or i3 %b, %c
  %not1 = xor i3 %or1, 7
  %and1 = and i3 %a, %not1
  %xor1 = xor i3 %b, %c
  %or2 = or i3 %xor1, %a
  %not2 = xor i3 %or2, 7
  %or3 = or i3 %and1, %not2
  ret i3 %or3
}
=>
define i3 @tgt(i3 %a, i3 %b, i3 %c) {
%0:
  %obc = or i3 %b, %c
  %xbc = xor i3 %b, %c
  %o = or i3 %a, %xbc
  %and = and i3 %obc, %o
  %r = xor i3 %and, 7
  ret i3 %r
}
Transformation seems to be correct!
```
```
----------------------------------------
define i4 @src(i4 %a, i4 %b, i4 %c) {
%0:
  %and1 = and i4 %b, %c
  %not1 = xor i4 %and1, 15
  %or1 = or i4 %not1, %a
  %xor1 = xor i4 %b, %c
  %and2 = and i4 %xor1, %a
  %not2 = xor i4 %and2, 15
  %and3 = and i4 %or1, %not2
  ret i4 %and3
}
=>
define i4 @tgt(i4 %a, i4 %b, i4 %c) {
%0:
  %xor1 = xor i4 %b, %c
  %xor2 = xor i4 %xor1, %a
  %or1 = or i4 %a, %b
  %not1 = xor i4 %or1, 15
  %or2 = or i4 %xor2, %not1
  ret i4 %or2
}
Transformation seems to be correct!
```

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

2 years ago[libcxx][NFC] adds var-const@ as the owner for the uninitialised algos
Christopher Di Bella [Mon, 22 Nov 2021 18:44:13 +0000 (18:44 +0000)]
[libcxx][NFC] adds var-const@ as the owner for the uninitialised algos

2 years ago[libcxx][NFC] adds status entry for ranges algorithms
Christopher Di Bella [Fri, 19 Nov 2021 23:26:35 +0000 (23:26 +0000)]
[libcxx][NFC] adds status entry for ranges algorithms

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

2 years ago[libc++][NFC] Reformat comment about D68480 support
Louis Dionne [Mon, 22 Nov 2021 18:33:39 +0000 (13:33 -0500)]
[libc++][NFC] Reformat comment about D68480 support

2 years agolibfuzzer: Disable broken tests for arm
Manoj Gupta [Sat, 20 Nov 2021 06:03:34 +0000 (22:03 -0800)]
libfuzzer: Disable broken tests for arm

libfuzzer was recently enabled for Arm32 in D112091.
A few tests apparently do not work with arm32 so disable them.
The list of tests was obtained from
https://lab.llvm.org/buildbot/#/builders/190/builds/513

Reviewed By: morehouse

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

2 years ago[gn build] Port d8380ad977e9
LLVM GN Syncbot [Mon, 22 Nov 2021 18:24:45 +0000 (18:24 +0000)]
[gn build] Port d8380ad977e9

2 years ago[gn build] Port 344cef6695e9
LLVM GN Syncbot [Mon, 22 Nov 2021 18:24:44 +0000 (18:24 +0000)]
[gn build] Port 344cef6695e9

2 years ago[libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order.
Arthur O'Dwyer [Thu, 29 Jul 2021 02:04:18 +0000 (22:04 -0400)]
[libc++] [P1614] Implement [cmp.alg]'s std::{strong,weak,partial}_order.

This does not include `std::compare_*_fallback`; those are coming later.

There's still an open question of how to implement std::strong_order
for `long double`, which has 80 value bits and 48 padding bits on x86-64,
and which is presumably *not* IEEE 754-compliant on PPC64 and so on.
So that part is left unimplemented.

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

2 years ago[libc++] Granularize the <random> header. NFCI.
Arthur O'Dwyer [Fri, 19 Nov 2021 19:58:51 +0000 (14:58 -0500)]
[libc++] Granularize the <random> header. NFCI.

Actually there's one functional change here, which is that users can
no longer depend on <random> to include all of C++20 <concepts>. That
inclusion is so new that we believe nobody should be depending on it
yet, even in the presence of Hyrum's Law. We keep the includes of <vector>,
<algorithm>, etc., so as not to break pre-C++20 Hyrum's Law users.

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

2 years agoRevert "tsan: new runtime (v3)"
Dmitry Vyukov [Mon, 22 Nov 2021 18:03:48 +0000 (19:03 +0100)]
Revert "tsan: new runtime (v3)"

Summary:
This reverts commit 1784fe0532a69ead17793bced060a9bf9d232027.

Broke some bots:
https://lab.llvm.org/buildbot#builders/57/builds/12365
http://green.lab.llvm.org/green/job/clang-stage1-RA/25658/

Reviewers: vitalybuka, melver

Subscribers:

2 years ago[flang] Add -fno-automatic, refine IsSaved()
Peter Klausler [Thu, 18 Nov 2021 19:48:42 +0000 (11:48 -0800)]
[flang] Add -fno-automatic, refine IsSaved()

This legacy option (available in other Fortran compilers with various
spellings) implies the SAVE attribute for local variables on subprograms
that are not explicitly RECURSIVE.  The SAVE attribute essentially implies
static rather than stack storage.  This was the default setting in Fortran
until surprisingly recently, so explicit SAVE statements & attributes
could be and often were omitted from older codes.  Note that initialized
objects already have an implied SAVE attribute, and objects in COMMON
effectively do too, as data overlays are extinct; and since objects that are
expected to survive from one invocation of a procedure to the next in static
storage should probably be explicit initialized in the first place, so the
use cases for this option are somewhat rare, and all of them could be
handled with explicit SAVE statements or attributes.

This implicit SAVE attribute must not apply to automatic (in the Fortran sense)
local objects, whose sizes cannot be known at compilation time.  To get the
semantics of IsSaved() right, the IsAutomatic() predicate was moved into
Evaluate/tools.cpp to allow for dynamic linking of the compiler.  The
redundant predicate IsAutomatic() was noticed, removed, and its uses replaced.

GNU Fortran's spelling of the option (-fno-automatic) was added to
the clang-based driver and used for basic sanity testing.

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

2 years ago[hwasan] fix arguments to symbolizer.
Florian Mayer [Sat, 20 Nov 2021 02:20:43 +0000 (18:20 -0800)]
[hwasan] fix arguments to symbolizer.

new versions do not accept -inlining of -functions (tested with 11 and
13).

Reviewed By: hctim

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

2 years ago[mlir][vector] Fix TransferOpReduceRank for 0-D tensors
Lei Zhang [Mon, 22 Nov 2021 17:28:39 +0000 (12:28 -0500)]
[mlir][vector] Fix TransferOpReduceRank for 0-D tensors

We cannot unconditionally generate memref.load ops for such cases;
need to check the source's type.

Reviewed By: nicolasvasilache

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

2 years ago[mlir] support recursive types in type conversion infra
Alex Zinenko [Mon, 22 Nov 2021 12:19:36 +0000 (13:19 +0100)]
[mlir] support recursive types in type conversion infra

MLIR supports recursive types but they could not be handled by the conversion
infrastructure directly as it would result in infinite recursion in
`convertType` for elemental types. Support this case by keeping the "call
stack" of nested type conversions in the TypeConverter class and by passing it
as an optional argument to the individual conversion callback. The callback can
then check if a specific type is present on the stack more than once to detect
and handle the recursive case.

This approach is preferred to the alternative approach of having a separate
callback dedicated to handling only the recursive case as the latter was
observed to introduce ~3% time overhead on a 50MB IR file even if it did not
contain recursive types.

This approach is also preferred to keeping a local stack in type converters
that need to handle recursive types as that would compose poorly in case of
out-of-tree or cross-project extensions.

Reviewed By: rriddle

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

2 years ago[runtimes] Do not force -stdlib=libc++ on Apple platforms
Louis Dionne [Fri, 19 Nov 2021 21:57:36 +0000 (16:57 -0500)]
[runtimes] Do not force -stdlib=libc++ on Apple platforms

It is pointless to specify -stdlib=libc++ on Apple platforms since
that is the default anyway.

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

2 years ago[flang] Predefine unit 0 connected to stderr
Peter Klausler [Thu, 18 Nov 2021 17:34:43 +0000 (09:34 -0800)]
[flang] Predefine unit 0 connected to stderr

This is a near-universal language extension; external unit 0
is preconnected to the standard error output.

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

2 years ago[libc++] Remove uses of printf in some test support headers
Louis Dionne [Fri, 19 Nov 2021 21:29:15 +0000 (16:29 -0500)]
[libc++] Remove uses of printf in some test support headers

In the test suite, we generally don't use printf or other reporting
utilities. It's not that it wouldn't be useful, it's just that some
platforms don't support IO.

Instead, we try to keep test cases small and self-contained so that
we can reasonably easily reproduce failures locally and debug them.
This patch removes printf in some of the last places in the test suite
that used it. The only remaining places are in a deque test and in the
filesystem tests. The filesystem tests are arguably fine to keep using
IO, since we're testing <filesystem>. The deque test will be handled
separately.

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

2 years ago[libc++] [NFC] Mark P0858R0 as implemented
Nikolas Klauser [Mon, 22 Nov 2021 02:20:15 +0000 (03:20 +0100)]
[libc++] [NFC] Mark P0858R0 as implemented

P0858R0 seems to be implemented. D93830 sets `__cpp_lib_string_view` and D80452 sets `__cpp_lib_array_constexpr`.

Reviewed By: Quuxplusone, Mordante, ldionne, #libc

Spies: libcxx-commits

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

2 years ago[asm] Merge EmitMSInlineAsmStr() and EmitGCCInlineAsmStr()
Nico Weber [Sun, 21 Nov 2021 03:38:54 +0000 (22:38 -0500)]
[asm] Merge EmitMSInlineAsmStr() and EmitGCCInlineAsmStr()

This basically reverts 1778831a3d1, which split them.
Since they were split 9 years ago, EmitGCCInlineAsmStr() grew a bunch of
features that usually weren't added to EmitMSInlineAsmStr(), and
that was usually a mistake.  D71677, D113932, D114167 are all examples
of where things were backported to EmitMSInlineAsmStr().

The names were also not great. EmitMSInlineAsmStr() used to be called for `asm
inteldialect`, which clang produces for Microsoft-style __asm { ... } blocks as
well for GCC-style __asm__ / asm statements with -masm=intel. On the other hand,
EmitGCCInlineAsmStr() used to be called for `asm`, whic clang produces for
GCC-style __asm__ / asm statements with -masm=att (the default).

It's also less code (23 insertions, 188 deletions).

No behavior change.

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

2 years ago[asm] Allow labels as operands in intel asm syntax
Nico Weber [Sun, 21 Nov 2021 03:04:26 +0000 (22:04 -0500)]
[asm] Allow labels as operands in intel asm syntax

This makes a line in llvm/test/CodeGen/X86/asm-block-labels.ll pass
with `asm inteldialect` too.

I don't know if this is something one can hit in practice with inline
asm. The test is from 2007 (4646aa3e337aa) but in 2009 blockaddr was
introduced and e.g. `__asm__ __volatile__("brl %0" :: "X"(&&foo) : "memory");`
compiles to

    call void asm sideeffect "brl $0", "X,..."(i8* blockaddress(@func, %1))

nowadays (thanks to jrtc27 for that example!).

(6c4d255bf3d64 switched clang to blockaddress on an opt-in basis,
e4801f7844bb added docs for it, 31b132c0b781 added IR support.)

I half-heartedly tried to build clang 2.8 locally, but it didn't
just build. And 2.8 didn't have a prebuilt clang binary yet.

The motivation is to make EmitGCCInlineAsmStr() and EmitMSInlineAsmStr()
more alike, and maybe we should delete this code form EmitGCCInlineAsmStr()
instead. But since it's just 3 lines and it's reachable from LLVM IR,
let's do the safer thing for now.

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

2 years ago[libc++] Improve CMake include directory search.
Mark de Wever [Fri, 19 Nov 2021 15:43:27 +0000 (16:43 +0100)]
[libc++] Improve CMake include directory search.

This patch has been tested in D70631, but it should be reviewed
separately.

Reviewed By: ldionne, #libc

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

2 years ago[Analyzer][Core] Simplify IntSym in SValBuilder
Gabor Marton [Thu, 11 Nov 2021 13:43:03 +0000 (14:43 +0100)]
[Analyzer][Core] Simplify IntSym in SValBuilder

Make the SimpleSValBuilder capable to simplify existing IntSym
expressions based on a newly added constraint on the sub-expression.

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

2 years agoUse std::string::substr (NFC)
Kazu Hirata [Mon, 22 Nov 2021 16:21:09 +0000 (08:21 -0800)]
Use std::string::substr (NFC)

2 years ago[Target] Use range-based for loops (NFC)
Kazu Hirata [Mon, 22 Nov 2021 16:21:07 +0000 (08:21 -0800)]
[Target] Use range-based for loops (NFC)

2 years ago[SLP][NFC]Add a test that reveals the problem in the emission of
Alexey Bataev [Mon, 22 Nov 2021 15:41:07 +0000 (07:41 -0800)]
[SLP][NFC]Add a test that reveals the problem in the emission of
vector int division with undefs.

2 years ago[NFC][llvm][Hexagon] Inclusive Terms remove uses of sanity in Hexagon taget
Zarko Todorovski [Mon, 22 Nov 2021 14:39:21 +0000 (09:39 -0500)]
[NFC][llvm][Hexagon] Inclusive Terms remove uses of sanity in Hexagon taget

Most changes are rewording comments but there are some assertions that I rephrased.

Reviewed By: kparzysz

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

2 years ago[RISCV] Reverse the order of loading/storing callee-saved registers.
Hsiangkai Wang [Tue, 16 Nov 2021 08:01:37 +0000 (16:01 +0800)]
[RISCV] Reverse the order of loading/storing callee-saved registers.

Currently, we restore the return address register as the last restoring
instruction in the epilog. The next instruction is `ret` usually. It is
a use of return address register. In some microarchitectures, there is
load-to-use data hazard. To avoid the load-to-use data hazard, we could
separate the load instruction from its use as far as possible. In this
patch, we reverse the order of restoring callee-saved registers to
increase the distance of `load ra` and `ret` in the epilog.

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

2 years agotsan: new runtime (v3)
Dmitry Vyukov [Tue, 27 Apr 2021 11:55:41 +0000 (13:55 +0200)]
tsan: new runtime (v3)

This change switches tsan to the new runtime which features:
 - 2x smaller shadow memory (2x of app memory)
 - faster fully vectorized race detection
 - small fixed-size vector clocks (512b)
 - fast vectorized vector clock operations
 - unlimited number of alive threads/goroutimes

Depends on D112602.

Reviewed By: melver

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

2 years agotsan: disable instrumentation in runtime callbacks in tests
Dmitry Vyukov [Mon, 22 Nov 2021 07:22:01 +0000 (08:22 +0100)]
tsan: disable instrumentation in runtime callbacks in tests

All runtime callbacks must be non-instrumented with the new tsan runtime
(it's now more picky with respect to recursion into runtime).
Disable instrumentation in Darwin tests as we do in all other tests now.

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

2 years agoRevert "[SCEV] Fix and validate ValueExprMap/ExprValueMap consistency"
Nikita Popov [Mon, 22 Nov 2021 14:46:46 +0000 (15:46 +0100)]
Revert "[SCEV] Fix and validate ValueExprMap/ExprValueMap consistency"

This reverts commit d633db8f9dd4a361e60a9030c82adc490d5797e3.

Causes bootstrap assertion failures:
https://lab.llvm.org/buildbot/#/builders/168/builds/3459/steps/9/logs/stdio