[lldb][Windows][CI] refine timeouts (#206942)
Add/refine timeouts on each step of the lldb on Windows CI script. This
should help avoid runaway builds which timeout after 24h.
[CIR][OpenMP] Prevent HoistAllocas pass from hoisting above OpenMP regions (#206168)
This patch modifies the HoistAllocas pass to prevent it from hoisting
allocas outside OpenMP regions, since this may break isolated from above
requirements and affect privatization semantics.
Assisted-by: Cursor / claude-4.8-opus-medium
[lldb] Recover mangled symbol names from DWARF on WebAssembly (#206832)
The Wasm "name" section stores only demangled names, so the symbols
ObjectFileWasm builds from it have no mangled name. Without one, the
symbol table indexes neither the mangled name nor the C++ base and
method name variants derived from it, so looking up a symbol by mangled
name fails and breakpoints set by a template or operator name find no
locations.
Override SymbolFileWasm::AddSymbols to copy each function's mangled name
from its DWARF DW_AT_linkage_name onto the matching symbol, matched by
file address. This is confined to the Wasm symbol file, so other targets
are unaffected.
[lldb-dap] Add a new lldb-dap test infrastructure (#203978)
Introduce a new test infrastructure under lldbsuite/test/tools/lldb_dap
that replaces the dict-based dap_server. Initially the new and legacy
version will live side by side.
Once all tests are ported, the legacy version will be removed. The new
infrastructure has four files:
- dap_types.py: DAP protocol messages as frozen dataclasses, plus
serializer/deserializer functions to and from JSON.
- utils.py: Helper classes for launching and managing lldb-dap process
and its connection.
- session.py: DAP session layer. Owns the per-session state.
- session_helpers.py: Higher-level helpers for writing tests.
Using dataclasses for protocol types lets us catch unexpected or missing
fields at deserialization time instead of at use-site.
Adds a new environment flag, LLDBDAP_RUN_AS_SERVER, that runs the test
suite against lldb-dap in server mode for test cases with
[10 lines not shown]
[SCEV] Cancel common addend/multiplier in SimplifyICmpOperands (#205014)
Simplify:
```
(K + A) pred (K + B) -> A pred B
(C * A) pred (C * B) -> A pred B
```
when no-wrap flags allow it: NSW for signed predicates, NUW for
unsigned. Also requires C > 0 for signed in the multiplication case.
For equality comparisons, `(K + A) eq/ne (K + B)` simplifies to `A eq/ne
B` without requiring any no-wrap flags.
Alive2 proofs: https://alive2.llvm.org/ce/z/KmyqsD
[libc++] Assume that <wchar.h> in llvm-libc has const-overloads. (#206805)
See discussion in https://github.com/llvm/llvm-project/pull/201236 -
we're close to enabling wide characters in libc++ when it's built on top
of llvm-libc.
llvm-libc headers use `const wchar_t*` return type for selected wchar
functions, so we need to configure libc++ to assume that const-overloads
for these functions are available in this case, and the implementations
in libc++ wrapper around `<wchar.h>` are not needed.
[X86] Fold FP UNORD/ORD compare against known-non-NaN to self-compare (#206943)
Replace a known-non-NaN operand of an UNORD/ORD FP compare with the
other operand, so we emit `cmpp a, a` instead of materializing the
constant with `vxorpd`. Matches GCC.
Added combine-fcmp-uno-self.ll which covers the folding and a negative
case.
Fixes #202756
[mlir][ABI] Fix scalable vector mapping in ABITypeMapper (#206617)
mapVectorType in ABITypeMapper incorrectly used ElementCount::getFixed
for all vector types, including scalable ones (e.g. vector<[4]xf32>).
This results in scalable vectors being mapped as fixed-size vectors,
which produces incorrect ABI lowering for SVE and RISC-V V targets.
[libc++] Fix behavior for `get_temporary_buffer` with non-positive size (#206871)
Per C++17 [depr.temporary.buffer]/4, `get_temporary_buffer` is required
to return `{nullptr, 0}` when the size argument is zero or negative.
libc++ used to correctly handle this, but the refactoring in
94e7c0b051c79fd56205f115771980f2e7812306 got this wrong.
GCC generally warns on negative size due to `-Walloc-size-larger-than=`,
which is false positive due to incomplete control flow analysis. The
warning is coupled with optimizations, and this patch make tests
suppress it instead.
Revert "[HIP][AMDGPU] Use non-LTO pipeline for non-RDC in the linker wrapper (#201135)" (#206961)
I believe I fixed the immediate issues that were causing regressions
with this, and now this is leading to its own regressions in building
Pytorch apparently. This was explicitly marked as a hack, and this
should resolve an ongoing issue so we should revert this for now.
Should fix LCOMPILER-2396
This reverts commit eaff67c9838f98d221aa563c9e5d4e714d636674.
[OpenMP][OMPT] Map `ompt_get_num_devices` to runtime function (#200790)
Since 82e94a593433f36734e2d34898d353a2ecb65b8b, `ompt_get_num_devices`
was hard coded to always provide a return value of `1`, regardless of
the actual number of devices. Tools relying on this return value were
henced forced to use other approaches to estimate the number of
available devices.
To improve the situtation, map the returned value to the one provided by
`omp_get_num_devices()`. This does not resolve the issue completely
though. When OMPT is initialized through `libomptarget.so`, the
PluginManager, providing the number of devices, is not initialized until
after OMPT has been fully set up. This means that tools, trying to
retrieve the number of devices during the _initialize_ callback, will
still receive the incorrect number of devices.
Still, this is a significant improvement compared to the prior state
which provided an incorrect result for most of the program runtime.
[4 lines not shown]
[Dexter] Add condition check to state nodes (#203847)
This patch enables the ability for state nodes to check conditions,
meaning they will be active only if the condition is met.
Condition evaluation is somewhat language specific; we directly check
whether the value of the evaluated expression is "true"
(case-insensitive), which works for the languages we actually use Dexter
with, but may require generalizing in future.
We also cache conditions as they are evaluated; each time we step, we
clear all cached conditions for the current frame and any expired
frames, but we keep the cached conditions for any frames rootwards from
the current frame; this prevents us from unexpectedly exiting out of a
callee frame because of debug info not surviving a stack unwind; if the
early exit is desired, an !and{at_frame_idx, condition} under the lower
frame may suffice.
[NFC][AMDGPU] Use SIInstrFlags predicates in Disassembler (#206762)
Replace raw TSFlags accesses with SIInstrFlags predicate calls in
AMDGPUDisassembler.
Part of a series following the introduction of SIInstrFlags predicates.
[lldb] Return llvm::Error from EnableLogChannel (#206479)
Instead of a boolean plus writing errors to a stream.
llvm::Error is either success or an error message, unlike
before where we could (and did sometimes) succeed but
also have an error message.
We can do this for DisableLogChannel too but
I'll do that in a follow up.
[Dexter] Allow matching lists of values for aggregate members
This patch slightly extends the matching of aggregate members to allow for
lists of expected values for individual members, functioning the same as
lists of expected values for scalar values.
[Dexter] Update lldb-based dexter-tests to use script-mode
This patch replaces uses of heuristic-mode Dexter in the dexter-tests suite
with uses of the script-mode, for tests that use DAP (via lldb-dap). The
updates are largely straightforward but occasionally non-trivial, and in
some cases some slight modifications have been made to keep the "spirit" of
the test intact.
[Dexter] Add ability to check float values within a range
Adds a new node type, !float, which can be used to match debugger ouptut as
float values rather than as strings, optionally allowing a range to be
specified for inexact matches. This new node allows a list of values to be
given, effectively a shorthand for a list of individual !float nodes.
[Dexter] Document the structured script model
This patch adds documentation for the script model to the Dexter README,
shunting heuristic-mode information into a separate doc, creating a new
doc for script-mode, and linking to both (with a brief summary of the
differences) from the base README.
[Dexter] Switch to using script-mode by default
This patch changes the default mode of Dexter from heuristic-mode to
script-mode. The --use-script argument is replaced with --use-heuristic,
some comments/docs/error messages are updated accordingly, and tests have
their flags switched accordingly.