platform/upstream/llvm.git
13 months ago[AMDGPU] Fix VOPD dependency checks during combine
Stanislav Mekhanoshin [Wed, 14 Jun 2023 18:37:44 +0000 (11:37 -0700)]
[AMDGPU] Fix VOPD dependency checks during combine

Check superreg/subreg defs of an instruction when checking for
dependencies. This may cause some regressions, but better be
safe than sorry. Changed tests are affected because of the
implicit-defs of the superregs.

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

13 months ago[mlir][linalg] Fix linalg.conv vectorization for mixed int-fp types
Rob Suderman [Thu, 15 Jun 2023 17:53:28 +0000 (10:53 -0700)]
[mlir][linalg] Fix linalg.conv vectorization for mixed int-fp types

We always assume mixed same type values. Instead of ExtF or ExtSI, we
need SIToFp when the values must be promoted.

Reviewed By: dcaballe

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

13 months ago[libc++] Add tests to make sure that stable algorithms work without memory available
Nikolas Klauser [Thu, 15 Jun 2023 15:40:42 +0000 (08:40 -0700)]
[libc++] Add tests to make sure that stable algorithms work without memory available

Reviewed By: #libc, ldionne

Spies: power-llvm-team, ldionne, libcxx-commits, arichardson, mstorsjo

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

13 months ago[lldb] Introduce DynamicRegisterInfo::CreateFromDict
Alex Langford [Fri, 9 Jun 2023 23:27:49 +0000 (16:27 -0700)]
[lldb] Introduce DynamicRegisterInfo::CreateFromDict

I want to add some error handling to DynamicRegisterInfo because there
are many operations that can fail and many of these operations do not
give meaningful information back to the caller.

To begin that process, I want to add a static method that is responsible
for creating a DynamicRegisterInfo from a StructuredData::Dictionary
(and ArchSpec). This is meant to replace the equivalent constructor
because constructors are ill-equipped to perform error handling.

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

13 months ago[MLIR][Tosa] Pass encoding through `tosa-to-linalg`
rikhuijzer [Thu, 15 Jun 2023 16:42:17 +0000 (18:42 +0200)]
[MLIR][Tosa] Pass encoding through `tosa-to-linalg`

As pointed out by @Sinclair-Dee in
https://github.com/llvm/llvm-project/issues/62304, the `tosa-to-linalg`
conversion ignored the `encoding` attribute.

Also, this patch avoids an assertion error crash on unranked tensors.
Instead, the conversion now throws a "failed to legalize" error.

Fixes #62304 and fixes #63165.

Reviewed By: mehdi_amini

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

13 months ago[mlir][sparse][gpu] enable sm80+ sparsity integration test only when explicitly set
Kun Wu [Thu, 15 Jun 2023 17:05:37 +0000 (17:05 +0000)]
[mlir][sparse][gpu] enable sm80+ sparsity integration test only when explicitly set

Reviewed By: aartbik

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

13 months ago[6/6][Clang][RISCV] Replace indexed segment store with tuple type interfaces
eopXD [Mon, 5 Jun 2023 09:49:24 +0000 (02:49 -0700)]
[6/6][Clang][RISCV] Replace indexed segment store with tuple type interfaces

Depends on D152138.

This is the 6th commit of the patch-set.

This patch makes the indexed segment store intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[5/6][Clang][RISCV] Replace indexed segment load with tuple type interfaces
eopXD [Mon, 5 Jun 2023 09:22:30 +0000 (02:22 -0700)]
[5/6][Clang][RISCV] Replace indexed segment load with tuple type interfaces

Depends on D152137.

This is the 5th commit of the patch-set.

This patch makes the indexed segment load intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[4/6][Clang][RISCV] Replace strided segment store with tuple type interfaces
eopXD [Mon, 5 Jun 2023 08:50:11 +0000 (01:50 -0700)]
[4/6][Clang][RISCV] Replace strided segment store with tuple type interfaces

Depends on D152136.

This is the 4th commit of the patch-set.

This patch makes the strided segment store intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[3/6][Clang][RISCV] Replace strided segment load with tuple type interfaces
eopXD [Mon, 5 Jun 2023 08:39:21 +0000 (01:39 -0700)]
[3/6][Clang][RISCV] Replace strided segment load with tuple type interfaces

Depends on D152135.

This is the 3rd commit of the patch-set.

This patch makes the strided segment load intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[2/6][Clang][RISCV] Replace unit-stride segment store with tuple type interfaces
eopXD [Mon, 5 Jun 2023 07:57:51 +0000 (00:57 -0700)]
[2/6][Clang][RISCV] Replace unit-stride segment store with tuple type interfaces

Depends on D152134.

This is the 2nd commit of the patch-set.

This patch makes the unit-stride segment store intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[1/6][Clang][RISCV] Replace unit-stride (fault-first) segment load with tuple type...
eopXD [Mon, 5 Jun 2023 07:46:20 +0000 (00:46 -0700)]
[1/6][Clang][RISCV] Replace unit-stride (fault-first) segment load with tuple type interfaces

Depends on D152079.

This patch-set aims to replace the existing segment load/store
intrinsics with tuple-type segment load/store intrinsics. That is, we
are removing in the segment load/store intrinsics.

This is the 1st commit of the patch-set.

This patch makes the unit-stride segment load intrinsics and
unit-stride fault-first segment load intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months agoRevert "Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local impor...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 17:36:36 +0000 (19:36 +0200)]
Revert "Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)""

This reverts commit fcc3981626821addc6c77b98006d02030b8ceb7f,
since Bitcode-upgrading code doesn't seem to be deterministic.

13 months ago[ELF] << >>: make RHS less than 64
Fangrui Song [Thu, 15 Jun 2023 17:34:33 +0000 (10:34 -0700)]
[ELF] << >>: make RHS less than 64

