[Clang][counted_by] Keep the align_value assumption on the bounds-checked load
With -fsanitize=array-bounds, a subscript of a 'counted_by' pointer field
loads the pointer directly from the field's l-value, so that the bounds
check can reuse the field's address instead of re-evaluating the base.
That load bypassed ScalarExprEmitter, which is where the 'align_value'
assumption for a loaded l-value is emitted. Enabling array-bounds
therefore silently dropped the llvm.assume alignment bundle and, with
-fsanitize=alignment, the alignment-assumption check as well.
Move EmitLValueAlignmentAssumption from ScalarExprEmitter into
CodeGenFunction, so that the direct-load path can share it, and call it
on the loaded pointer.
Assisted-by: Claude Opus 5.5
[mlir][arith] Drop invalid overflow flags when narrowing (#233324)
Preserve `nsw` only when narrowing preserves signed operand and result
values, and `nuw` only when it preserves unsigned values. Flags proven
at the original width may otherwise introduce poison after narrowing.
Add concrete regression cases for `addi`, `subi`, `muli`, and `shli`,
covering both overflow flags and retention of valid flags.
Assisted-by: Codex
[mlir][arith] Fix integer-to-float comparison canonicalization
Reject conversions that can produce NaN or saturate, and formats
that cannot represent zero or signed inputs. Preserve safe rewrites
when the integer range fits the floating-point exponent range.
Handle unconditional cmpf predicates without reaching an unreachable
case. Add regression coverage for exotic formats and rounding limits.
Validation used existing binaries; no rebuild was performed.
[llvm] Absolutize the remarks filename using LLVMContext's VFS (#233483)
This builds on top of https://github.com/llvm/llvm-project/pull/232879
to replace two calls to `sys::fs::make_absolute()` (that trigger IO
sandbox violations) with a centralized call to
`vfs::FileSystem::makeAbsolute()`.
rdar://184781402
[CIR] Implement 'flattening' for loop hints (#233567)
The loop hints need to be propagated to the branches that jump back to
the 'beginning' of an iteration. This patch adds the loop-hints to the
br/brcond operations, and makes sure they are propagated during
flattening.
Additionally, EHABI Lowering work needed to happen to make sure the
original branch's loop_hints are rebuilt with the cir.br. There wasn't a
good way to test this that I could find, so it is purely for
completeness.
This is the 2nd in a set of 3 patches, the previous made sure the
frontend lowered to CIR, the next will make sure we lower properly to
LLVM-IR.
[lldb][docs] Share formatting links between Doxygen and Sphinx
Define a documentation alias that expands to an absolute URL in Doxygen
and a Sphinx doc reference in generated Python docstrings. This keeps
links clickable in both outputs without absolute self-link warnings.
LLM-aided
librep: note upstream version of some build fixes
(There actually is an upstream still, it just hasn't released anything
since 2017, and its main archive site is no longer functioning. Their
patching here is basically the same as what was already committed.)
github-upload-release: Update script to work with draft releases (#229909)
The API endpoint for getting a release does not work for draft releases,
so we need to fetch all the releases instead and manually search for the
one to update.
[Support] Extract SourceMgrDiagnosticVerifier from MLIR's verifier handler. NFC (#227565)
Move the SourceMgr-based `expected-(error|warning|remark|note)` diagnostic
parsing and matching logic out of `mlir/lib/IR/Diagnostics.cpp` into a
reusable `llvm::SourceMgrDiagnosticVerifier` class in `LLVMSupport` so that
non-MLIR tools (such as `llvm-mc -verify`) can share the same
implementation.
`mlir::SourceMgrDiagnosticVerifierHandler` is now a thin MLIR-specific
adapter around `llvm::SourceMgrDiagnosticVerifier`.
Assisted-by: AI tooling
Pull-Request: https://github.com/llvm/llvm-project/pull/227565
[lldb][docs] Preserve URLs in API header comments
Keep absolute URLs in comments shared with Doxygen, which does not
interpret Sphinx doc roles.
LLM-aided
Linux: avoid waking kswapd when growing vmem slabs
Since Linux 7.0, vm_area_alloc_pages() first tries to back a vmalloc
area with pages of order up to ilog2(nr_pages). Those attempts clear
__GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM, so every failed
attempt wakes kswapd even though the order-0 fallback succeeds.
SPL slabs of the zio_buf_comb caches are 1-8 MiB (obj_per_slab x
object size), so their growth requests orders 8-10. On a host whose
free memory is fragmented these attempts fail continuously during
I/O, kswapd reclaims the ARC (down to arc_c_min) and then swaps
anonymous memory, while tens of GiB stay free.
Slabs are grown asynchronously from spl_cache_grow_work(), which can
sleep and reclaim directly. Clear __GFP_KSWAPD_RECLAIM for these
allocations. The high-order attempts then fail quietly, and the
order-0 path keeps direct reclaim and retries, so a grow cannot fail
where it would not have failed before.
[4 lines not shown]
[DebugInfo][CodeView] Fix VFTableShape slot decoding order (#233442)
While working on something else (something like
[MCCAS](https://llvm.org/devmtg/2024-10/slides/techtalk/Rastogi-Fine-grained-compilation-caching-using-llvm-cas.pdf)
for CodeView) I noticed that:
1. The LF_VTSHAPE type record is `TypeRecordMapping` got its
deserialization wrong (this PR)
2. In the usual Codgen path in Clang we get through a
serialize/deserialize/reserialize cycle for each CodeView record (fix
here https://github.com/llvm/llvm-project/pull/233609)
This PR fixes the first issue. In VFTableShapeRecord deserialization
(read), the high and low nibbles were reversed. Writing got it right.
Added a unit test because that's the simplest and more direct thing we
could do.
Also checked against the latest MSVC to ensure we do the right thing.
[flang][debug] Clear the source line of operations hoisted by LICM (#233584)
Fixes #233484.
When `flang-licm` hoists a loop-invariant operation, the operation keeps
the location of the statement it was written in. Because the hoist point
precedes the loop, the line table then claims that statement begins in
the loop setup code, and a breakpoint placed on the statement binds
there rather than in the loop body. At that address the variables the
statement reads are not live yet, so they print as `<optimized out>` in
gdb.
This patch clears the line and column of a hoisted operation, keeping
the file. LLVM does the same to instructions it hoists or sinks, so that
one does not keep reporting a line it no longer belongs to.
librep: fix builds with GCC >= 14
Tested on NetBSD 11.99.9 with GCC 14.4.0 and Fedora Linux 44 with GCC
16.2.1. (Given the configure script was generated from a significantly
older version of autoconf, and the upstream appears to be gone,
patching is applied directly against it for the minimal diff, but an
equivalent change to configure.ac is included, should it be useful to
someone.)