Changes

Summary

  1. [GlobalISel] Describe undefined values for G_SBFX/G_UBFX operands (details)
  2. [lldb][AArch64] Add class for managing memory tags (details)
  3. [mlir][linalg][python] Add shape-only tensor support to OpDSL. (details)
  4. [gn build] Remove an unneeded -I flag (details)
  5. [lldb][AArch64] Add memory-tagging qSupported feature (details)
  6. Add documentation for compound assignment and type conversion of matrix types (details)
  7. [lldb][AArch64] Fix unpack tags test case (details)
  8. [AArch64] Precommit extending load tests for D104782. NFC. (details)
  9. [mlir][Linalg] Add support for scf::ForOp in comprehensive bufferization (7/n) (details)
  10. [gn build] Fix a comment typo and a comment copy-pasto (details)
  11. [VPlan] Fix indentation of check lines in sinking test (NFC). (details)
  12. [lldb][AArch64] Add memory tag reading to lldb-server (details)
  13. [MLIR][LLVM] Expose type translator from LLVM to MLIR Type (details)
  14. [LLD][LLVM] CG Graph profile using relocations (details)
  15. [lldb][AArch64] Add MTE memory tag reading to lldb (details)
  16. [mlir] remove repeated use of TypeToLLVM.cpp in cmake targets (details)
  17. [lldb][AArch64] Add "memory tag read" command (details)
  18. Update Bazel build for 929189a499 (details)
  19. [AsmParser][SystemZ][z/OS] Support for emitting labels in upper case (details)
Commit 927b80978345457480ce68eb84d87a5f80d34bc7 by brendon.cahoon
[GlobalISel] Describe undefined values for G_SBFX/G_UBFX operands

Differential Revision: https://reviews.llvm.org/D104245
The file was modifiedllvm/docs/GlobalISel/GenericOpcode.rst
The file was modifiedllvm/include/llvm/Target/GenericOpcodes.td
Commit e0f2744a115c41e8d295b93dd74b39535c852390 by david.spickett
[lldb][AArch64] Add class for managing memory tags

This adds the MemoryTagManager class and a specialisation
of that class for AArch64 MTE tags. It provides a generic
interface for various tagging operations.
Adding/removing tags, diffing tagged pointers, etc.

Later patches will use this manager to handle memory tags
in generic code in both lldb and lldb-server.
Since it will be used in both, the base class header is in
lldb/Target.
(MemoryRegionInfo is another example of this pattern)

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D97281
The file was addedlldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h
The file was modifiedlldb/source/Plugins/Process/Utility/CMakeLists.txt
The file was addedlldb/include/lldb/Target/MemoryTagManager.h
The file was modifiedlldb/unittests/Process/Utility/CMakeLists.txt
The file was addedlldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp
The file was addedlldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
Commit 78dc1e497807e6b857fde7f78f4bc9cb5a4f8939 by gysit
[mlir][linalg][python] Add shape-only tensor support to OpDSL.

Add an index_dim annotation to specify the shape to loop mapping of shape-only tensors. A shape-only tensor serves is not accessed withing the body of the operation but is required to span the iteration space of certain operations such as pooling.

Differential Revision: https://reviews.llvm.org/D104767
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
The file was modifiedmlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
The file was modifiedmlir/test/python/dialects/linalg/opsrun.py
The file was modifiedmlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/config.py
The file was modifiedmlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
Commit d57a5879ab6781a58020d3a878c617266d939e51 by thakis
[gn build] Remove an unneeded -I flag

Everything includes clang/Config/config.h by qualified "clang/Config/config.h"
path, so there's no need for `-Igen/clang/include/clang/Config/clang/include`.

No behavior change.
The file was modifiedllvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn
Commit 8d58fbd09efb443d92842a0d101348cda06d7253 by david.spickett
[lldb][AArch64] Add memory-tagging qSupported feature

This feature "memory-tagging+" indicates that lldb-server
supports memory tagging packets. (added in a later patch)

We check HWCAP2_MTE to decide whether to enable this
feature for Linux.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D97282
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
The file was modifiedlldb/include/lldb/Target/Process.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
The file was modifiedlldb/include/lldb/Host/common/NativeProcessProtocol.h
The file was modifiedlldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
The file was modifiedlldb/test/API/tools/lldb-server/TestLldbGdbServer.py
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
Commit cd256c8bcc9723f0ce7a32957f26600c966fa07c by saurabh.jhaa
Add documentation for compound assignment and type conversion of matrix types
The file was modifiedclang/docs/LanguageExtensions.rst
Commit cc05418d98f3d232cc66f9065262200eaa4a14db by david.spickett
[lldb][AArch64] Fix unpack tags test case

