Changes

Summary

  1. [mlir][sparse] Factoring out helper functions for generating constants (details)
  2. [mlir][sparse] Misc code cleanup (details)
  3. [ORC] Add a missing definition. (details)
  4. [ORC] Use a Setup object for SimpleRemoteEPC construction. (details)
  5. [llvm-profgen] Ignore stack samples before aggregation (details)
  6. [llvm-profgen] Ignore the whole trace with the leading external branch (details)
  7. [examples] Fix LLJITWithRemoteDebugging example after 4fcc0ac15e0. (details)
  8. [mlir] Ability to build CAPI dylibs from out of tree projects against installed LLVM. (details)
  9. [RISCV][test] Add more tests of immediate materialisation (details)
  10. [RISCV] Optimize immediate materialisation with SLLI.UW (details)
  11. docs: Document workaround for arcanist failures (details)
  12. [AMDGPU] Fix 24-bit mul intrinsic generation for > 32-bit result. (details)
  13. [clang] Use llvm::is_contained (NFC) (details)
Commit 63d4fc9483774a3b10101bc6a6de9dce1d8bdca2 by 2998727+wrengr
[mlir][sparse] Factoring out helper functions for generating constants

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D111763
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
Commit 5167c36ab41c09703e0811bc982c0cdac2900320 by 2998727+wrengr
[mlir][sparse] Misc code cleanup

Depends On D111763

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D111766
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
Commit 8d2736d9ddc3f2390b28ec1ce31db14edf799e36 by Lang Hames
[ORC] Add a missing definition.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
Commit 4fcc0ac15e056777012a7c62d35f825227a0b7e7 by Lang Hames
[ORC] Use a Setup object for SimpleRemoteEPC construction.

SimpleRemoteEPC notionally allowed subclasses to override the
createMemoryManager and createMemoryAccess methods to use custom objects, but
could not actually be subclassed in practice (The construction process in
SimpleRemoteEPC::Create could not be re-used).

Instead of subclassing, this commit adds a SimpleRemoteEPC::Setup class that
can be used by clients to set up the memory manager and memory access members.
A default-constructed Setup object results in no change from previous behavior
(EPCGeneric* memory manager and memory access objects used by default).
The file was modifiedllvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
The file was modifiedllvm/tools/lli/lli.cpp
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp
Commit ab5d65e6858b25fc07672a0bd2d07f666bde6b51 by wlei
[llvm-profgen] Ignore stack samples before aggregation

With `ignore-stack-samples`, We can ignore the call stack before the samples aggregation which could reduce some redundant computations.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D111577
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
Commit 30ca33eab00b8c815ef95fbb3a14e61dc3278b5b by wlei
[llvm-profgen] Ignore the whole trace with the leading external branch

The first LBR entry can be an external branch, we should ignore the whole trace.

```
     7f7448e889e4 0x7f7448e889e4/0x7f7448e88826/P/-/-/1  0x7f7448e8899f/0x7f7448e889d8/P/-/-/4  ...
```

Reviewed By: wenlei, hoy

Differential Revision: https://reviews.llvm.org/D111749
The file was modifiedllvm/test/tools/llvm-profgen/inline-noprobe2.test
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
The file was addedllvm/test/tools/llvm-profgen/Inputs/artificial-branch.perfscript
Commit abdb82b237ebf42572c5730a2265bfc98fc8b0c4 by Lang Hames
[examples] Fix LLJITWithRemoteDebugging example after 4fcc0ac15e0.
The file was modifiedllvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/RemoteJITUtils.cpp
Commit fe6d9937b3846debfb2d97a32416064dc6c806e9 by stellaraccident
[mlir] Ability to build CAPI dylibs from out of tree projects against installed LLVM.

