Commit Graph

384386 Commits

Author SHA1 Message Date
Alex Richardson 8fa570c969 [WebAssembly] Fix incorrect DW_TAG_pointer_type size in test
It should be 64 bits not 32 for wasm64-unknown-unknown. I noticed this
because this test was failing in our CHERI fork of LLVM due to a larger
.debug_abbrev section size. It turns out this happens because we add
DW_AT_byte_size for non-default pointer sizes to allow debugging our
hybrid compilation mode where we can have two different kinds of pointers.

Reviewed By: aardappel

Differential Revision: https://reviews.llvm.org/D99410
2021-03-31 09:17:45 +01:00
Nicolas Vasilache 43b9fa3ce0 [mlir][Linalg][Python] Create the body of builtin named Linalg ops
This revision adds support to properly add the body of registered
builtin named linalg ops.
At this time, indexing_map and iterator_type support is still
missing so the op is not executable yet.

Differential Revision: https://reviews.llvm.org/D99578
2021-03-31 07:58:32 +00:00
Alexander Belyaev 465b9a4a33 Revert "Revert "[mlir] Introduce CloneOp and adapt test cases in BufferDeallocation.""
This reverts commit 883912abe6.
2021-03-31 09:49:09 +02:00
Craig Topper afed50a14b [X86] Add test cases for PR48768 and D94856. NFC
This covers the BMI and TBM instructions. More tests will be
needed for other instructions.
2021-03-30 23:11:28 -07:00
Craig Topper 7588ed3a49 [X86] Regenerate test to add missing @PLT 2021-03-30 23:11:28 -07:00
Martin Storsjö 7acfd85756 [libcxx] [test] Don't add dirs from the LIB env var to PATH
The directories in LIB normally only contain import libraries or
static libraries, no runtime DLLs that would need to be found
while running tests.

This code stems from 1cd196e7b4,
which (among other things) tried to do this:

> * [Test] Fix handling of library runtime search paths by correctly adding them
>   to the PATH variable when running the tests.

It's unclear to me exactly what this fixed (or tried to) at the time,
as the LIB var doesn't normally point to runtime libs.

Differential Revision: https://reviews.llvm.org/D99241
2021-03-31 09:05:47 +03:00
Martin Storsjö 4a0a85becc [libcxx] [test] Fix tests of <cuchar> that unexpectedly succeed on windows
The tests expect that the <cuchar> include should fail. When libc++
is built on top of the MSVC runtime, the header does exist provided
by MSVC. Therefore, just mark the test as unsupported on windows,
to avoid tests that unexpectedly succeed.

Differential Revision: https://reviews.llvm.org/D99096
2021-03-31 09:05:47 +03:00
Jim Lin 32ca5a037a [RISCV] Refine pre-define macro tests
1. Undefined macro test for rv32i and rv64i.
  a. Reorder it with canonical order.
  b. Add missing  undefined macro check.
  c. Append defined value to `__riscv_a`, `__riscv_f` and `__riscv_c` to distinguish with
      `__riscv_arch_test`, `__riscv_cmodel_medlow` and `__riscv_float_abi_soft`. They have the same prefix.
2. Move abi macro test below f and d.
3. Unify coding style for newline.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D99631
2021-03-31 14:06:20 +08:00
Lang Hames ec235dd355 [JITLink] Delete copy and move constructors for jitlink::Section.
Sections are not movable or copyable.
2021-03-30 22:58:14 -07:00
Stella Laurenzo 9a9214fa25 [mlir] Add C and python API for is_registered_operation.
* Suggested to be broken out of D99578

Differential Revision: https://reviews.llvm.org/D99638
2021-03-30 22:56:02 -07:00
Nathan Chancellor 4e0045cc9b
libc: Default LIBC_INSTALL_PREFIX to ${CMAKE_INSTALL_PREFIX}
b22f448c21 added a rule to install libllvmlibc.a to
${LIBC_INSTALL_PREFIX}/${LIBC_INSTALL_LIBRARY_DIR}, which will be /lib
by default, which is disruptive to builds that stay within a user's
/home holder:

  $ ninja install
  ...
  -- Installing: /lib/libllvmlibc.a
  CMake Error at projects/libc/lib/cmake_install.cmake:54 (file):
    file INSTALL cannot copy file
   "/home/nathan/cbl/github/tc-build/build/llvm/stage1/projects/libc/lib/libllvmlibc.a"
    to "/lib/libllvmlibc.a": Permission denied.
  Call Stack (most recent call first):
    projects/libc/cmake_install.cmake:51 (include)
    projects/cmake_install.cmake:47 (include)
    cmake_install.cmake:76 (include)
  ...

Change LIBC_INSTALL_PREFIX's default value to ${CMAKE_INSTALL_PREFIX} so
that 'ninja install' does not attempt to install anything outside of the
user's requested installation location.

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

Reviewed By: sivachandra

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
2021-03-30 21:43:25 -07:00
Lang Hames 0269a407f3 [JITLink] Switch from StringRef to ArrayRef<char>, add some generic x86-64 utils
Adds utilities for creating anonymous pointers and jump stubs to x86_64.h. These
are used by the GOT and Stubs builder, but may also be used by pass writers who
want to create pointer stubs for indirection.

This patch also switches the underlying type for LinkGraph content from
StringRef to ArrayRef<char>. This avoids any confusion when working with buffers
that contain null bytes in the middle like, for example, a newly added null
pointer content array. ;)
2021-03-30 21:07:24 -07:00
Chuanqi Xu eb51dd719f [Coroutine] [Debug] Insert dbg.declare to entry.resume to print alloca in the coroutine frame under O2
Summary: Try to insert dbg.declare to entry.resume basic block in resume
function. In this way, we could print alloca such as __promise in
gdb/lldb under O2, which would be beneficial to debug coroutine program.

Test Plan: check-llvm

Reviewed by: aprantl

Differential Revision: https://reviews.llvm.org/D96938
2021-03-31 10:37:06 +08:00
Zhiwei Chen d332bbee45 [Utils][Emacs] Improve syntax highlight
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D99404
2021-03-30 19:32:30 -07:00
Fangrui Song 3e5ee194c0 [SimpleLoopUnswitch] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after 431a40e1e2 2021-03-30 19:27:10 -07:00
Craig Topper 5db19cc010 [RISCV] simm12_plus1 should not inherit from Operand. NFC
We only use this in Pat patterns, so it just needs to be an
ImmLeaf. If we did need it as an instruction operand, the
ParserMatchClass, EncoderMethod, and DecoderMethod were probably wrong.
2021-03-30 19:02:11 -07:00
Yang Fan 0d7fd9f0d0
[GlobalISel] Fix Wint-in-bool-context warning (NFC)
GCC warning:
```
/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp: In member function ‘bool llvm::CombinerHelper::matchFunnelShiftToRotate(llvm::MachineInstr&)’:
/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3882:35: warning: ?: using integer constants in boolean context, the expression will always evaluate to ‘true’ [-Wint-in-bool-context]
 3882 |       Opc == TargetOpcode::G_FSHL ? TargetOpcode::G_ROTL : TargetOpcode::G_ROTR;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2021-03-31 09:59:43 +08:00
Craig Topper 05998701b9 [RISCV] Remove some unused ImmLeafs. NFC
These got left behind when we switched RV32 to use selectImm to
match RV64.
2021-03-30 18:54:11 -07:00
Juneyoung Lee 431a40e1e2 [LoopUnswitch] Assert that branch condition is either and/or but not both
as suggested at https://reviews.llvm.org/rG5bb38e84d3d0#986321
2021-03-31 10:35:22 +09:00
Ta-Wei Tu 99fd066227 [clang][Sema] Don't try to initialize implicit variable of invalid anonymous union/struct
This fixes https://bugs.llvm.org/show_bug.cgi?id=49534, where the call to the constructor
of the anonymous union is checked and triggers assertion failure when trying to retrieve
the alignment of the `this` argument (which is a union with virtual function).

The extra check for alignment was introduced in D97187.

Reviewed By: tmatheson

Differential Revision: https://reviews.llvm.org/D98548
2021-03-31 09:05:45 +08:00
Walter Erquinigo a4ee79c8ae Fix errors in 0b69756110
Errors found in
https://lab.llvm.org/buildbot/#/builders/68/builds/9681/steps/6/logs/stdio
2021-03-30 18:03:02 -07:00
Lang Hames 3a83b8b2d2 [JITLink] Add a setProtectionFlags method to jitlink::Section.
This allows clients to modify the memory protection settings on sections via
jitlink passes. This can be used to, for example, override the default settings
on text pages and make them Read/Write/Executable under the JIT.
2021-03-30 17:56:29 -07:00
Richard Smith 9eef0fae2b Fix test expectations for %diff documentation. 2021-03-30 17:48:08 -07:00
Craig Topper f59ba0849f [StructLayout] Use TrailingObjects to allocate space for MemberOffsets.
MemberOffsets are stored at the end of StructLayout. The class
contains a single entry array to mark the start of the member
offsets. getStructLayout calculates the additional space needed
for additional elements before allocating memory.

This patch converts this to use TrailingObjects. This simplifies
the size computation in getStructLayout and gets rid of the
single entry array.

This is prep work, but to use TypeSize instead of uint64_t for
D98169. The single entry array doesn't work with TypeSize because
TypeSize doesn't have a default constructor. We thought this
change was an improvement by itself so we've separated it out.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D99608
2021-03-30 17:36:50 -07:00
Nico Weber fb0b19c3de Reland "[gn build] port 48e4b0f (__config_site)"
This reverts commit 13aff21f0d,
since the CMake part relanded in c06a8f9caa.

The GN part is a bit simpler than last time due to the
prior simplifications in acea470c16.
2021-03-30 20:32:36 -04:00
Walter Erquinigo 0b69756110 [trace][intel-pt] Implement trace start and trace stop
This implements the interactive trace start and stop methods.

This diff ended up being much larger than I anticipated because, by doing it, I found that I had implemented in the beginning many things in a non optimal way. In any case, the code is much better now.

There's a lot of boilerplate code due to the gdb-remote protocol, but the main changes are:

- New tracing packets: jLLDBTraceStop, jLLDBTraceStart, jLLDBTraceGetBinaryData. The gdb-remote packet definitions are quite comprehensive.
- Implementation of the "process trace start|stop" and "thread trace start|stop" commands.
- Implementaiton of an API in Trace.h to interact with live traces.
- Created an IntelPTDecoder for live threads, that use the debugger's stop id as checkpoint for its internal cache.
- Added a functionality to stop the process in case "process tracing" is enabled and a new thread can't traced.
- Added tests

I have some ideas to unify the code paths for post mortem and live threads, but I'll do that in another diff.

Differential Revision: https://reviews.llvm.org/D91679
2021-03-30 17:31:37 -07:00
Richard Smith c23ee7718e [www] List both the regular and expanded form of %diff in the
diagnostics reference.

In passing, properly validate and diagnose errors in %diff format
specifiers.
2021-03-30 17:25:01 -07:00
Muhammad Omair Javaid 9ab6771800 [LLDB] Arm64/Linux test case for MTE and Pointer Authentication regset
This patch adds a test case to test AArch64 dynamic register sets.
This tests for the availability of certain register sets and query
their registers accordingly.

Reviewed By: labath, DavidSpickett

Differential Revision: https://reviews.llvm.org/D96463
2021-03-31 04:39:14 +05:00
Muhammad Omair Javaid 1164b4e295 [LLDB] Arm64/Linux Add MTE and Pointer Authentication registers
This patch adds two new dynamic register sets for AArch64 MTE and
Pointer Authentication features. These register sets are dynamic and
will only be available if underlying hardware support either of these
features. LLDB will pull in Aux vector information and create register
infos based on that information.

A follow up patch will add a test case to test these feature registers.

Reviewed By: labath, DavidSpickett

Differential Revision: https://reviews.llvm.org/D96460
2021-03-31 04:39:00 +05:00
Muhammad Omair Javaid d6d3d21cd1 [LLDB] Add support for Arm64/Linux dynamic register sets
This is patch adds support for adding dynamic register sets for
AArch64 dynamic features in LLDB. AArch64 has optional features like
SVE, Pointer Authentication and MTE which means LLDB needs to decide
at run time which registers it needs to pull in for the current
executable based on underlying support for a certain feature.

This patch makes necessary adjustments to make way for dynamic
register infos and dynamic register sets.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D96458
2021-03-31 04:38:36 +05:00
Heejin Ahn 144ec1c38e [WebAssembly] Encode numbers in ULEB128 in event section
The number of events and the type index should be encoded in ULEB128,
but they were incorrctly encoded in LEB128. The smallest number with
which its LEB128 and ULEB128 encodings are different is 64.
There's no way we can generate 64 events in the C++ toolchain
implementation so we can't test that, but the attached test tests when
the type index is 64.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D99627
2021-03-30 16:21:58 -07:00
Richard Smith c5f174905b Delete checked-in generated copy of diagnostic reference.
The documentation build rule will generate an up-to-date version of this
if it's not checked in.
2021-03-30 16:18:55 -07:00
Richard Smith d87384f7df [www] Fix build of attribute documentation. 2021-03-30 16:18:55 -07:00
Richard Smith 1705136590 Fix pluralization error in diagnostic, and move C++ testcase to proper
directory.
2021-03-30 16:18:55 -07:00
Zequan Wu eabd55b1b2 [lld-link] Enable addrsig table in COFF lto
This allow safe-icf mode to work when linking with LTO.

Differential Revision: https://reviews.llvm.org/D99613
2021-03-30 15:47:53 -07:00
Richard Smith ee176d2e6e [www] Color Clang 11 and Clang 12 features as green and not yellow, and
Clang 13 features as yellow not green.
2021-03-30 15:22:16 -07:00
Mehdi Amini a360a9786f Fix deletion of operations through the rewriter in a pattern matching a consumer operation
This allows for the conversion to match `A(B()) -> C()` with a pattern matching
`A` and marking `B` for deletion.

Also add better assertions when an operation is erased while still having uses.

Differential Revision: https://reviews.llvm.org/D99442
2021-03-30 22:02:14 +00:00
Greg McGary 427d359721 [lld-macho][NFC] Drop unnecessary macho:: namespace prefix on unambiguous references to Symbol
Within `lld/macho/`, only `InputFiles.cpp` and `Symbols.h` require the `macho::` namespace qualifier to disambiguate references to `class Symbol`.

Add braces to outer `for` of a 5-level single-line `if`/`for` nest.

Differential Revision: https://reviews.llvm.org/D99555
2021-03-30 14:58:35 -07:00
Wei Mi d535a05ca1 [ThinLTO] During module importing, close one source module before open
another one for distributed mode.

Currently during module importing, ThinLTO opens all the source modules,
collect functions to be imported and append them to the destination module,
then leave all the modules open through out the lto backend pipeline. This
patch refactors it in the way that one source module will be closed before
another source module is opened. All the source modules will be closed after
importing phase is done. It will save some amount of memory when there are
many source modules to be imported.

Note that this patch only changes the distributed thinlto mode. For in
process thinlto mode, one source module is shared acorss different thinlto
backend threads so it is not changed in this patch.

Differential Revision: https://reviews.llvm.org/D99554
2021-03-30 14:37:29 -07:00
Jon Roelofs 58cbb222eb [docs] Fix up dead clang-format links after monorepo move. NFC 2021-03-30 14:29:35 -07:00
Mike Rice b7899ba0e8 [OPENMP51]Initial support for the dispatch directive.
Added basic parsing/sema/serialization support for dispatch directive.

Differential Revision: https://reviews.llvm.org/D99537
2021-03-30 14:12:53 -07:00
Louis Dionne c06a8f9caa [libc++] Include <__config_site> from <__config>
Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.

This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.

It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
hand.

Differential Revision: https://reviews.llvm.org/D97572
2021-03-30 14:06:11 -07:00
David Green 3a6365a439 [ARM] Add FeatureHasNoBranchPredictor for Thumb1 cores
Mark v6m/v8m-baseline cores as having no branch predictors. This should
not alter very much on its own, but is more correct as the cores do not
have branch predictors and can help in the future.
2021-03-30 21:45:26 +01:00
Alexey Bataev e2c7bf08cc [OPENMP]Fix PR48607: Crash during clang openmp codegen for firstprivate() of `float _Complex`.
Need to cast the argument for the debug wrapper function call to the
corresponding parameter type to avoid crash.

Differential Revision: https://reviews.llvm.org/D99617
2021-03-30 13:39:45 -07:00
Luís Marques eb4967c8bd [Sanitizer][RISCV][AArch64][Android] Adjust allocator tests
On 64-bit systems with small VMAs (e.g. 39-bit) we can't use
SizeClassAllocator64 parameterized with size class maps containing a large
number of classes, as that will make the allocator region size too small
(< 2^32). Several tests were already disabled for Android because of this.

This patch provides the correct allocator configuration for RISC-V
(riscv64), generalizes the gating condition for tests that can't be enabled
for small VMA systems, and tweaks the tests that can be made compatible with
those systems to enable them.

I think the previous gating on Android should instead be AArch64+Android, so
the patch reflects that.

Differential Revision: https://reviews.llvm.org/D97234
2021-03-30 21:20:37 +01:00
David Blaikie ae217bf1f3 Conditionalize the JIT test dependency 2021-03-30 13:04:02 -07:00
Matheus Izvekov 3ad6dd5d8f [clang] Use decltype((E)) for compound requirement type constraint
See PR45088.

Compound requirement type constraints were using decltype(E) instead of
decltype((E)), as per `[expr.prim.req]p1.3.3`.

Since neither instantiation nor type dependence should matter for
the constraints, this uses an approach where a `decltype` type is not built,
and just the canonical type of the expression after template instantiation
is used on the requirement.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D98160
2021-03-30 22:00:33 +02:00
Fangrui Song 73adc05ced [GlobalISel] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D99463 2021-03-30 12:52:56 -07:00
Sanjay Patel c2ebad8d55 [InstCombine] add fold for demand of low bit of abs()
This is one problem shown in https://llvm.org/PR49763

https://alive2.llvm.org/ce/z/cV6-4K
https://alive2.llvm.org/ce/z/9_3g-L
2021-03-30 15:14:37 -04:00
Sanjay Patel 79ae41991c [InstCombine] add test for abs() demanded bits; NFC 2021-03-30 15:14:37 -04:00