Use %zu to print size_t vars.
The file was modifiedlldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
Commit c74aea46634347e2ad20111271faebec2da38af3 by sjoerd.meijer
[AArch64] Precommit extending load tests for D104782. NFC.
The file was addedllvm/test/CodeGen/AArch64/neon-extload.ll
The file was addedllvm/test/CodeGen/AArch64/neon-truncstore.ll
The file was removedllvm/test/CodeGen/AArch64/neon-truncStore-extLoad.ll
Commit 57fe7fd37dcd1f144f600976b3f33d5d792e89fd by nicolas.vasilache
[mlir][Linalg] Add support for scf::ForOp in comprehensive bufferization (7/n)

scf::ForOp bufferization analysis proceeds just like for any other op (including FuncOp) at its boundaries; i.e. if:

1. The tensor operand is inplaceable.
2. The matching result has no subsequent read (i.e. all reads dominate the scf::ForOp).
3. In  and does not create a RAW interference.

then it can bufferize inplace.

Still there are a few differences:

1. bbArgs for an scf::ForOp are always considered inplaceable when seen from ops inside the body. This is because a) either the matching tensor operand is not inplaceable and an alloc will be inserted (which makes bbArg itself inplaceable); or b) the tensor operand and bbArg are both already inplaceable.
2. Bufferization within the scf::ForOp body has implications to the outside world : the scf.yield terminator may well ping-pong values of the same type. This muddies the water for alias analysis and is not supported atm. Such cases result in a pass failure.

Differential revision: https://reviews.llvm.org/D104490
The file was modifiedmlir/include/mlir/Dialect/SCF/SCFOps.td
The file was addedmlir/test/Dialect/Linalg/comprehensive-func-bufferize-analysis-invalid.mlir
The file was modifiedmlir/test/Dialect/Linalg/comprehensive-func-bufferize.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
The file was modifiedmlir/test/Dialect/Linalg/comprehensive-func-bufferize-analysis.mlir
Commit b1061e36d9833d9a712579e29a318732df0b744c by thakis
[gn build] Fix a comment typo and a comment copy-pasto
The file was modifiedllvm/utils/gn/secondary/clang/utils/TableGen/clang_tablegen.gni
Commit f6ba845da3f89ca1f9591d42ae48f6fb29079096 by flo
[VPlan] Fix indentation of check lines in sinking test (NFC).
The file was modifiedllvm/test/Transforms/LoopVectorize/first-order-recurrence-sink-replicate-region.ll
Commit da2e614f56b196b37175e2babfac8ed7b43ab624 by david.spickett
[lldb][AArch64] Add memory tag reading to lldb-server

This adds memory tag reading using the new "qMemTags"
packet and ptrace on AArch64 Linux.

This new packet is following the one used by GDB.
(https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html)

On AArch64 Linux we use ptrace's PEEKMTETAGS to read
tags and we assume that lldb has already checked that the
memory region actually has tagging enabled.

We do not assume that lldb has expanded the requested range
to granules and expand it again to be sure.
(although lldb will be sending aligned ranges because it happens
to need them client side anyway)
Also we don't assume untagged addresses. So for AArch64 we'll
remove the top byte before using them. (the top byte includes
MTE and other non address data)

To do the ptrace read NativeProcessLinux will ask the native
register context for a memory tag manager based on the
type in the packet. This also gives you the ptrace numbers you need.
(it's called a register context but it also has non register data,
so it saves adding another per platform sub class)

The only supported platform for this is AArch64 Linux and the only
supported tag type is MTE allocation tags. Anything else will
error.

Ptrace can return a partial result but for lldb-server we will
be treating that as an error. To succeed we need to get all the tags
we expect.

(Note that the protocol leaves room for logical tags to be
read via qMemTags but this is not going to be implemented for lldb
at this time.)

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D95601
The file was modifiedlldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
The file was modifiedlldb/source/Utility/StringExtractorGDBRemote.cpp
The file was addedlldb/test/API/tools/lldb-server/memory-tagging/main.c
The file was modifiedlldb/include/lldb/Utility/StringExtractorGDBRemote.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
The file was addedlldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py
The file was modifiedlldb/include/lldb/Host/linux/Ptrace.h
The file was addedlldb/test/API/tools/lldb-server/memory-tagging/Makefile
The file was modifiedlldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
The file was modifiedlldb/include/lldb/Host/common/NativeProcessProtocol.h
The file was modifiedlldb/source/Host/common/NativeProcessProtocol.cpp
The file was modifiedlldb/source/Plugins/Process/Linux/NativeProcessLinux.h
Commit 929189a4995ece3162adced7a7d9be8e17dc4079 by gh
[MLIR][LLVM] Expose type translator from LLVM to MLIR Type