* Incorporates a reworked version of D106419 (which I have closed but has comments on it).
* Extends the standalone example to include a minimal CAPI (for registering its dialect) and a test which, from out of tree, creates an aggregate dylib and links a little sample program against it. This will likely only work today in *static* MLIR builds (until the TypeID fiasco is finally put to bed). It should work on all platforms, though (including Windows - albeit I haven't tried this exact incarnation there).
* This is the biggest pre-requisite to being able to build out of tree MLIR Python-based projects from an installed MLIR/LLVM.
* I am rather nauseated by the CMake shenanigans I had to endure to get this working. The primary complexity, above and beyond the previous patch is because (with no reason given), it is impossible to export target properties that contain generator expressions... because, of course it isn't. In this case, the primary reason we use generator expressions on the individual embedded libraries is to support arbitrary ordering. Since that need doesn't apply to out of tree (which import everything via FindPackage at the outset), we fall back to a more imperative way of doing the same thing if we detect that the target was imported. Gross, but I don't expect it to need a lot of maintenance.
* There should be a relatively straight-forward path from here to rebase libMLIR.so on top of this facility and also make it include the CAPI.

Differential Revision: https://reviews.llvm.org/D111504
The file was addedmlir/examples/standalone/lib/CAPI/Dialects.cpp
The file was modifiedmlir/cmake/modules/AddMLIRPython.cmake
The file was modifiedmlir/examples/standalone/lib/CMakeLists.txt
The file was addedmlir/examples/standalone/.gitignore
The file was addedmlir/examples/standalone/include/Standalone-c/Dialects.h
The file was modifiedmlir/examples/standalone/test/lit.cfg.py
The file was modifiedmlir/test/Examples/standalone/test.toy
The file was addedmlir/examples/standalone/test/CAPI/CMakeLists.txt
The file was addedmlir/examples/standalone/test/CAPI/standalone-capi-test.c
The file was addedmlir/examples/standalone/test/CAPI/lit.local.cfg
The file was modifiedmlir/examples/standalone/test/CMakeLists.txt
The file was addedmlir/examples/standalone/lib/CAPI/CMakeLists.txt
The file was modifiedmlir/cmake/modules/AddMLIR.cmake
Commit c1d6ba54d360c953f926ea6df547b1ba0dbcdc44 by powerman1st
[RISCV][test] Add more tests of immediate materialisation

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D111704
The file was modifiedllvm/test/MC/RISCV/rv64zba-aliases-valid.s
The file was modifiedllvm/test/CodeGen/RISCV/imm.ll
Commit 481db13fec3d112a23861759247d846f120c6c8b by powerman1st
[RISCV] Optimize immediate materialisation with SLLI.UW

Use LUI+SLLI.UW to compose the upper bits instead of LUI+SLLI.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D111705
The file was modifiedllvm/test/MC/RISCV/rv64zba-aliases-valid.s
The file was modifiedllvm/test/CodeGen/RISCV/imm.ll
The file was modifiedllvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
Commit 509fe20fbca767a65b9c27750ea9d372ed2ab05a by joker.eph
docs: Document workaround for arcanist failures

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D110976
The file was modifiedllvm/docs/GettingStarted.rst
Commit b3c9d84e5a8ef49e33b20e1ea9608c5c9b935591 by abinav.puthanpurayil
[AMDGPU] Fix 24-bit mul intrinsic generation for > 32-bit result.

The 24-bit mul intrinsics yields the low-order 32 bits. We should only
do the transformation if the operands are known to be not wider than 24
bits and the result is known to be not wider than 32 bits.

Differential Revision: https://reviews.llvm.org/D111523
The file was modifiedllvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-mul24.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
Commit e567f37dabc242cb02fb8b8b288fd05a0aebfb8f by kazu
[clang] Use llvm::is_contained (NFC)
The file was modifiedclang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
The file was modifiedclang/lib/Edit/EditedSource.cpp
The file was modifiedclang/lib/Lex/PPDirectives.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
The file was modifiedclang/lib/Format/QualifierAlignmentFixer.cpp
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was modifiedclang/lib/Parse/ParseTentative.cpp
The file was modifiedclang/lib/Lex/ModuleMap.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
The file was modifiedclang/lib/ARCMigrate/ARCMT.cpp
The file was modifiedclang/lib/Lex/Preprocessor.cpp
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
The file was modifiedclang/lib/Lex/PPMacroExpansion.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporter.cpp
The file was modifiedclang/tools/libclang/CIndexHigh.cpp