[AssumptionCache] Remove incorrect assertion from `removeAffectedValues()` (#214524)
The assertion in `removeAffectedValues()` is trying to enforce that,
when we come to remove the affected values of a live assume call, each
affected value has a corresponding line in the cache. This may not be
the case if the assume call has been modified via a call to
`Use::set()`, as our value handles are only notified on deletion and
RAUW. We're not worried about this, though, as the cache is
conservative.
Remove this assertion and add a comment explaining why we may fail to
find.
[libc++] Collapse `optional<T&>` inheritance hierarchy (#215286)
Resolves #215185
- Since `optional<T>` and `optional<T&>` are decoupled, there wasn't
much reason to have a base class for `optional<T&>`, so we can simplify
it by inlining all of the base members and private functions into it
directly.
- This leaves us with the iterator base which now only exposes the
`iterator` type, since we can also directly inline `begin()` and
`end()`.
---------
Co-authored-by: Nikolas Klauser <nikolasklauser at berlin.de>
[Clang] Include libc wrappers for LLVM environment CUDA / HIP (#208084)
Summary:
These wrappers (although they are empty right now) are used to inform
the offloading runtime of the supported libc / libm functions available
on the device. We do not include these for the standard HIP path because
they conflict with the alreaedy present utilities, but with the
LLVM-only route we should be able to use them.
[modulemap] Exclude the z/OS string.h wrapper from LLVM_Utils (#215800)
8fce476c8122 (https://github.com/llvm/llvm-project/pull/167703) replaced
`llvm/Support/SystemZ/zOSSupport.h` with
`llvm/Support/SystemZ/zos_wrappers/string.h`, a wrapper that pulls in
the system header via `#include_next` and then redeclares `strsignal`
and `strnlen` with `asm` labels. It is only meant to be reachable on
z/OS, and `llvm/CMakeLists.txt` adds the directory to the include path
solely when `CMAKE_SYSTEM_NAME` matches OS390.
The header was never excluded from the module map, though.
`LLVM_Utils.Support` is an umbrella over `llvm/Support`, so building
that module textually includes the wrapper on every host. This surfaced
building the Swift compiler on Windows, where `<string.h>` resolves to
the UCRT header that already declares `strnlen` as `_ACRTIMP`, i.e.
`__declspec(dllimport)`:
```
error: cannot apply asm label to function after its first use
[11 lines not shown]
[MLIR][ROCm] Export runtime wrappers on Windows (#213046)
Export the ROCm runtime wrapper entry points when building
`mlir_rocm_runtime` as a Windows DLL.
Use `__attribute__((visibility("default")))` on other platforms.
## Motivation
`extern "C"` prevents C++ name mangling, but it does not add symbols to
a
Windows DLL export table. Consequently, `mlir-runner` can load
`mlir_rocm_runtime.dll`, but ORC cannot resolve its `mgpu*` entry
points.
CUDA, SYCL, Vulkan, and SPIR-V runtime wrappers already use explicit
Windows
export annotations. This applies the same approach to the ROCm runtime.
[24 lines not shown]
Revert "[HLSL] Generate semantic signature metadata" (#215844)
Reverts llvm/llvm-project#212892
Build dependency for `DXILResource.h` was not updated. I will reland
with the corrected dependency.
[libc++] Guard container benchmarks on library availability (#215408)
Instead of using TEST_STD_VER, use FTMs or requires clauses to enable
benchmarks for some recent features like `append_range`. This is needed
since older versions of the library don't provide these features, so the
container benchmarks as a whole would fail to compile instead of just a
few methods being disabled.
[Support] Fix format_object streaming ambiguity in Objective-C++ mode (#215826)
Upstreams https://github.com/swiftlang/llvm-project/pull/13625.
Streaming a format_object writes it through a temporary lambda. Swift's
C++ interoperability enables block pointer conversions, which makes
`raw_ostream::operator<<(const void *)` a viable candidate alongside
`operator<<(function_ref<size_t(char *, size_t)>)`, so overload
resolution is ambiguous. This breaks the Swift compiler because it
contains Swift code that interoperates with C++ code that instantiates
this template.
Bind the lambda to an explicit function_ref before streaming so the
intended overload is selected unambiguously in every language mode.
Assisted-by: Claude Code
[HLSL] Generate semantic signature metadata (#212892)
This pr adds support to collect the signature element metadata as they are emitted and outputs them to a named metadata node.
Updates the constructor of a `SemanticSignature` to reflect the required values and touches up its corresponding unit tests.
Adds a lit test of the metadata creation.
Resolves https://github.com/llvm/llvm-project/issues/57928
[LLDB] Track tool dependencies in Makefile.rules (#215701)
Before b9225e860769 (Allow tests to share a single build)
lldbtest.makeBuildDir() would delete the build dir before building a
test, but the shared test builds no longer have that behavior. Neither
does the check-lldb target delete the entire test build dir before
running, so tests don't get rebuilt when one of the tools (for example,
clang) change.
This patch is one way to solve this, by adding all tools as explicit
dependencies to each rule in the shared Makefile.rules.
Assisted-by: claude
[libomp] OpenMP 6.0: Add device trait parser (#176164)
OpenMP 6.0 introduced a device trait specification language for the
environment variables OMP_AVAILABLE_DEVICES (4.3.7) and
OMP_DEFAULT_DEVICE (4.3.8).
This commit defines a grammar for that language and implements a parser
for a large part of this grammar.
[AMDGPU] Utilize Promote action for FMINIMUM/MAX f16 (#215678)
Utilize Promote action to convert f16 FMINIMUM/FMAXIMUM to use v2f16.
Custom lowering is no longer needed.
Support for Promote from scalar to vector was added in
https://github.com/llvm/llvm-project/pull/215042.
---------
Signed-off-by: John Lu <John.Lu at amd.com>
[DebugInfo] Do not stop after livedebugvars (#215169)
livedebugvars is an analysis. We can only -stop-after it inside the
LegacyPM due to how the LegacyPM schedules analyses. We cannot
stop-after it inside of the NewPM given analyses are dynamically
requested within each pass. Instead, just stop before the asm printer
given we're after the last livedebugvars analysis which happens pretty
late in the pipeline and it doesn't seem like there's a vastly better
spot.
[CIR] Require every record member to specify its kind
The member kind list was optional, and an all-data list was canonicalized
to an absent one, so "nobody computed this" and "everything is data" had
the same spelling. A producer that forgot to specify was assumed
correct.
The list is now required on both record types and the verifier demands
one kind per member. Normalization is no longer needed and is removed.
A producer whose members all hold data says so with getAllDataKinds.
CIRGen has to compute a list too, so record lowering funnels every
appended field through addField and marks inserted padding as pad.
A data member still prints without a mark, and `data` is now accepted on
input so every kind can be written out.
Assisted-by: Cursor / claude-opus-5
[CIR] Add AArch64TargetCIRGenInfo (#215424)
This adds an AArch64-specific implementation of TargetCIRGenInfo and
adds handlers for the functions that require AArch64-specific handling.
I've implemented the wouldInliningViolateFunctionCallABI function
(because that seemed easier than deciding when to report NYI), generated
an NYI error for isScalarizableAsmOperand in the one case where it needs
to do something other than forward the call to the based class, and
added MissingFeatures asserts for setTargetAttributes (because CIR
doesn't support the features it wants to add attributes for yet).
Assisted-by: Cursor / various models
[CIR][NFC] Add atomic compare-exchange runtime order test (#215722)
Add a test for `__atomic_compare_exchange_n` when both success and
failure memory orders are runtime values. Check the nested CIR switches
across every generated memory-order combination.
Partially addresses #156747.
[mlir] Remove dead declaration promoteSingleIterationLoops (#215738)
The corresponding function definition was removed on January 24, 2022
in a70aa7bb0d9a6066831b339e0a09a2c1bc74fe2b.
[LLVM][Maintainers] Volunteer for LoadStoreVectorizer (#214025)
I have been contributing to and reviewing changes to the
LoadStoreVectorizer for over a year now, figured I should formalize
this.
[Clang] Fix BitInt padding clearing on big-endian targets
This patch fixes the padding clearing logic of `_BitInt`s.
Before this patch, the clearing logic assumed little endian. But the
memory layout of BitInts differs between little and big endian:
- In LE, the occupied bits start from the lowest address and go on
contiguously up until the BitInt's declared size. The padding bits
then start from that point and go contiguously until the end of the
storage unit.
- In BE, since the byte order is reversed, the occupied bit interval
is not contiguous if the storage unit is larger than the BitInt's
size.
Therefore, the logic must tell the two cases apart and perform the
calculations accordingly.