[Vectorize] Declare command line options in TableGen (#231025)
TailFoldingPolicyTy moves to VectorizeOptions.h. LoopVectorize.h no
longer exports EnableLoopInterleaving and EnableLoopVectorization, which
nothing outside the library reads. LoopVectorizeHints and
LoopVectorizationLegality take the options struct in their constructors.
The -vplan-print-* options and -sbvec-always-verify are AssertsOnly
(#230898), no longer available in LLVM_ENABLE_DUMP builds without
assertions.
-vplan-verify-each defaults to VPlanVerifyEachDefault, true under
EXPENSIVE_CHECKS. -epilogue-vectorization-force-VF (ElementCount parser)
stays cl::opt.
Aided by Opus 5.5
[clang][ssaf] Interpose ld.lld in clang-ssaf-orchestrator-make (#231720)
A clang built with CLANG_DEFAULT_LINKER=lld, or given -fuse-ld=lld, runs
ld.lld for a link rather than ld, so the ld shim stands in for ld.lld
too. ld.lld takes ld's command line.
Assisted-by: Claude
[InstCombine] Fold fpto[su]i of llvm.trunc (#231414)
fptoui and fptosi already round toward zero, so a preceding llvm.trunc
is redundant and the conversion can take the untruncated value. NaN,
infinity, and out of range inputs produce poison in both forms.
```llvm
%t = call float @llvm.trunc.f32(float %x)
%r = fptosi float %t to i32
-->
%r = fptosi float %x to i32
```
The trunc may have other users; only the conversion operand is replaced.
Alive2 link: https://alive2.llvm.org/ce/z/HvbncV
[unittests] Skip target tests when the default triple is not built
PassBuilder and TargetMachine C API tests FAIL when LLVM_TARGETS_TO_BUILD
excludes the host triple. Skip instead, and avoid tearing down an
uninitialized TargetMachine after a skipped SetUp.
Co-authored-by: Cursor <cursoragent at cursor.com>
[libclc] Produce subnormal results for exp/exp2 on FP32 (#212696)
The FP32 __clc_exp/__clc_exp2 implementations scale the reduced result
by 2^p using integer bit manipulation (as_int(y) + (p << 23)). That
representation cannot encode a subnormal, so inputs whose result falls
below the smallest normal were unconditionally flushed to zero via "x <
llim ? 0.0f". On devices that report CL_FP_DENORM this loses the correct
subnormal result (e.g. erfc(), which is built on exp(), failed CTS
math_brute_force with the reference subnormal vs a returned 0).
Recompute the subnormal range with __clc_ldexp, which does produce
subnormals, gated on __clc_fp32_subnormals_supported() so flush-to-zero
targets keep the previous fast path. The ldexp path is restricted to
[subnorm_llim, llim); inputs below subnorm_llim (including -inf and
large-magnitude negatives) still flush to zero, since their reduced
exponent argument would be ill-formed for ldexp.
[flang][OpenMP] Fix cleanup placement of num_threads temporaries (#231659)
DISTRIBUTE PARALLEL DO and DISTRIBUTE PARALLEL DO SIMD evaluate the
PARALLEL clause operands before creating omp.parallel, using the
statement context of the dispatch. That context is finalized after the
returned omp.distribute, which is inside the parallel region, so every
thread destroyed the same num_threads temporary, for example for
num_threads(size(f())) where f returns an allocatable.
Evaluate these operands in a separate statement context and finalize it
after omp.parallel.
Fixes #230661
Assisted with Copilot and Claude Opus 5.5
nfscl: Fix oddball cases for session slot release
We have identified some cases where silent slot loss can occur
when operations on NFS mounts are aborted. We experience this
when using NFSv4.2, but it likely also occurs with NFSv4.1.
A slot is acquired for compound operations by nfsv4_setsequence()
and freed by newnfs_request(). Any call path that abandons the
compound before reaching newnfs_request() loses the slot permanently.
We identified four call sites where this happens, one of
which where it actually does happen for us in a semi-reproducible
way, which allowed us to develop a candidate patch, attached.
The patch adds one function, nfsv4_freeunsentslot(), to
nfs_clcomsubs.c. It is called from each of the four call
sites: nfsrpc_writerpc(), nfsrpc_writeds(), and two in
nfsrpc_setextattr().
[11 lines not shown]
nfscl: Fix oddball cases for session slot release
We have identified some cases where silent slot loss can occur
when operations on NFS mounts are aborted. We experience this
when using NFSv4.2, but it likely also occurs with NFSv4.1.
A slot is acquired for compound operations by nfsv4_setsequence()
and freed by newnfs_request(). Any call path that abandons the
compound before reaching newnfs_request() loses the slot permanently.
We identified four call sites where this happens, one of
which where it actually does happen for us in a semi-reproducible
way, which allowed us to develop a candidate patch, attached.
The patch adds one function, nfsv4_freeunsentslot(), to
nfs_clcomsubs.c. It is called from each of the four call
sites: nfsrpc_writerpc(), nfsrpc_writeds(), and two in
nfsrpc_setextattr().
[11 lines not shown]
Merge tag 'nios2_update_for_v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux
Pull NIOS2 fix from Dinh Nguyen:
- Fix __wsum type degradation in csum_fold()
* tag 'nios2_update_for_v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux:
nios2: fix __wsum type degradation in csum_fold()
Merge tag 'for-v7.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply fixes from Sebastian Reichel:
"power-supply core:
- prevent unregistering a power supply while a callback runs
power-supply drivers:
- generic-adc-battery: Fix temperature IIO channel conversion
- ds2780: Fix ds2780_get_capacity() returning raw value
- max17042_battery: Fix vmin assigned instead of vmax in DT parsing
- Fix maintenance charge table kernel-doc"
* tag 'for-v7.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
power: supply: core: prevent unregistering a power supply while a callback runs
power: supply: generic-adc-battery: Fix temperature IIO channel conversion
power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
power: supply: Fix maintenance charge table kernel-doc
power: supply: max17042_battery: Fix vmin assigned instead of vmax in DT parsing
[KnownFPClass] Add trunc/floor/ceil and fix ppcf128 demanded classes (#229982)
Adds `KnownFPClass` functions for `trunc`, `floor`, and `ceil`. Also
corrects the `DemandedSrcMask` code for `PPCDoubleDouble` in
`SimplifyDemandedUseFPClass` for the integer-rounding functions.
I've only added basic deductions for `PPCDoubleDouble` for now:
- `trunc(x)` is only `+-inf` if `x == +-inf` (we already had this)
- `floor(x)` is only `+inf` if `x == +inf`
- `ceil(x)` is only `-inf` if `x == -inf`
AI disclosure:
I used Claude Opus 5 to help write the code and tests.
epoch: Queue drain callbacks from each CPU's callback task
epoch_drain_callbacks() bound the calling thread to each CPU in turn
to queue a callback on that CPU's record. Callers are often user
threads, such as kldunload or ifconfig destroy, and ULE does not
preempt a CPU-bound thread for a migrating thread of no better
priority, so each bind could wait out a time slice. On an 8-CPU VM
with six busy loops running, destroying an epair interface took 1.5 s
and kldunload pflow 0.8 s.
Instead, set a request flag on each record and enqueue that CPU's
callback task, which queues the callback before it polls the record.
The task runs on the CPU's softirq gtaskqueue thread at PI_SOFT, which
preempts a busy user thread, so the request is served at once; the
caller no longer migrates. Both operations now take under 10 ms, idle
or under load.
Reviewed by: markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60646
[llvm-readobj][NFC] Move the 1-byte call graph info fields last
Group FormatVersionNumber and IsIndirectTarget at the end of
FunctionCallGraphInfo, after the 8-byte-aligned members.
Assisted-by: Gemini