This commit moves the type translator from LLVM to MLIR to a public header for use by external projects or other code.

Unlike a previous attempt (https://reviews.llvm.org/D104726), this patch moves the type conversion into separate files which remedies the linker error which was only caught by CI.

Differential Revision: https://reviews.llvm.org/D104834
The file was addedmlir/lib/Target/LLVMIR/TypeFromLLVM.cpp
The file was removedmlir/lib/Target/LLVMIR/TypeTranslation.cpp
The file was modifiedmlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
The file was addedmlir/lib/Target/LLVMIR/TypeToLLVM.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was addedmlir/include/mlir/Target/LLVMIR/TypeToLLVM.h
The file was addedmlir/include/mlir/Target/LLVMIR/TypeFromLLVM.h
The file was modifiedmlir/lib/Target/LLVMIR/CMakeLists.txt
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
The file was removedmlir/include/mlir/Target/LLVMIR/TypeTranslation.h
Commit a224c5199b327ed0efcdcd87b6dbf950cf4d9ee1 by aktoon
[LLD][LLVM] CG Graph profile using relocations

Currently when .llvm.call-graph-profile is created by llvm it explicitly encodes the symbol indices. This section is basically a black box for post processing tools. For example, if we run strip -s on the object files the symbol table changes, but indices in that section do not. In non-visible behavior indices point to wrong symbols. The visible behavior indices point outside of Symbol table: "invalid symbol index".

This patch changes the format by using R_*_NONE relocations to indicate the from/to symbols. The Frequency (Weight) will still be in the .llvm.call-graph-profile, but symbol information will be in relocation section. In LLD information from both sections is used to reconstruct call graph profile. Relocations themselves will never be applied.

With this approach post processing tools that handle relocations correctly work for this section also. Tools can add/remove symbols and as long as they handle relocation sections with this approach information stays correct.

Doing a quick experiment with clang-13.
The size went up from 107KB to 322KB, aggregate of all the input sections. Size of clang-13 binary is ~118MB. For users of -fprofile-use/-fprofile-sample-use the size of object files will go up slightly, it will not impact final binary size.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D104080
The file was modifiedllvm/test/MC/ELF/cgprofile.s
The file was modifiedllvm/test/tools/llvm-readobj/ELF/call-graph-profile.test
The file was modifiedllvm/lib/MC/MCELFStreamer.cpp
The file was modifiedllvm/lib/ObjectYAML/ELFYAML.cpp
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
The file was modifiedllvm/test/tools/yaml2obj/ELF/call-graph-profile-section.yaml
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedlld/ELF/InputFiles.cpp
The file was modifiedllvm/include/llvm/ObjectYAML/ELFYAML.h
The file was modifiedllvm/lib/MC/ELFObjectWriter.cpp
The file was modifiedllvm/test/tools/yaml2obj/ELF/section-headers-exclude.yaml
The file was modifiedlld/ELF/InputFiles.h
The file was modifiedlld/ELF/Driver.cpp
The file was modifiedllvm/include/llvm/Object/ELFTypes.h
The file was modifiedllvm/include/llvm/BinaryFormat/ELF.h
The file was modifiedllvm/lib/ObjectYAML/ELFEmitter.cpp
The file was modifiedllvm/test/Object/multiple-sections.yaml
The file was modifiedllvm/test/tools/obj2yaml/ELF/call-graph-profile-section.yaml
The file was modifiedllvm/include/llvm/MC/MCELFStreamer.h
The file was modifiedllvm/test/tools/llvm-readobj/ELF/demangle.test
Commit 5d3436200147a999670f754288a03c4ac5a15aeb by david.spickett
[lldb][AArch64] Add MTE memory tag reading to lldb

This adds GDB client support for the qMemTags packet
which reads memory tags. Following the design
which was recently committed to GDB.

https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets
(look for qMemTags)

lldb commands will use the new Process methods
GetMemoryTagManager and ReadMemoryTags.

The former takes a range and checks that:
* The current process architecture has an architecture plugin
* That plugin provides a MemoryTagManager
* That the range of memory requested lies in a tagged range
  (it will expand it to granules for you)

If all that was true you get a MemoryTagManager you
can give to ReadMemoryTags.

This two step process is done to allow commands to get the
tag manager without having to read tags as well. For example
you might just want to remove a logical tag, or error early
if a range with tagged addresses is inverted.

Note that getting a MemoryTagManager doesn't mean that the process
or a specific memory range is tagged. Those are seperate checks.
Having a tag manager just means this architecture *could* have
a tagging feature enabled.

An architecture plugin has been added for AArch64 which
will return a MemoryTagManagerAArch64MTE, which was added in a
previous patch.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D95602
The file was addedlldb/source/Plugins/Architecture/AArch64/CMakeLists.txt
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
The file was addedlldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.cpp
The file was modifiedlldb/source/Target/Process.cpp
The file was addedlldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.h
The file was modifiedlldb/source/Plugins/Architecture/CMakeLists.txt
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
The file was modifiedlldb/include/lldb/Target/Process.h
The file was modifiedlldb/include/lldb/Core/Architecture.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
The file was modifiedlldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
Commit 10b8eb482cb6dcc4a1c095a2bf1ddd8b85c41571 by zinenko
[mlir] remove repeated use of TypeToLLVM.cpp in cmake targets
The file was modifiedmlir/lib/Target/LLVMIR/CMakeLists.txt
Commit 31f9960c38529ce805edf9764535eb0ce188cadf by david.spickett
[lldb][AArch64] Add "memory tag read" command

This new command looks much like "memory read"
and mirrors its basic behaviour.

(lldb) memory tag read new_buf_ptr new_buf_ptr+32
Logical tag: 0x9
Allocation tags:
[0x900fffff7ffa000, 0x900fffff7ffa010): 0x9
[0x900fffff7ffa010, 0x900fffff7ffa020): 0x0

Important proprties:
* The end address is optional and defaults to reading
  1 tag if ommitted
* It is an error to try to read tags if the architecture
  or process doesn't support it, or if the range asked
  for is not tagged.
* It is an error to read an inverted range (end < begin)
  (logical tags are removed for this check so you can
  pass tagged addresses here)
* The range will be expanded to fit the tagging granule,
  so you can get more tags than simply (end-begin)/granule size.
  Whatever you get back will always cover the original range.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D97285
The file was addedlldb/test/API/linux/aarch64/mte_tag_read/TestAArch64LinuxMTEMemoryTagRead.py
The file was addedlldb/source/Commands/CommandObjectMemoryTag.h
The file was addedlldb/test/API/functionalities/memory/tag/TestMemoryTag.py
The file was addedlldb/source/Commands/CommandObjectMemoryTag.cpp
The file was addedlldb/test/API/functionalities/memory/tag/Makefile
The file was addedlldb/test/API/functionalities/memory/tag/main.cpp
The file was modifiedlldb/source/Commands/CMakeLists.txt
The file was modifiedlldb/source/Commands/CommandObjectMemory.cpp
The file was addedlldb/test/API/linux/aarch64/mte_tag_read/Makefile
The file was addedlldb/test/API/linux/aarch64/mte_tag_read/main.c
Commit 1ca4cf9b242b627a2414c377214998d180d4dcf6 by gcmn
Update Bazel build for 929189a499

Updates Bazel build files to match
https://github.com/llvm/llvm-project/commit/929189a499

Differential Revision: https://reviews.llvm.org/D104864
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
Commit 631362665c3b3271736fee070f6b553c099250d8 by anirudh_prasad
[AsmParser][SystemZ][z/OS] Support for emitting labels in upper case

- Currently, the emitting of labels in the parsePrimaryExpr function is case independent. It just takes the identifier and emits it.
- However, for HLASM the emitting of labels is case independent. We are emitting them in the upper case only, to enforce case independency. So we need to ensure that at the time of parsing the label we are emitting the upper case (in `parseAsHLASMLabel`), but also, when we are processing a PC-relative relocatable expression, we need to ensure we emit it in upper case (in `parsePrimaryExpr`)
- To achieve this a new MCAsmInfo attribute has been introduced which corresponding targets can override if needed.

Reviewed By: abhina.sreeskantharajan, uweigand

Differential Revision: https://reviews.llvm.org/D104715
The file was modifiedllvm/lib/MC/MCParser/AsmParser.cpp
The file was modifiedllvm/include/llvm/MC/MCAsmInfo.h
The file was modifiedllvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
The file was modifiedllvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp