[mlir-tblgen] Render enum keyword alternatives in generated attr/type docs
When mlir-tblgen generates documentation for AttrDefs/TypeDefs that have
EnumParameter fields, it previously rendered the raw C++ type (e.g.
`::mlir::ns::MyEnum`) in the syntax block. This was unhelpful for
users who need to know the valid keyword values.
This patch:
1. Adds an `EnumInfo enum = enumInfo;` field to the `EnumParameter`
TableGen class, persisting the enum record for tooling to inspect.
2. Modifies `emitAttrOrTypeDefAssemblyFormat` in OpDocGen.cpp to detect
EnumParameter fields and render their cases as backtick-quoted
alternatives (e.g. `` `read` | `read_write` ``).
3. Adds a test case to gen-dialect-doc.td verifying the new behavior.
Before:
#my_dialect.my_attr<
int32_t, # index
::mlir::ns::MyEnum, # access
[9 lines not shown]
[orc-rt] Add ORC_RT_C_NOTHROW and apply it to the Error C API. (#203674)
Adds an ORC_RT_C_NOTHROW macro that expands to `noexcept` in C++ mode,
and `__attribute__((nothrow))` where that attribute is supported.
Also applies the new ORC_RT_C_NOTHROW macro to orc-rt-c/Error.h (and
adds `noexcept` to the corresponding C++ implementation in
lib/executor/Error.cpp).
[CIR][OpenCL] Lower kernel argument metadata to LLVM IR
Translate CIR OpenCL kernel argument metadata into the LLVM IR kernel_arg_* metadata attached to kernel functions. Preserve optional argument names so -cl-kernel-arg-info controls the LLVM metadata surface through the CIR attribute.
[orc-rt] Merge ExternC.h and Visibility.h into Compiler.h. (#203673)
This mirrors the combined orc-rt/Compiler.h header on the C++ side, and
provides a natural home for future decoration macros when they're added.
[CIR][OpenCL] Attach kernel argument metadata to CIR functions
Emit the CIR OpenCL kernel argument metadata attribute for kernel functions. Preserve CIR language address-space kinds until lowering and include argument names only when `-cl-kernel-arg-info` is enabled.
[AMDGPU] Enabled GCN trackers (amdgpu-use-amdgpu-trackers) by default.
The LIT tests have been generally updated in one of the following ways:
(1) If the above option was not present and the test was auto-generated,
the test has now been auto-generated.
(2) If the above option was not present and the test was not
auto-generated, added the option -amdgpu-use-amdgpu-trackers=0 so as to
preserve any specific attributes the test was already checking.
(3) If the above option was present in a test, then its value has been
updated to reflect the change in the default.
Currently, there are 4 tests in category (2). They are:
CodeGen/AMDGPU/
addrspacecast.ll
schedule-regpressure-limit.ll
schedule-regpressure-limit2.ll
sema-v-unsched-bundle.ll
There are 8 tests in category (3). They are:
[15 lines not shown]
[AMDGPU] Enabled GCN trackers (amdgpu-use-amdgpu-trackers) by default.
The LIT tests have been generally updated in one of the following ways:
(1) If the above option was not present and the test was auto-generated,
the test has now been auto-generated.
(2) If the above option was not present and the test was not
auto-generated, added the option -amdgpu-use-amdgpu-trackers=0 so as to
preserve any specific attributes the test was already checking.
(3) If the above option was present in a test, then its value has been
updated to reflect the change in the default.
Currently, there are 4 tests in category (2). They are:
CodeGen/AMDGPU/
addrspacecast.ll
schedule-regpressure-limit.ll
schedule-regpressure-limit2.ll
sema-v-unsched-bundle.ll
There are 8 tests in category (3). They are:
[15 lines not shown]
[CIR][OpenCL] Add kernel argument metadata attribute (#199530)
Add a CIR attribute that carries OpenCL kernel argument metadata in
source argument order. Verify that each metadata field has the expected
element type and that all present arrays describe the same number of
arguments.
[AMDGPU] Add a few wmma co-execution hazard checks, NFC (#203658)
This is to reflect the gfx1251 update regarding wmma*8f6f4 with
matrix format as F4.
Also fix a comment in GCNHazardRecognizer.cpp
[Clang] Add AttrDocs entry for OverflowBehavior (#203392)
These docs were previously missing.
Fixes: #203322
Signed-off-by: Justin Stitt <justinstitt at google.com>
[libc++] Fix bug where `optional<T&>` couldn't be constructed from `transform()` (#203462)
- Add the proper from monadic base constructor
- Fix the constraint so it allows references.
- Add tests
[libc++] P3369R0: constexpr for `uninitialized_default_construct` (#200163)
Remarks:
- Tests also verify that `uninitialized_default_construct(_n)`
algorithms do not initialize trivially default-constructible elements
(`int` in these tests) to determined values during constant evaluation.
[GlobalISel] Fix sign-extended byte mask in lowerBswap (#199387)
The per-byte mask in `LegalizerHelper::lowerBswap` was constructed via
```
APInt APMask(SizeInBytes * 8, 0xFF << (i * 8));
```
where `0xFF << (i * 8)` is evaluated as a signed `int`. For `i*8 >= 24`
(byte-3 mask of an s64 G_BSWAP) the value `0xFF000000` does not fit in a
positive 32-bit `int`; the conversion to signed `int` is
implementation-defined under C++17 (UB under C++11, fully defined under
C++20) and on two's-complement targets produces `-16777216`. The modular
conversion to `uint64_t` in the `APInt` constructor then materializes
that negative `int` as `0xFFFFFFFFFF000000` — the intended mask was
`0x00000000FF000000`. The over-wide mask preserved bytes 4-7 of the
source where only byte 3 was intended, and the spurious bytes propagated
through the subsequent shift/OR chain.
[3 lines not shown]