[flang][NFC] Converted select-type.f90 test to HLFIR (#195777)
Lower/select-type.f90 took special care to convert from legacy lowering
to HLFIR lowering.
Assisted-by: AI
[flang-rt] Avoid libstdc++ guard symbols in RTNAME(Timef) (#195984)
The function-local `static Lock timef_lock;` introduced by PR #185377
required thread-safe-static initialization, which causes the compiler to
emit calls to `__cxa_guard_acquire`/`__cxa_guard_release` from
libsupc++/libc++abi -- a C++ runtime library dependency that flang-rt
explicitly avoids (see comment in
flang-rt/include/flang-rt/runtime/lock.h).
Move `timef_lock` to namespace scope, matching the existing
`rand_seed_lock` pattern in the same file. The other function-local
statics (`start`, `ticks_per_sec`, `isInit`) have constant initializers
and are unaffected.
Assisted-by: AI
[Dexter] Add timestamps to DAP logging (#193705)
DAP logs are currently optionally output by Dexter to assist in
debugging or analyzing Dexter sessions. The output currently includes
the contents of every DAP message sent to/from the debug adapter, but
for some long-running programs it can also be useful to know when
messages have been sent and received; to assist, this patch adds
timestamps to DAP messages in the log.
[SPIRV] Fix failure on the `llvm.trap` test (#195996)
The `llvm.trap` test was failing with the expensive checks enabled,
because the backend incorrectly created the `OpConstant` and
`OpConstantNull` instructions for the operand of `OpAbortKHR` in the
same basic block. When there are multiple `llvm.trap` intrinsics, they
reuse the same operand, which doesn't dominate all the users. This
commit moves the constant into the function entry block to ensure it
dominates all the users.
Assisted-by: Claude Opus 4.6 <noreply at anthropic.com>
[clang-tidy] `use-ranges`: avoid unsafe result fix-its
Preserve callable results with .fun, allow structured-binding-safe rewrites, and keep diagnostics while suppressing unsafe fix-its when ranges result objects do not match the original result shape.
Assisted by Codex.
[libc] Add a simple scope_exit wrapper and use it in socket tests (#192615)
This is slightly different from the other CPP reimplementations in that
the real scope_exit is only an experimental C++ class. If that's an
issue, I'm happy to put the class somewhere else.
It could probably be used in more places, but right now I'm adding it to
socket tests, as that's what I'm familiar with. It (mostly -- it doesn't
help with crashes) solves the issue where a failing test does not clean
up the unix domain socket, which then fails the test on the subsequent
run.
[lldb] Do not refcount breakpoints in lldb-server (#195858)
We did not say so explictly, but I'd argue that via #195815, we are
supporting stubs which do not refcount breakpoints. In these stubs the
set/clear breakpoint packets are idempotent:
- setting a breakpoint for the second time is a no-op (returns OK)
- clearing a breakpoint clears it, regardless of how many times it has
been set
- clearing a non-existent breakpoint (either because it was already
cleared, or because it was never set) returns an error
This makes lldb-server one of those stubs, which makes the code slightly
simpler, but more importantly, ensures we do not regress this behavior.
[MLIR][vector] vector.deinterleave to vector.shuffle decomposition (#177897)
This PR adds a rewrite pattern for vector.deinterleave ops that rewrites
them using vector.shuffle ops. This is similar to the existing pattern
for vector.interleave and allows for supporting these ops for lowering
to targets without native deinterleave support. A transform dialect op
is also added to apply this pattern.
---------
Co-authored-by: Andrzej Warzyński <andrzej.warzynski at gmail.com>
[OMPIRBuilder] Use correct API to get filename. (#195866)
Fix incorrect OpenMP source location in ident strings (e.g. showing
"FIRModule" instead of the real source file for Flang).
This addresses issue #195333 (filename part): we were deriving the file
path from `DIFile::getSource()`, which returns optional *embedded*
source contents, not the path/name of the file on disk. It usually
returns `std::nullopt`, so the code fell back to the LLVM module name
(`M.getName()`), which is often "FIRModule" for FIR lowering.
This issue is a regression of D85938 (9240e48a588c) which switched from
`DILocation::getFilename()` to `DIFile::getSource()`.
Restore use of the location’s filename (`DILocation::getFilename()`) so
the ident string gets the actual source file name when available.
[clang-tidy] `use-ranges`: preserve output results
Preserve used output iterator results for output algorithm replacements by appending .out where the ranges algorithm returns an algorithm result object.
Fix #110223
Assisted by Codex.
[clang-tidy] `use-ranges`: preserve remove iterator results
Preserve used iterator results for remove, partition, stable_partition, and rotate-style replacements by appending .begin() where the ranges algorithm returns a subrange.
Fix #124794
Assisted by Codex.
[clang-tidy] `use-ranges`: preserve used unique results
Preserve iterator uses when replacing std::unique with std::ranges::unique by appending .begin() in used-result contexts.
Fix #127658
Assisted by Codex.
[MLIR][Presburger] Make getSubMatrix exclusive on the right end (#190911)
Currently `getSubMatrix(fromRow, toRow, fromCol, toCol)` forms a
submatrix with both ends inclusive. In this way, it's impossible to form
an empty submatrix, as the assertions in the function prevents cases
where `toRow < fromRow`. However, the functionality is necessary for
Barvinok procedures (e.g. we might want to inspect the submatrix for
parameters, which will be empty if there's none).
This PR changes it to be inclusive on the left end and exclusive on the
right end, making it the same as canonical C++ ranges.
[clang][AArch64][nfc] Remove redundant truncation for FP16 reduction builtins (#195825)
The following non-overloaded NEON builtins already return the expected
result
type, so CodeGen does not need to truncate their results:
* BI__builtin_neon_vmaxv_f16
* BI__builtin_neon_vmaxvq_f16
* BI__builtin_neon_vminv_f16
* BI__builtin_neon_vminvq_f16
* BI__builtin_neon_vmaxnmv_f16
* BI__builtin_neon_vmaxnmvq_f16
* BI__builtin_neon_vminnmv_f16
* BI__builtin_neon_vminnmvq_f16
Remove the redundant truncation from AArch64 CodeGen.
[RISC-V] Add support for cheriot ABI in DataLayout (#190806)
CHERIoT uses the same DataLayout setup as RISC-V Y base, but does not share instruction encodings with it.
[MLIR] Parallel loop fusion extended to interchanged loops. (#191245)
Patch extends fusion of two parallel loops to the case where the second
parallel loop comprises of two interchanged loops of same iteration
space.
[SCEV] Introduce loop-uniform SCEV classification. (#194304)
This patch extends `ScalarEvolution::LoopDisposition` with a new
`LoopUniform` state to describe SCEVs that are invariant across all
iterations of a given loop, but may still depend on inner-loop induction
variables.
Unlike `LoopInvariant`, which requires the value to be fully invariant
with respect to the loop, LoopUniform captures expressions that do not
depend on the loop’s own induction variables, yet may vary in nested
loops. This distinction is useful for analyses and optimizations that
reason about per-iteration stability at a specific loop level.
Example:
```
for (i)
for (j)
dep(j); // uniform w.r.t. i
dep(i, j); // not uniform w.r.t. i
[4 lines not shown]