The left/right shift linker script operators may trigger UB.
E.g. in linkerscript/end-overflow-check.test, the initial REGION1__PADDED_SR_SHIFT is
uint64_t(-3), cause the following expression to trigger an out-of-range shift in
a ubsan build of lld.

    REGION1__PADDED_SR_SIZE = MAX(1 << REGION1__PADDED_SR_SHIFT, 32);

Protect such UBs by making RHS less than 64.

13 months ago[mlir][sparse] merger extension to support sparsifying arith::CmpI/CmpF operation
Peiming Liu [Mon, 12 Jun 2023 21:47:26 +0000 (21:47 +0000)]
[mlir][sparse] merger extension to support sparsifying arith::CmpI/CmpF operation

Reviewed By: aartbik

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

13 months ago[InstCombine] Verify CmpInst is equality in `foldICmpPow2Test`; PR63327
Noah Goldstein [Thu, 15 Jun 2023 16:37:33 +0000 (11:37 -0500)]
[InstCombine] Verify CmpInst is equality in `foldICmpPow2Test`; PR63327

When D152728 hoisted the code to a helper function, it moved the call
to the helper outside of `foldICmpEquality`, so an equality check is
needed in the helper.

Reviewed By: nikic, fhahn

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

13 months agoRevert "[SelectionDAG][RISCV] Add very basic PromoteIntegerResult/Op support for...
Alan Zhao [Thu, 15 Jun 2023 17:20:03 +0000 (10:20 -0700)]
Revert "[SelectionDAG][RISCV] Add very basic PromoteIntegerResult/Op support for VP_SIGN/ZERO_EXTEND."

This reverts commit 6bf79fb09416b02b3f8589a4998610d70c185dae.

Reason: causes Clang to crash during Chrome debug builds: https://crbug.com/1455144

13 months agoAMDGPU: Add baseline test for propagating amdgpu-waves-per-eu
Matt Arsenault [Sat, 3 Jun 2023 20:44:19 +0000 (16:44 -0400)]
AMDGPU: Add baseline test for propagating amdgpu-waves-per-eu

13 months agoFix NATVIS for some Clang types
Aaron Ballman [Thu, 15 Jun 2023 16:59:36 +0000 (12:59 -0400)]
Fix NATVIS for some Clang types

This updates the definition for ExplicitSpecifier and
DeclarationNameExtra.

13 months agoCleanup the MLIR LSP doc to remove references to the passes
Mehdi Amini [Thu, 15 Jun 2023 16:42:58 +0000 (18:42 +0200)]
Cleanup the MLIR LSP doc to remove references to the passes

The MLIR LSP server initially had plans to support running passes from the
client, but this was never implemented. The doc unnecessarily advise to
register passes and makes reference to LSP server having some interaction
with passes.

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

13 months agoAdd dsymutil dwarf5 tests for darwin
Shubham Sandeep Rastogi [Thu, 1 Jun 2023 20:46:54 +0000 (13:46 -0700)]
Add dsymutil dwarf5 tests for darwin

The first test, dwarf5-macho.test checks to make sure that dsymutil
generates the correct headers and sections for a macho binary with
DWARF v5 in it.

The second test, dwarf5-dwarf4-combination-macho.test checks that
dsymutil generates the correct headers and sections for a macho binary
with which was linked with one object file with DWARF v4 and the other
with DWARF v5 in it.

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

13 months ago[DebugInfo] Fix detection of hash collision in Apple Accel tables
Felipe de Azevedo Piovezan [Fri, 9 Jun 2023 21:40:32 +0000 (17:40 -0400)]
[DebugInfo] Fix detection of hash collision in Apple Accel tables

The current implementation was ignoring the possibility of collisions.

Differential Revision: D152586

13 months ago[lld-macho] Switch to new tool ID
Keith Smiley [Wed, 14 Jun 2023 15:51:30 +0000 (08:51 -0700)]
[lld-macho] Switch to new tool ID

As of Xcode 15 there is now a tool ID for LLD, likely driven by Apple's
tests with using LLD for their CAS work in clang. This updates LLD to
use the correct ID, and updates the object library so that llvm-objdump
prints it correctly.

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

13 months agoRevert "[DebugInfo] Fix detection of hash collision in Apple Accel tables"
Felipe de Azevedo Piovezan [Thu, 15 Jun 2023 16:36:58 +0000 (12:36 -0400)]
Revert "[DebugInfo] Fix detection of hash collision in Apple Accel tables"

Committed a slightly older patch without the proper link to the review.

This reverts commit 42874f66475548541cd871d5790116b2bc68b89a.

13 months ago[DebugInfo] Fix detection of hash collision in Apple Accel tables
Felipe de Azevedo Piovezan [Fri, 9 Jun 2023 21:40:32 +0000 (17:40 -0400)]
[DebugInfo] Fix detection of hash collision in Apple Accel tables

The current implementation was ignoring the possibility of collisions.

13 months ago[gn] port 05634f7346a5 (bolt -> JITLink)
Nico Weber [Thu, 15 Jun 2023 16:16:11 +0000 (09:16 -0700)]
[gn] port 05634f7346a5 (bolt -> JITLink)

13 months ago[gn] port 98f70e94e0592
Nico Weber [Thu, 15 Jun 2023 16:22:12 +0000 (09:22 -0700)]
[gn] port 98f70e94e0592

13 months ago[gn] port 80e4ccab794c
Nico Weber [Thu, 15 Jun 2023 16:15:46 +0000 (09:15 -0700)]
[gn] port 80e4ccab794c

13 months agoReland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 16:12:00 +0000 (18:12 +0200)]
Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"

Run split-dwarf-local-impor3.ll only on x86_64-linux.

13 months ago[libc++][modules] Adds the C++23 std module.
Mark de Wever [Tue, 28 Feb 2023 19:29:26 +0000 (20:29 +0100)]
[libc++][modules] Adds the C++23 std module.

The patch is based on D144994.

D151030 added the module definitions for the module std.
This patch wires in the module and enables the basic testing.

Some notable features are missing:
- There is no test that libc++ can be fully imported as a module.
- This lacks the parts for the std.compat module.
- The module is not shipped with libc++.

Implements parts of
- P2465R3 Standard Library Modules std and std.compat

Reviewed By: ldionne, aaronmondal, #libc

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

13 months ago[libc++][modules] Update the .cppm files.
Mark de Wever [Thu, 15 Jun 2023 16:12:06 +0000 (18:12 +0200)]
[libc++][modules] Update the .cppm files.

There are some minor fixes in the definiton and it is synced with
upstream changes.

This has been reviewed as part of D151814.

13 months agoRevert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 16:04:32 +0000 (18:04 +0200)]
Revert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"

This reverts commit d80fdc6fc1a6e717af1bcd7a7313e65de433ba85.
split-dwarf-local-impor3.ll fails because of an issue with
Dwo sections emission on Windows platform.

13 months ago[libc] Export GPU extensions to `libc` for external use
Joseph Huber [Tue, 6 Jun 2023 16:10:44 +0000 (11:10 -0500)]
[libc] Export GPU extensions to `libc` for external use

The GPU port of the LLVM C library needs to export a few extensions to
the interface such that users can interface with it. This patch adds the
necessary logic to define a GPU extension. Currently, this only exports
a `rpc_reset_client` function. This allows us to use the server in
D147054 to set up the RPC interface outside of `libc`.

Depends on https://reviews.llvm.org/D147054

Reviewed By: sivachandra

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

13 months ago[libc] Begin implementing a library for the RPC server
Joseph Huber [Mon, 5 Jun 2023 20:32:38 +0000 (15:32 -0500)]
[libc] Begin implementing a library for the RPC server

This patch begins providing a generic static library that wraps around
the raw `rpc.h` interface. As discussed in the corresponding RFC,
https://discourse.llvm.org/t/rfc-libc-exporting-the-rpc-interface-for-the-gpu-libc/71030,
we want to begin exporting RPC services to external users. In order to
do this we decided to not expose the `rpc.h` header by wrapping around
its functionality. This is done with a C-interface as we make heavy use
of callbacks and allows us to provide a predictable interface.

Reviewed By: JonChesterfield, sivachandra

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

13 months ago[Hexagon] Do not track reserved regs in RDF optimizations
Krzysztof Parzyszek [Tue, 6 Jun 2023 14:08:08 +0000 (07:08 -0700)]
[Hexagon] Do not track reserved regs in RDF optimizations

13 months ago[libc++] Merge _LIBCPP_FUNC_VIS, _LIBCPP_TYPE_VIS and _LIBCPP_EXCEPTION_ABI into...
Nikolas Klauser [Wed, 14 Jun 2023 17:17:50 +0000 (10:17 -0700)]
[libc++] Merge _LIBCPP_FUNC_VIS, _LIBCPP_TYPE_VIS and _LIBCPP_EXCEPTION_ABI into _LIBCPP_EXPORTED_FROM_ABI

These macros are always defined identically, so we can simplify the code a bit by merging them.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, krytarowski, smeenai

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

13 months agoHIP: Add a few more cmath header tests
Matt Arsenault [Tue, 13 Jun 2023 23:05:54 +0000 (19:05 -0400)]
HIP: Add a few more cmath header tests

13 months agoOpenMP: Add a new test for constantexpr evaluation of math headers
Matt Arsenault [Tue, 13 Jun 2023 22:18:32 +0000 (18:18 -0400)]
OpenMP: Add a new test for constantexpr evaluation of math headers

13 months ago[libc++abi] Avoid including source files into unittest_demangle
Louis Dionne [Tue, 13 Jun 2023 21:56:08 +0000 (14:56 -0700)]
[libc++abi] Avoid including source files into unittest_demangle

That is not necessary to test what we're testing, and in fact including
abort_message.cpp into that file caused some link errors if we didn't
link some of the dependencies of libc++abi directly into the test.

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

13 months ago[AArch64] Address post-commit comments from D150482.
Florian Hahn [Thu, 15 Jun 2023 15:38:09 +0000 (16:38 +0100)]
[AArch64] Address post-commit comments from D150482.

Address @v01dXYZ's comments, thanks!

13 months agoReland "[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size."
Zequan Wu [Thu, 15 Jun 2023 15:33:02 +0000 (11:33 -0400)]
Reland "[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size."

This reland 5d54213ee557a86fae82af0f75498adf02f24e82 with fixes.

13 months ago[CMake] Fixes using CMake 3.27.0.
Mark de Wever [Sat, 10 Jun 2023 11:45:13 +0000 (13:45 +0200)]
[CMake] Fixes using CMake 3.27.0.

Testing libc++ with CMake 3.27.0-rc1 fails. It seems some of the modules
used in CMake are not included.

The error before this change was
```
CMake Error at <mono-repo>/llvm/cmake/modules/HandleLLVMOptions.cmake:821 (CHECK_C_SOURCE_COMPILES):
  Unknown CMake command "CHECK_C_SOURCE_COMPILES".
Call Stack (most recent call first):
  CMakeLists.txt:156 (include)
```

Reviewed By: thesamesam

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

13 months ago[libc++] Don't automatically define LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS with libcxxrt
Louis Dionne [Wed, 14 Jun 2023 22:23:02 +0000 (15:23 -0700)]
[libc++] Don't automatically define LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS with libcxxrt

libcxxrt is only used on FreeBSD and the FreeBSD CMake cache already
sets LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS to ON, as it should. This
avoids defining LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS redundantly in
a place where it doesn't belong.

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

