[orc-rt] Generalize testcases for different target archs (#222629)
Drop the hard-coded archs from the check-rt-process-info testcases.
Instead, check against an arch value derived from the build's target
triple.
[libc] Optimize the GPU printf implementation with size hints (#222474)
Summary:
The GPU printf interface is functionally a shim to pass a `va_list` and
format string to the CPU for formatting. The size of the argument list
isn't exposed by the C ABI, but we can use `__builtin_object_size` to
try to look it up. This will bind to the `alloca` holding our arguments
in the ABI and return a positive size if it is known.
We do this opportunistically, as the check is lossy. In cases where it
is known, this saves a stack spill to store the true size. Additionally,
we can use this to detect cases where `printf` is being used as a simple
`puts`.
This saves 10 VGPRs for the `printf("string")` case. It also saves 8
bytes of stack in most all cases.
RegisterPressure: Remove dead defs correctly
When an instruction has overlapping register defs where only some carry the
dead flag (for example a dead super-register def alongside a live sub-register
def), the collector left the shared register units in both the live and dead def
sets. That produced a PressureDiff decrement with no matching increment and tripped
the "PSet overflow/underflow" assertion in getUpwardPressureDelta.
A register unit is dead if any def covering it is dead, regardless of operand
order. Reconcile by subtracting the dead defs from the live defs instead of the
reverse: removeRegLanes only clears the overlapping units, so a def keeps any
units a dead def does not cover.
Fixes #155807.
Fixes #149144.
Fixes #76416.
Fixes #205272.
Co-authored-by: XChy <xxs_chy at outlook.com>
Co-authored-by: Claude claude-opus-4.8 <noreply at anthropic.com>
[Darwin][TSan] Use deadlock detector aware calls for Darwin-specific lock interceptors (#216040)
Currently the deadlock detector is unaware of these lock types because
the interceptors use bare Acquire-Release calls. This patch switches
them over to the Mutex(Pre|Post)Lock calls instead.
Assisted by: Claude
rdar://155410097
NAS-143516 / 27.0.0-BETA.1 / rename the s3 service from truenas_s3 to s3 (by anodos325) (#19674)
service.query reported it as truenas_s3, the daemon's name rather than
the protocol's. The services_services row has to move with
ServiceInterface.name or nothing resolves it, so a migration renames it;
ServiceWriteRole is keyed by the name upper-cased and moves too.
Root is refused as an access key account and as a bucket owner. Both run
as uid 0, which no bucket grant and no file mode restrains.
The daemon's own messages get /var/log/truenas_s3.log, filtered on the
journal identifier it writes, s3d, and rotated the way scst and
truenas-discoveryd are. Its audit records are a separate path and are
untouched.
The systemd unit, the etc group and the tables keep the truenas_s3 name:
they are the daemon's, and nothing outside middleware names them.
Original PR: https://github.com/truenas/middleware/pull/19672
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
[mlir][vector] Fix mask neutral value for masked fmaximum/fminimum reductions (#222275)
Masked maximumf/minimumf reductions were lowered by replacing inactive
lanes with a neutral value before applying an unmasked reduction. The
maximumf neutral was incorrectly set to the negative subnormal closest
to zero, causing it to beat any negative active value. Similarly,
minimumf used FLT_MAX, which loses to an active +Inf.
This change adds LLVM dialect support for
llvm.vp.reduce.fmaximum/fminimum and lowers masked reductions directly
to these predicated intrinsics.
[flang] add AllocationPolicy attribute to module and use it in InlineHLFIRCopy (#222013)
The StackArrays/AllocationPlacement pass cannot move fir.allocmem
created during InlineHLFIRCopy for the copy-in/cop-out buffers because
of there placement in branches.
Moving these allocmem outside of the branches is suboptimal as these
allocations may never occur at runtime (when the data is actually
already contiguous).
Extending the StackArrays pass is doable but very tedious (the data flow
analysis passes used in the pass cannot recognized "same
predicates"/understand that the two fir.if block that
allocate/deallocates will be both reached or never reached (even when
modifying InlineHLFIRCopy to use the same SSA value for both fir.if). So
this requires custom logic, and was adding 200 lines of non trivial code
to audit and I did not like it.
I decided to expose the allocation policy so that other passes can rely
on it. To make it the most flexible and future proof this is done via a
[15 lines not shown]
[JITLink][RISCV] Avoid quadratic removal of alignment edges (#222317)
We encountered this issue while using BOLT to instrument clang on
RISC-V. JITLink spent significant time removing alignment edges during
relaxation finalization in large code blocks with many alignment
relocations.
During RISC-V relaxation finalization, finalizeBlockRelax removes
AlignRelaxable edges individually from a block's edge vector. Each erase
shifts the remaining suffix, making this cleanup quadratic when the
number of alignment edges grows with the total edge count.
Compact surviving edges once and remove the trailing entries from the
back, preserving edge order and making cleanup linear. Count the
trailing entries before erasing to avoid comparing an invalidated
iterator.
These results support the performance benefit, but they come from
[9 lines not shown]
Move code around to result in the same list of case statements in
_bpf_filter and bpf_validate.
Also encode BPF_LDX|BPF_MSH|BPF_B as BPF_LDX|BPF_B|BPF_MSH, all other
BPF_LD / BPD_LDX instructions have BPF_{W,H,B} in 2nd position.
OK tb@