[lldb-dap] Refactor handling progress events. (#224957)
lldb-dap now only uses one thread to receive and throttle received
progress events.
For every progress with a progressId, we delay reporting the progress
for 1000ms until we have recieved a new progress and only send an update
if the progress has a new version after 250ms.
This means for every progress integration test we do nothing for at
least 1250ms. The previous `TestDAP_progress` runs for at least 8s
regardless of how fast the computer is.
Moved most of the test to unittest where we can simulate progress delays
and time passing. We now have only one `TestDAP_progress` test to verify
the client receives progress Events.
When the ProgressEventThread reports a new progressEvent, the reporter
then.
- Create or update the `PendingProgress` with that progressId.
[6 lines not shown]
[X86] Don't double count the interrupt stack alignment push in StackSize (#224029)
emitPrologue pushes a slot to give an error-code handler the
return-address parity the frame layout assumes, but StackSize counted
that push as well. NumBytes derives from StackSize, so the subq grew by
8 too and left RSP at 8 mod 16 at every call. Object addresses are
unchanged.
Fixes #44560, fixes #50195
---------
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
[Clang] Store AST context in declaration contexts
Store the owning ASTContext directly in each DeclContext and route declarations
through that direct path. This removes the nullable cache and translation-unit
walk from Decl::getASTContext().
Assisted-by: Codex
[orc-rt] Add MsgHeader, the SimpleRemote stream header (#225336)
A SimpleRemote message carries an opcode, a sequence number, a tag and a
payload. MsgHeader is how a byte-stream transport puts those on the
wire: four little-endian uint64 fields, size first, followed by the
payload.
Adding MsgHeader to SimpleRemoteCA makes it easy for stream-based
transports to reuse.
[ORC] Remove unused rt_alt UnwindInfoManager CI names (#225329)
The rt_alt UnwindInfoManager register/deregister action names were added
as a step towards supporting an "ORC-runtime-lite" API within LLVM, but
have not been used so far. This patch removes them, rather than leaving
them to drift. Replacements can be added as part of a coherent design
when ORC-runtime-lite is revisited.
[BasicAA] Extend two-variable MinAbsVarIndex heuristic to different scales (#218639)
When performing offset-based reasoning via the min abs heuristic, the
existing two-variables case requires equal absolute scaling factors.
This may be generalized to different scales by factoring the offset as
`GCD*(C0*V0 - C1*V1)`, and relying on cached KnownBits to prove that the
cofactor products differ.
Proof: https://alive2.llvm.org/ce/z/RC4LwD.
Co-authored-by: Alex MacLean <amaclean at nvidia.com>
[AggressiveInstCombine] Fold low-bits mask table loads to arithmetic (#222509)
Recognize a load from a constant "low bits mask" table
```
static const uintN_t tbl[K] = { 0, 1, 3, 7, ... }; // tbl[j] == (1 << j) - 1
... x & tbl[i] ...
```
and replace the load with the equivalent arithmetic mask (1 << i) - 1.
This is the target-independent form of the X86 combineAndLoadToBZHI DAG
combine: on X86 with BMI2 the surrounding and still selects to a single
bzhi.
Assisted-by: Claude Code
[Clang] Store AST context in declaration contexts
Store the owning ASTContext directly in each DeclContext and route declarations
through that direct path. This removes the nullable cache and translation-unit
walk from Decl::getASTContext().
Assisted-by: Codex
Triple: Move getSjLjDataSize off TargetMachine
This eliminates the TargetMachine dependence of SjLjEHPrepare.
The pass had the questionable behavior of just proceeding with the
default size without a TargetMachine. VE is the only user and changes
the integer bitwidth used, and this doesn't seem worthwhile of a
virtual function. Move to the triple in keeping with migrating
ABI parameters out of codegen.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Triple: Move getSjLjDataSize off TargetMachine
This eliminates the TargetMachine dependence of SjLjEHPrepare.
The pass had the questionable behavior of just proceeding with the
default size without a TargetMachine. VE is the only user and changes
the integer bitwidth used, and this doesn't seem worthwhile of a
virtual function. Move to the triple in keeping with migrating
ABI parameters out of codegen.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[libc] Implement pthread_cleanup_push and pthread_cleanup_pop (#223427)
This patch implements the core POSIX thread cleanup mechanism
(pthread_cleanup_push and pthread_cleanup_pop).
POSIX allows these functions to be implemented as macros opening and
closing a lexical block. We allocate an automatic
__pthread_cleanup_frame structure on the stack in the push macro and
unlink it in the pop macro, calling helper functions
(__pthread_cleanup_push and __pthread_cleanup_pop) to link/unlink the
frame on the thread's cleanup_stack.
The stack is drained in LIFO order during thread termination in
call_atexit_callbacks before running __cxa_thread_atexit and TSS key
destructors.
It's worth noting that GLIBC implements this functionality in a much
more complicated way. The cleanup functions are registered with the
unwinding machinery so that throwing an exception (or even just
[17 lines not shown]
Remove .. from clang resource path when specified with CLANG_RESOURCE_DIR (#216996)
As discussed here:
https://discourse.llvm.org/t/removing-clang-version-number-from-resource-dir-in-a-distribution/90234
If a distributor wishes to have stable include paths across LLVM
versions, then they can build with `CLANG_RESOURCE_DIR=../lib/clang`.
This results in a slightly untidy include path (E.g.`C:\Program
Files\LLVM\bin\..\lib\clang\include`). This removes the ".." to make it
`C:\Program Files\LLVM\lib\clang\include` in this configuration.
Also added test. This uses "SIE" vendor. Since
https://github.com/llvm/llvm-zorg/commit/eac6791821f5104eb4c2b32f39ef5d20cda535a9,
PS4 and PS5 buildbots use this configuration and define the vendor so
the lack of version number and ".." should be tested on at least these
buildbots.
[libc] Implement fstatat in sys/stat (#224334)
### Summary
Implement the standard POSIX.1-2008 function `fstatat` in
`<sys/stat.h>`.
Fixes #224327
### Changes
- Added `fstatat` function specification to
`libc/include/sys/stat.yaml`.
- Added internal header `libc/src/sys/stat/fstatat.h`.
- Implemented `fstatat` in `libc/src/sys/stat/linux/fstatat.cpp` using
the existing `internal::stat_via_statx`.
- Registered `fstatat` entrypoint in `libc/src/sys/stat/CMakeLists.txt`
and `libc/src/sys/stat/linux/CMakeLists.txt`.
- Added entrypoint across Linux targets (`x86_64`, `aarch64`, `riscv`).
- Added hermetic unit tests in
`libc/test/src/sys/stat/fstatat_test.cpp`.
[12 lines not shown]
[libc] Implement mkfifoat in sys/stat (#224628)
### Summary
Implement the standard POSIX.1-2008 function `mkfifoat` in
`<sys/stat.h>`.
Fixes #224587
### Changes
- Added `mkfifoat` function specification to
`libc/include/sys/stat.yaml`.
- Added internal header `libc/src/sys/stat/mkfifoat.h`.
- Implemented `mkfifoat` in `libc/src/sys/stat/linux/mkfifoat.cpp` using
the existing `linux_syscalls::mknodat`.
- Registered `mkfifoat` entrypoint in `libc/src/sys/stat/CMakeLists.txt`
and `libc/src/sys/stat/linux/CMakeLists.txt`.
- Added entrypoint across Linux targets (`x86_64`, `aarch64`, `riscv`).
- Added hermetic unit tests in
`libc/test/src/sys/stat/mkfifoat_test.cpp` using `cpp::scope_exit`
[9 lines not shown]
[SCEVExpander] Mark selects with unknown profile. (#224362)
SCEVExpander creates selects when expanding min/max expressions for
pointers and predicates. In neither case there is any information on how
likely either arm of the select is. Annotate with unknown profile.
This is part of addressing the remaining profcheck failures in
LoopVectorize: https://github.com/llvm/llvm-project/issues/161235.
PR: https://github.com/llvm/llvm-project/pull/224362
Add PISA codegen pipeline and lowering passes
Add the IR- and MIR-level passes that make up the PISA code generation
pipeline and wire them into PISAPassConfig in PISATargetMachine:
- Intrinsic handling: PISAEmitIntrinsics, PISAExpandIntrinsics,
PISAReplaceIntrinsics
- Call/ABI lowering: PISALegalizeCalls, PISAKernelByValArgsLowering
- IR preparation: PISAPropagateNullPointers, PISALayout, PISAConstProp
- Legalization/verification: PISALegalizePredicates, PISAVerifyTypes,
PISAVerifier
- Post-selection: PISAScopeSelector, PISACacheHintSelector,
PISALegalizeSubregAccess, PISAOptimizeSubregAccess,
PISAOptimizeRedundantCopies, PISAMarkConvergentNoMerge,
PISAInsertLifetimeStart
PISAPassConfig now overrides the GlobalISel and pre/post-regalloc hooks
to run these passes, disables the machine passes that assume physical
registers, and runs the load/store vectorizer and atomic expansion in
[4 lines not shown]
[llvm-pdbutil] Avoid reading EC names from non-EC modules (#223253)
The module dumper resolves the PDB and source file name indices for
every module, even when the module does not contain Edit and Continue
information. If the DBI stream has no EC names table, `dump --modules`
fails with:
Unexpected error processing modules: Stream Error: The stream is too
short
to perform the requested operation.
Only resolve and print the EC names when the module's EC flag is set.