13 months ago[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 10:22:16 +0000 (12:22 +0200)]
[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)

RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544

Fixed PR51501 (tests from D112337).

1. Reuse of DISubprogram's 'retainedNodes' to track other function-local
   entities together with local variables and labels (this patch cares about
   function-local import while D144006 and D144008 use the same approach for
   local types and static variables). So, effectively this patch moves ownership
   of tracking local import from DICompileUnit's 'imports' field to DISubprogram's
   'retainedNodes' and adjusts DWARF emitter for the new layout. The old layout
   is considered unsupported (DwarfDebug would assert on such debug metadata).

   DICompileUnit's 'imports' field is supposed to track global imported
   declarations as it does before.

   This addresses various FIXMEs and simplifies the next part of the patch.

2. Postpone emission of function-local imported entities from
   `DwarfDebug::endFunctionImpl()` to `DwarfDebug::endModule()`.
   While in `DwarfDebug::endFunctionImpl()` we do not have all the
   information about a parent subprogram or a referring subprogram
   (whether a subprogram inlined or not), so we can't guarantee we emit
   an imported entity correctly and place it in a proper subprogram tree.
   So now, we just gather needed details about the import itself and its
   parent entity (either a Subprogram or a LexicalBlock) during
   processing in `DwarfDebug::endFunctionImpl()`, but all the real work is
   done in `DwarfDebug::endModule()` when we have all the required
   information to make proper emission.

Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com>
Differential Revision: https://reviews.llvm.org/D144004

13 months ago[libc++][NFC] clang-format new_handler.cpp
Louis Dionne [Wed, 14 Jun 2023 20:44:46 +0000 (13:44 -0700)]
[libc++][NFC] clang-format new_handler.cpp

13 months ago[libc++] Move the definition of std::new_handler out of new.cpp
Louis Dionne [Wed, 14 Jun 2023 20:37:57 +0000 (13:37 -0700)]
[libc++] Move the definition of std::new_handler out of new.cpp

This reduces the difference between libc++'s new.cpp and libc++abi's
stdlib_new_delete.cpp files, which are essentially copies of each other.

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

13 months agoRevert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 14:53:36 +0000 (16:53 +0200)]
Revert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"

This reverts commit ed578f02cf44a52adde16647150e7421f3ef70f3.

Tests llvm/test/DebugInfo/Generic/split-dwarf-local-import*.ll fail
when x86_64 target is not registered.

13 months ago[libc] Enable conversion functions on the GPU
Joseph Huber [Thu, 15 Jun 2023 13:18:11 +0000 (08:18 -0500)]
[libc] Enable conversion functions on the GPU

These functions were previously removed due to problems running the
tests with `errno` in them. This was resolved previously by making the
internal implementation of these functions use a global `errno` so that
tests can still use `errno` functionality as long as they are run with a
single thread. This allows us to re-enable these tests as a previous
patch has also resolved the issue where the `stdlib` tests could not be
hermetic due to the dependence on system rounding functions.

Reviewed By: lntue

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

13 months ago[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 10:22:16 +0000 (12:22 +0200)]
[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)

RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544

Fixed PR51501 (tests from D112337).

1. Reuse of DISubprogram's 'retainedNodes' to track other function-local
   entities together with local variables and labels (this patch cares about
   function-local import while D144006 and D144008 use the same approach for
   local types and static variables). So, effectively this patch moves ownership
   of tracking local import from DICompileUnit's 'imports' field to DISubprogram's
   'retainedNodes' and adjusts DWARF emitter for the new layout. The old layout
   is considered unsupported (DwarfDebug would assert on such debug metadata).

   DICompileUnit's 'imports' field is supposed to track global imported
   declarations as it does before.

   This addresses various FIXMEs and simplifies the next part of the patch.

2. Postpone emission of function-local imported entities from
   `DwarfDebug::endFunctionImpl()` to `DwarfDebug::endModule()`.
   While in `DwarfDebug::endFunctionImpl()` we do not have all the
   information about a parent subprogram or a referring subprogram
   (whether a subprogram inlined or not), so we can't guarantee we emit
   an imported entity correctly and place it in a proper subprogram tree.
   So now, we just gather needed details about the import itself and its
   parent entity (either a Subprogram or a LexicalBlock) during
   processing in `DwarfDebug::endFunctionImpl()`, but all the real work is
   done in `DwarfDebug::endModule()` when we have all the required
   information to make proper emission.

Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com>
Differential Revision: https://reviews.llvm.org/D144004

13 months ago[GlobalIsel][X86] Add handling for G_MERGE_VALUES/G_UNMERGE_VALUES
Simon Pilgrim [Thu, 15 Jun 2023 14:03:53 +0000 (15:03 +0100)]
[GlobalIsel][X86] Add handling for G_MERGE_VALUES/G_UNMERGE_VALUES

Replace the legacy legalizer versions - just use raw type sizes for now, we can add type specific handling if/when we need it

Fixes #63105

13 months ago[clang][Diagnostics] Don't expand label fixit to the next line
Timm Bäder [Fri, 9 Jun 2023 12:01:07 +0000 (14:01 +0200)]
[clang][Diagnostics] Don't expand label fixit to the next line

Now that we print >1 line of code snippet, we printed another line of
code for now reason, because the source range we created for the fixit
expanded to the next line, if the next token was there. Don't do that.

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

13 months agoLangRef: Delete trailing whitespace
Matt Arsenault [Wed, 14 Jun 2023 14:22:14 +0000 (10:22 -0400)]
LangRef: Delete trailing whitespace

13 months agoAMDGPU: Assume llvm.amdgcn.exp2 and log are canonicalizing
Matt Arsenault [Thu, 15 Jun 2023 13:48:58 +0000 (09:48 -0400)]
AMDGPU: Assume llvm.amdgcn.exp2 and log are canonicalizing

This was partially handled for log in SelectionDAG and both were
missed for GlobalISel.

13 months ago[bazel][bolt] Port 05634f7346a59f6dab89cde53f39b40d9a70b9c9
Benjamin Kramer [Thu, 15 Jun 2023 13:42:08 +0000 (15:42 +0200)]
[bazel][bolt] Port 05634f7346a59f6dab89cde53f39b40d9a70b9c9

13 months agoAMDGPU: Delete some stray / dead check prefixes
Matt Arsenault [Wed, 14 Jun 2023 23:34:54 +0000 (19:34 -0400)]
AMDGPU: Delete some stray / dead check prefixes

13 months agoValueTracking: Fix nan result handling for fmul
Matt Arsenault [Wed, 14 Jun 2023 19:41:22 +0000 (15:41 -0400)]
ValueTracking: Fix nan result handling for fmul

This was mishandling maybe 0 * inf.

Fixes issue #63316

13 months agoValueTracking: Add some baseline tests for issue #63316
Matt Arsenault [Wed, 14 Jun 2023 19:14:04 +0000 (15:14 -0400)]
ValueTracking: Add some baseline tests for issue #63316

13 months ago[clang-tidy] Correct the include-cleaner-check diagnostic message for missing-includes.
Haojian Wu [Thu, 15 Jun 2023 11:48:50 +0000 (13:48 +0200)]
[clang-tidy] Correct the include-cleaner-check diagnostic message for missing-includes.

We should print the symbol name rather than the header name in the
message.

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

13 months ago[NFC] Autogenerate CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll
Amaury Séchet [Thu, 15 Jun 2023 12:32:22 +0000 (12:32 +0000)]
[NFC] Autogenerate CodeGen/SPARC/LeonInsertNOPLoadPassUT.ll

13 months ago[AMDGPU] Trim trailing undefs from the end of image and buffer store
Mateja Marjanovic [Thu, 8 Jun 2023 12:29:47 +0000 (14:29 +0200)]
[AMDGPU] Trim trailing undefs from the end of image and buffer store

Remove undef values from the end of the vector operand in image and
buffer store instructions.
Also instead of call to computeKnownFPClass, use only findScalarElement.

Continuation of: 88421ea973916e Trim zero components from buffer and image stores

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

13 months ago[GlobalIsel][X86] Remove unused private field 'TM' in X86LegalizerInfo (NFC)
Jie Fu [Thu, 15 Jun 2023 13:15:45 +0000 (21:15 +0800)]
[GlobalIsel][X86] Remove unused private field 'TM' in X86LegalizerInfo (NFC)

/data/llvm-project/llvm/lib/Target/X86/X86LegalizerInfo.h:30:27: error: private field 'TM' is not used [-Werror,-Wunused-private-field]
  const X86TargetMachine &TM;
                          ^
1 error generated.

13 months ago[GlobalIsel][X86] Add handling for G_LOAD/G_SEXTLOAD/G_ZEXTLOAD/G_STORE
Simon Pilgrim [Thu, 15 Jun 2023 12:56:53 +0000 (13:56 +0100)]
[GlobalIsel][X86] Add handling for G_LOAD/G_SEXTLOAD/G_ZEXTLOAD/G_STORE

Replace the legacy legalizer versions and add initial scalar extload handling

13 months ago[AArch64CompressJumpTables] Prevent over-compression caused by invalid alignment.
Paul Walker [Tue, 6 Jun 2023 17:21:16 +0000 (18:21 +0100)]
[AArch64CompressJumpTables] Prevent over-compression caused by invalid alignment.

AArch64CompressJumpTables assumes it can calculate exact block
offsets. This assumption is bogus because getInstSizeInBytes()
only returns an upper bound rather than an exact size. The
assumption is also invalid when a block alignment is bigger than
the function's alignment.

To mitigate both scenarios this patch changes the algorithm to
compute the maximum upper bound for all block offsets. This is
pessimistic but safe because all offsets are treated as unsigned.

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

13 months agoRevert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 12:35:43 +0000 (14:35 +0200)]
Revert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"

This reverts commit d04452d54829cd7af5b43d670325ffa755ab0030 since
test llvm-project/llvm/test/Bitcode/DIImportedEntity_backward.ll is broken.

13 months ago[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 10:22:16 +0000 (12:22 +0200)]
[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)

RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544

Fixed PR51501 (tests from D112337).

1. Reuse of DISubprogram's 'retainedNodes' to track other function-local
   entities together with local variables and labels (this patch cares about
   function-local import while D144006 and D144008 use the same approach for
   local types and static variables). So, effectively this patch moves ownership
   of tracking local import from DICompileUnit's 'imports' field to DISubprogram's
   'retainedNodes' and adjusts DWARF emitter for the new layout. The old layout
   is considered unsupported (DwarfDebug would assert on such debug metadata).

   DICompileUnit's 'imports' field is supposed to track global imported
   declarations as it does before.

   This addresses various FIXMEs and simplifies the next part of the patch.

2. Postpone emission of function-local imported entities from
   `DwarfDebug::endFunctionImpl()` to `DwarfDebug::endModule()`.
   While in `DwarfDebug::endFunctionImpl()` we do not have all the
   information about a parent subprogram or a referring subprogram
   (whether a subprogram inlined or not), so we can't guarantee we emit
   an imported entity correctly and place it in a proper subprogram tree.
   So now, we just gather needed details about the import itself and its
   parent entity (either a Subprogram or a LexicalBlock) during
   processing in `DwarfDebug::endFunctionImpl()`, but all the real work is
   done in `DwarfDebug::endModule()` when we have all the required
   information to make proper emission.

Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com>
Differential Revision: https://reviews.llvm.org/D144004

13 months ago[InstCombine][CGP] Move swapMayExposeCSEOpportunities() fold
Nikita Popov [Fri, 9 Jun 2023 14:21:39 +0000 (16:21 +0200)]
[InstCombine][CGP] Move swapMayExposeCSEOpportunities() fold

InstCombine tries to swap compare operands to match sub instructions
in order to expose "CSE opportunities". However, it doesn't really
make sense to perform this transform in the middle-end, as we cannot
actually CSE the instructions there.

The backend already performs this fold in
https://github.com/llvm/llvm-project/blob/18f5446a45da5a61dbfb1b7667d27fb441ac62db/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp#L4236
on the SDAG level, however this only works within a single basic block.

To handle cross-BB cases, we do need to handle this in the IR layer.
This patch moves the fold from InstCombine to CGP in the backend,
while keeping the same (somewhat dubious) heuristic.

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

13 months ago[OpenMP] Correctly diagnose conflicting target identifierers for AMDGPU
Joseph Huber [Wed, 14 Jun 2023 21:58:11 +0000 (16:58 -0500)]
[OpenMP] Correctly diagnose conflicting target identifierers for AMDGPU

There are static checks on the target identifiers allowed in a single
TU. Previously theses checks were only applied to HIP even though they
should be the same for OpenMP targeting AMDGPU. Simply enable these
checks for OpenMP.

Reviewed By: JonChesterfield, yaxunl

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

13 months ago[libc] Move the definitions of the standard IO streams to the platform
Joseph Huber [Wed, 14 Jun 2023 23:59:29 +0000 (18:59 -0500)]
[libc] Move the definitions of the standard IO streams to the platform

This patch moves the definitions of the standard IO streams to the
platform file definition. This is necessary because previously we had a
level of indirection where the stream's `FILE *` was initialized based
on the pointer to the internal `__llvm_libc` version. This cannot be
resolved ahead of time by the linker because the address will not be
known until runtime. This caused the previous implementation to emit a
global constructor to initialize the pointer to the actual `FILE *`. By
moving these definitions so that we can bind their address to the
original file type we can avoid this global constructor.

This file keeps the entrypoints, but makes them empty files only
containing an external reference. This is so they still appear as
entrypoints and get emitted as declarations in the generated headers.

Reviewed By: lntue, sivachandra

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

13 months ago[GlobalIsel][X86] Add handling for G_FRAME_INDEX/G_GLOBAL_VALUE
Simon Pilgrim [Thu, 15 Jun 2023 11:53:29 +0000 (12:53 +0100)]
[GlobalIsel][X86] Add handling for G_FRAME_INDEX/G_GLOBAL_VALUE

Replace the legacy legalizer versions

13 months agoFix the LLVM Sphinx build
Aaron Ballman [Thu, 15 Jun 2023 11:56:42 +0000 (07:56 -0400)]
Fix the LLVM Sphinx build

This addresses the issue found in:
https://lab.llvm.org/buildbot/#/builders/30/builds/36346

13 months agoNo longer diagnose (functionally) empty structures under -Wuninitialized
Aaron Ballman [Thu, 15 Jun 2023 11:43:31 +0000 (07:43 -0400)]
No longer diagnose (functionally) empty structures under -Wuninitialized

An empty structure in C has no way to be initialized, so triggering a
-Wuninitialized warning for a variable of empty structure type is not
actionable for users. This silences the false positive warning, which
matches the behavior of GCC as well.

We no longer diagnose if the structure has no members, or has only
zero-sized members (unnamed bit-fields, zero-sized bit-fields, empty
structure types).

Fixes: https://github.com/llvm/llvm-project/issues/26842

13 months ago[clang][Interp] Virtual function calls
Timm Bäder [Thu, 26 Jan 2023 15:25:52 +0000 (16:25 +0100)]
[clang][Interp] Virtual function calls

Add a CallVirt opcode and implement virtual function calls this way.

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

13 months agoAMDGPU: Perform basic folds on llvm.amdgcn.exp2
Matt Arsenault [Wed, 14 Jun 2023 12:31:59 +0000 (08:31 -0400)]
AMDGPU: Perform basic folds on llvm.amdgcn.exp2

13 months agoAMDGPU: Add baseline tests for llvm.amdgcn.exp2 folds
Matt Arsenault [Wed, 14 Jun 2023 12:23:26 +0000 (08:23 -0400)]
AMDGPU: Add baseline tests for llvm.amdgcn.exp2 folds

13 months agoAMDGPU: Add llvm.amdgcn.exp2 intrinsic
Matt Arsenault [Wed, 14 Jun 2023 12:07:25 +0000 (08:07 -0400)]
AMDGPU: Add llvm.amdgcn.exp2 intrinsic

Provide direct access to v_exp_f32 and v_exp_f16, so we can start
correctly lowering the generic exp intrinsics.

Unfortunately have to break from the usual naming convention of
matching the instruction name and stripping the v_ prefix. exp is
already taken by the export intrinsic. On the clang builtin side, we
have a choice of maintaining the convention to the instruction name,
or following the intrinsic name.

13 months agoAMDGPU: Add llvm.amdgcn.log to intrinsic documentation
Matt Arsenault [Wed, 14 Jun 2023 12:01:30 +0000 (08:01 -0400)]
AMDGPU: Add llvm.amdgcn.log to intrinsic documentation

13 months agoAMDGPU: Correct semantic bearing typo in intrinsic description
Matt Arsenault [Wed, 14 Jun 2023 11:58:08 +0000 (07:58 -0400)]
AMDGPU: Correct semantic bearing typo in intrinsic description

13 months ago[clang][index] NFCI: Make `CXFile` a `FileEntryRef`
Jan Svoboda [Wed, 31 May 2023 21:53:11 +0000 (14:53 -0700)]
[clang][index] NFCI: Make `CXFile` a `FileEntryRef`

This patch swaps out the `void *` behind `CXFile` from `FileEntry *` to `FileEntryRef::MapEntry *`. This allows us to remove some deprecated uses of `FileEntry::getName()`.

Depends on D151854.

Reviewed By: benlangmuir

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

13 months ago[flang][OpenMP][OpenACC] Support stop statement in OpenMP/OpenACC region
Peixin Qiao [Thu, 15 Jun 2023 09:52:04 +0000 (09:52 +0000)]
[flang][OpenMP][OpenACC] Support stop statement in OpenMP/OpenACC region

[flang][OpenMP][OpenACC] Support stop statement in OpenMP/OpenACC region

This supports lowering of stop statement in OpenMP/OpenACC region.
* OpenMP/OpenACC: Emit `fir.unreachable` only if the block is not
  terminated by any terminator. This avoids knocking off an existing
  OpenMP/OpenACC terminator.
* OpenMP: Emit the OpenMP terminator instead of `fir.unreachable` since
  OpenMP regions can only be terminated by OpenMP terminators. This is
  currently skipped for OpenACC since unstructured code is not yet
  handled specially in OpenACC lowering.

Fixes #60737
Fixes #61877

Co-authored-by: Kiran Chandramohan <kiranchandramohan@gmail.com>
Co-authored-by: Val Donaldson <vdonaldson@nvidia.com>
Reviewed By: vdonaldson, peixin

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

13 months ago[mlir][test] Drop op type from test passes in TestPatterns.cpp
Matthias Springer [Thu, 15 Jun 2023 09:30:03 +0000 (11:30 +0200)]
[mlir][test] Drop op type from test passes in TestPatterns.cpp

When possible, use `OperationPass<>` instead of `OperationPass<ModuleOp>` or `OperationPass<FuncOp>`.

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

13 months ago[clang] Deprecate `DirectoryEntry::getName()`
Jan Svoboda [Thu, 15 Jun 2023 09:22:48 +0000 (11:22 +0200)]
[clang] Deprecate `DirectoryEntry::getName()`

This finally officially deprecates `DirectoryEntry::getName()`. I checked no usages remain in targets built by any of `check-clang`, `check-clang-tools`, `check-clang-extra`. There are probably some remaining usages in places like LLDB and other clients. This will give them a chance to transition to `DirectoryEntryRef::getName()` before we remove the function altogether.

Depends on D151922.

Reviewed By: benlangmuir

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

13 months ago[LSR] Move new test to X86 subdir.
Florian Hahn [Thu, 15 Jun 2023 10:11:05 +0000 (11:11 +0100)]
[LSR] Move new test to X86 subdir.

The test added in 1665cb06307 requires the X86 backend, so move it to
the X86 subdirectory.

13 months ago[AMDGPU][AsmParser][NFC] Simplify v_interp-related operand definitions.
Ivan Kosarev [Thu, 15 Jun 2023 10:04:52 +0000 (11:04 +0100)]
[AMDGPU][AsmParser][NFC] Simplify v_interp-related operand definitions.

Part of <https://github.com/llvm/llvm-project/issues/62629>.

