[LFI][MC] Mark .note.LFI.ABI section with SHF_GNU_RETAIN (#233164)
Sections in a COMDAT group are subject to garbage collection during
linking when `--gc-sections` is enabled (even SHT_NOTE sections).
Because nothing references `.note.LFI.ABI.<arch>`, the deduplicated note
was previously removed by the linker with `-Wl,--gc-sections`.
Add `SHF_GNU_RETAIN` to `.note.LFI.ABI.<arch>` so that linkers recognize
it as a GC root while still deduplicating it via COMDAT.
Fixes #233086.
[libc][math] Add integer-only implementation for exp2f.
- Correctly rounded to all rounding mode (statically).
- Share core computations with expf integer-only static-rounding version
- Optimize for code size.
Assisted-by: Gemini for analysis and refactoring.
[libc] Add floating-point bitwise operations to FPUtil.
Add `fp_and`, `fp_or`, `fp_xor`, `fp_andnot`, and `fp_not` to
`src/__support/FPUtil/fp_bitwise.h` to perform bitwise operations on
floating-point values directly in FP/SIMD registers when SSE2 or AArch64 NEON
is available, avoiding GPR round-trips.
[mlir][ArithToLLVM] Preserve defined signed remainder by -1
Select a zero dividend when the divisor is -1 before emitting llvm.srem.
This preserves arith.remsi(INT_MIN, -1) == 0 without introducing LLVM UB.
Support scalar and vector operands, including multidimensional vectors.
Add regression coverage to the existing ArithToLLVM conversion test.
Tests were not run as requested.
[libc][NFC] Fix typo 'implemenation' in comments (#233089)
Fix the misspelling "implemenation" -> "implementation" in comments in
libc/src/__support/mathvec/*.h and libc/src/string/string_length.h.
No functional change.
[llvm-reduce] Parse library options into LLVMContext (#233162)
cl::ParseCommandLineOptions sets library options in T::Global,
no longer read by LibraryOptionsContext::get since #233044.
Switch to cl::parseCommandLineOptions.
[mlir][ArithToLLVM] Preserve defined signed remainder by -1
Select a zero dividend when the divisor is -1 before emitting llvm.srem.
This preserves arith.remsi(INT_MIN, -1) == 0 without introducing LLVM UB.
Support scalar and vector operands, including multidimensional vectors.
Add regression coverage to the existing ArithToLLVM conversion test.
Tests were not run as requested.
[libc++] Granularize <execution> (#229315)
Move execution policies into `__execution/execution_policies.h`
to separate them from upcoming C++26 sender/receiver components.
Also move `__type_traits/is_execution_policy.h` into `__execution`
directory.
This is a prerequisite for #229095.
[OpenMP] Fix construct context at TARGET and repeated-construct subsets
OMPContext has two bugs in how construct selectors are matched. Both can
select the wrong variant:
- The construct context should start at the innermost enclosing TARGET,
but Clang and Flang add every enclosing construct. Inside a TARGET
region nested in a PARALLEL, construct={parallel} matched the outer
PARALLEL. OMPContext::addTrait now drops the constructs recorded before
a target trait.
- A selector that only repeats a construct, such as
construct={parallel do, parallel} over construct={parallel do}, adds no
property. isStrictSubset required fewer properties, so a score tie
between the two fell back to clause order. A shorter ordered construct
sequence now also makes a strict subset. If the shorter selector has a
user condition, or an ISA name the longer one lacks, the tie still falls
back to clause order, since different conditions or ISA names share one
property.
[9 lines not shown]
libthr: Remove deadcode in join_common
The while loop previous can only be break when ret == ETIMEDOUT. They
never produce EBUSY. Remove the deadcode here.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60711
[mlir][arith] Check overflow when reassociating integer constants
Folding (x + 100 nsw) + 100 nsw to x + (-56) nsw in i8 introduces
poison for inputs such as x = -100 that were previously defined.
Check signed and unsigned overflow when folding constants in the
add/sub/mul reassociation patterns. Retain each common nsw/nuw flag
only when its constant arithmetic does not overflow. Keep index
behavior unchanged for a separate fix.
Add regression coverage for invalid and preserved overflow flags.
Eliminate very low concurrency limit in RAIDframe, improving write throughput as much as 25%.
RAIDframe maintains a per-set freelist of "emergency buffers" to ensure it can perform I/O
under heavy memory pressure. The freelist size was 10, and each I/O request can require
up to 2 buffers in some recovery conditions, so raidPtr->openings was limited to RAIDOUTSTANDING,
which was set to 6 (this was a bug; it should have been 5).
There is no need at all for this limit for RAID 0 or RAID 1 sets; they do not buffer I/O in
the relevant way. Eliminate the allocation entirely in this case; openings is set as the
configured queue length for the RAID set.
For parity RAID sets, we dynamically size two freelists of pre-allocated buffers and the
openings value so that we consume no more than 1% of system RAM per set:
openings = MIN(maxQueueDepth, MAX(RAIDOUTSTANDING, (1% of physmem), bytes_per_opening))
stripe buffers: 2 * openings
I/O buffers: openings * max_stripes_per_bp * numCol
RAIDOUTSTANDING (now used as a floor) remains 6.
[16 lines not shown]
[mlir][arith] Check overflow when reassociating integer constants
Folding (x + 100 nsw) + 100 nsw to x + (-56) nsw in i8 introduces
poison for inputs such as x = -100 that were previously defined.
Check signed and unsigned overflow when folding constants in the
add/sub/mul reassociation patterns. Retain each common nsw/nuw flag
only when its constant arithmetic does not overflow. Keep index
behavior unchanged for a separate fix.
Add regression coverage for invalid and preserved overflow flags.