Reviewed By: arsenm

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

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 9.
Ivan Kosarev [Thu, 15 Jun 2023 09:56:56 +0000 (10:56 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 9.

Reviewed By: arsenm

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

13 months ago[lldb] Fix build error after 7bca6f45
Jan Svoboda [Thu, 15 Jun 2023 09:59:31 +0000 (11:59 +0200)]
[lldb] Fix build error after 7bca6f45

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 8.
Ivan Kosarev [Thu, 15 Jun 2023 09:47:00 +0000 (10:47 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 8.

Reviewed By: Joe_Nash

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

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 7.
Ivan Kosarev [Thu, 15 Jun 2023 09:40:53 +0000 (10:40 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 7.

Reviewed By: Joe_Nash

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

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 6.
Ivan Kosarev [Thu, 15 Jun 2023 09:34:19 +0000 (10:34 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 6.

Reviewed By: Joe_Nash

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

13 months ago[X86] Add test for icmp/sub operand order across blocks (NFC)
Nikita Popov [Thu, 15 Jun 2023 09:34:01 +0000 (11:34 +0200)]
[X86] Add test for icmp/sub operand order across blocks (NFC)

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 5.
Ivan Kosarev [Thu, 15 Jun 2023 09:28:10 +0000 (10:28 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 5.

Reviewed By: Joe_Nash

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

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 4.
Ivan Kosarev [Thu, 15 Jun 2023 09:09:07 +0000 (10:09 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 4.

Reviewed By: arsenm

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

13 months ago[clang] NFC: Use `DirectoryEntryRef` in `FileManager::getCanonicalName()`
Jan Svoboda [Thu, 15 Jun 2023 09:09:02 +0000 (11:09 +0200)]
[clang] NFC: Use `DirectoryEntryRef` in `FileManager::getCanonicalName()`

This patch removes the last use of deprecated `DirectoryEntry::getName()`.

Depends on D151855.

Reviewed By: benlangmuir

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

13 months ago[clang] Use `{File,Directory}EntryRef` in modular header search (part 2/2)
Jan Svoboda [Thu, 15 Jun 2023 08:47:27 +0000 (10:47 +0200)]
[clang] Use `{File,Directory}EntryRef` in modular header search (part 2/2)

This patch removes some deprecated uses of `{File,Directory}Entry::getName()`. No functional change intended.

Depends on D151854.

Reviewed By: benlangmuir

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

13 months ago[mlir][Interfaces] Symbols are not trivially dead
Matthias Springer [Thu, 15 Jun 2023 09:15:07 +0000 (11:15 +0200)]
[mlir][Interfaces] Symbols are not trivially dead

The greedy pattern rewrite driver removes ops that are "trivially dead". This could include symbols that are still referenced by other ops. Dead symbols should be removed with the `-symbol-dce` pass instead.

This bug was not triggered for `func::FuncOp`, because ops are not considered "trivally dead" if they do not implement the `MemoryEffectOpInterface`, indicating that the op may or may not have side effects. It is, however, triggered for `transform::NamedSequenceOp`, which implements that interface because it is required for all transform dialect ops.

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

13 months ago[GlobalIsel][X86] Add handling for G_CONCAT_VECTORS
Simon Pilgrim [Thu, 15 Jun 2023 09:17:04 +0000 (10:17 +0100)]
[GlobalIsel][X86] Add handling for G_CONCAT_VECTORS

Replace the legacy legalizer versions - interestingly the only concat_vectors isel patterns we currently have are for AVX512 predicate masks, which gisel doesn't handle at all yet.

13 months ago[LSR] Add test cases showing bad handling of extends of post-inc uses.
Florian Hahn [Thu, 15 Jun 2023 09:15:12 +0000 (10:15 +0100)]
[LSR] Add test cases showing bad handling of extends of post-inc uses.

Tests from #38847, #62852.

13 months ago[BOLT] Move from RuntimeDyld to JITLink
Job Noorman [Thu, 15 Jun 2023 08:52:11 +0000 (10:52 +0200)]
[BOLT] Move from RuntimeDyld to JITLink

RuntimeDyld has been deprecated in favor of JITLink. [1] This patch
replaces all uses of RuntimeDyld in BOLT with JITLink.

Care has been taken to minimize the impact on the code structure in
order to ease the inspection of this (rather large) changeset. Since
BOLT relied on the RuntimeDyld API in multiple places, this wasn't
always possible though and I'll explain the changes in code structure
first.

Design note: BOLT uses a JIT linker to perform what essentially is
static linking. No linked code is ever executed; the result of linking
is simply written back to an executable file. For this reason, I
restricted myself to the use of the core JITLink library and avoided ORC
as much as possible.

RuntimeDyld contains methods for loading objects (loadObject) and symbol
lookup (getSymbol). Since JITLink doesn't provide a class with a similar
interface, the BOLTLinker abstract class was added to implement it. It
was added to Core since both the Rewrite and RuntimeLibs libraries make
use of it. Wherever a RuntimeDyld object was used before, it was
replaced with a BOLTLinker object.

There is one major difference between the RuntimeDyld and BOLTLinker
interfaces: in JITLink, section allocation and the application of fixups
(relocation) happens in a single call (jitlink::link). That is, there is
no separate method like finalizeWithMemoryManagerLocking in RuntimeDyld.
BOLT used to remap sections between allocating (loadObject) and linking
them (finalizeWithMemoryManagerLocking). This doesn't work anymore with
JITLink. Instead, BOLTLinker::loadObject accepts a callback that is
called before fixups are applied which is used to remap sections.

The actual implementation of the BOLTLinker interface lives in the
JITLinkLinker class in the Rewrite library. It's the only part of the
BOLT code that should directly interact with the JITLink API.

For loading object, JITLinkLinker first creates a LinkGraph
(jitlink::createLinkGraphFromObject) and then links it (jitlink::link).
For the latter, it uses a custom JITLinkContext with the following
properties:
- Use BOLT's ExecutableFileMemoryManager. This one was updated to
  implement the JITLinkMemoryManager interface. Since BOLT never
  executes code, its finalization step is a no-op.
- Pass config: don't use the default target passes since they modify
  DWARF sections in a way that seems incompatible with BOLT. Also run a
  custom pre-prune pass that makes sure sections without symbols are not
  pruned by JITLink.
- Implement symbol lookup. This used to be implemented by
  BOLTSymbolResolver.
- Call the section mapper callback before the final linking step.
- Copy symbol values when the LinkGraph is resolved. Symbols are stored
  inside JITLinkLinker to ensure that later objects (i.e.,
  instrumentation libraries) can find them. This functionality used to
  be provided by RuntimeDyld but I did not find a way to use JITLink
  directly for this.

Some more minor points of interest:
- BinarySection::SectionID: JITLink doesn't have something equivalent to
  RuntimeDyld's Section IDs. Instead, sections can only be referred to
  by name. Hence, SectionID was updated to a string.
- There seem to be no tests for Mach-O. I've tested a small hello-world
  style binary but not more than that.
- On Mach-O, JITLink "normalizes" section names to include the segment
  name. I had to parse the section name back from this manually which
  feels slightly hacky.

[1] https://reviews.llvm.org/D145686#4222642

Reviewed By: rafauler

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

13 months ago[mlir][Vector] Add pattern to reorder elementwise and broadcast ops
Andrzej Warzynski [Fri, 2 Jun 2023 14:32:12 +0000 (15:32 +0100)]
[mlir][Vector] Add pattern to reorder elementwise and broadcast ops

The new pattern will replace elementwise(broadcast) with
broadcast(elementwise) when safe.

This change affects tests for vectorising nD-extract. In one case
("vectorize_nd_tensor_extract_with_tensor_extract") I just trimmed the
test and only preserved the key parts (scalar and contiguous load from
the original Op). We could do the same with some other tests if that
helps maintainability.

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

13 months ago[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 3.
Ivan Kosarev [Thu, 15 Jun 2023 08:41:32 +0000 (09:41 +0100)]
[AMDGPU][GFX11] Add test coverage for 16-bit conversions, part 3.

Reviewed By: Joe_Nash

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

13 months ago[DAGCombiner] Fix crash when trying to replace an indexed store with a narrow store.
Amara Emerson [Wed, 14 Jun 2023 22:42:43 +0000 (15:42 -0700)]
[DAGCombiner] Fix crash when trying to replace an indexed store with a narrow store.

rdar://108818859

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