[LV] Don't introduce UB when rewriting SCEVs with versioned strides. (#236313)
replaceSymbolicStrides rewrites the SCEVs of VPExpandSCEVRecipes in the
entry block using the versioned strides (e.g. Stride == 1). Those
expressions are expanded before the SCEV checks that guarantee the
predicates, so the rewritten expressions must not introduce UB when the
predicates do not hold. For example, the trip count n /u (stride + y)
was rewritten to n /u (y + 1), which divides by zero for y == -1 and
stride != 1, while the original loop is well defined.
[libc][math] Implement double precision cosh correctly rounded to all rounding modes.
Use shared exp(x) +- exp(-x) evaluations with sinh from https://github.com/llvm/llvm-project/pull/235097.
Assisted-by: Gemini for analysis and refactoring.
[dsymutil] Record dsymutil's version in LC_BUILD_VERSION (#236202)
There is no way to tell which dsymutil produced a dSYM. The compiler
records itself in DW_AT_producer, and the linkers (ld64, lld) record
themselves as a build tool in LC_BUILD_VERSION.
Do the same for dsymutil. Replace the (previously dropped) tool list of
each LC_BUILD_VERSION with a single TOOL_DSYMUTIL entry. Unlike an
Info.plist key, this survives flat output and dSYMs copied out of their
bundle. Re-running dsymutil with --update replaces the entry.
rdar://190920015
[flang] Preserve capture metadata for host-associated globals (#233433)
Host-associated globals accessed directly inside internal procedures are
missing `internal_assoc`. For SAVE variables, FIR alias analysis can
then treat a sibling internal call as `NoModRef`, allowing FIR LICM to
hoist loads incorrectly.
Use the host procedure's existing global-capture set when lowering
canonical host globals. Exact symbol identity keeps OpenMP private
copies separate from their originals, and the existing alias-analysis
handling of `internal_assoc` protects the captured storage.
For example:
```fortran
program p
integer, save :: x = 0
print *, f()
contains
[29 lines not shown]
Fetch freebsd-kexts on arm64 too (#592)
nextbsd-kernel-extensions now publishes freebsd-kexts-<arch>.tar.gz for
both arches (autofs.kext is on arm64 too, nextbsd-kernel-extensions#7).
Fetch it per arch instead of on amd64 only, failing if it is missing.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LV] Model memory runtime checks with AddRec bounds in VPlan. (#231132)
Remove the restriction in attachRuntimeChecks that kept the IR-generated
memcheck block when a check group's bounds contain a SCEVAddRecExpr.
VPSCEVExpander now expands AddRecs of loops outside VPlan's scope as
VPInstructions, with only canonical IVs expanded to IR in the plan's
entry, which dominates the check block.
Depends on https://github.com/llvm/llvm-project/pull/230858
PR: https://github.com/llvm/llvm-project/pull/231132
[LV] Remove scalar resume phis when creating epilogue markers (NFC). (#236307)
Erase the resume phis in the main plan's scalar preheader directly in
preparePlanForMainVectorLoop, right after creating the ResumeForEpilogue
markers for them, instead of in a separate removeScalarResumePhis step
after the check blocks have been added.
NAS-144806 / 27.0.0 / Handle webshare sidecar units rate limits (#20038)
Discovered while working on
https://github.com/truenas/middleware/pull/20034
We reset rate limits on the systemd units (so that our explicit commands
are not rejected), but not on their auxiliary services. This might
result in partial webshare startup.
ports-mgmt/portlint: warn when depending on openldap-client directly
Add a check that flags direct dependencies on
net/openldap2*-client or databases/openldap2*-client,
suggesting USES+=ldap instead. The corresponding
-server port is exempted since that dependency is expected.
PR: ports/297834
Approved by: maintainer timeout
[BPF] Lower the atomic operations that there is no insn for (#235215)
BPF has add, and, or, xor, xchg and cmpxchg on 32 and 64 bits, load
acquire
and store release. The rest is an error:
atomicrmw xchg ptr %p, i8 %v seq_cst
unsupported atomic operation, please use 32/64 bit version
atomicrmw max ptr %p, i64 %v seq_cst
Cannot select: AtomicLoadMax
load atomic i64, ptr %p seq_cst, align 8
sequentially consistent (seq_cst) atomic load/store is not supported
fence acquire
Runtime fence is not supported at the moment
With load acquire and store release, -mcpu=v4:
- 8 and 16 bits: the minimal size of cmpxchg is 32 bits. AtomicExpand
widens
and, or, xor, and turns the others into a loop around cmpxchg of the
[26 lines not shown]
[BPF] Select undef and poison as zero (#235216)
An undef or poison value is selected as IMPLICIT_DEF: no insn, the
register
holds what it happens to hold. The verifier rejects a read of a register
that
was not written, whatever is done with the value.
Such values are not a sign of a bug in the source. In
%e = zext i64 %b to i128
%m = mul i128 %a, %e
with bits 0-63 of %m in use the upper halves of the operands don't
matter.
They are passed to __multi3() in r2 and r4, which nobody sets: "R4
!read_ok".
Select ISD::UNDEF and ISD::POISON of i32 and i64 as 'rX = 0'. Both get
[7 lines not shown]
lang/rust: Fix build with CPUTYPE and the WASM option
cc-rs appends the target specific CFLAGS_<target> to the generic CFLAGS
instead of replacing them, so the -march that CPUTYPE adds for the host
was also passed when compiler-builtins' C code is built for
wasm32-unknown-unknown, where clang rejects it:
clang: error: unsupported option '-march=' for target
'wasm32-unknown-unknown'
Clear CFLAGS/CXXFLAGS for the bootstrap and pass the flags per target
only, without -march/-mtune/-mcpu for wasm32. The flags for the host
target are unchanged.
Tested with lang/rust-nightly and CPUTYPE=skylake-avx512.
PR: ports/299355
Approved by: maintainer timeout
[BPF] Set the call frame size of the blocks that a select expands to (#236250)
A select is expanded to a branch and two new blocks. When that happens
between ADJCALLSTACKDOWN and ADJCALLSTACKUP of a call that passes
arguments on the stack, the new blocks have to say how big the call
frame is at their entry. ARM, AVR, LoongArch, M68k, PowerPC, RISC-V do
that. BPF didn't:
*** Bad machine code: Call frame size on entry does not match value
computed from predecessor ***
- function: f
- basic block: %bb.5 go
Call frame size on entry 0 does not match value computed from
predecessor 8
unwind-select-arg.ll of #235217 is the first test with such a call. It
fails with -verify-machineinstrs, which is the default in a build with
LLVM_ENABLE_EXPENSIVE_CHECKS. The invoke has nothing to do with it: a
call with six arguments, one of them a bool that is computed, fails the
[7 lines not shown]
[mlir][vector] Check the written dims when folding a write mask (#233244)
`isMaskTriviallyFoldable` compares dest dim `rankDiff + i` with index
`i`, so when the vector has fewer dims than the destination, it checks
dims against the wrong indices. `createWriteOrMaskedWrite` therefore did
not call it when given a permutation map, and kept the mask even when it
is all true. It now passes only the sizes and indices of the dims that
the map selects, and the mask shape, so the check runs for every map.
For example, vectorizing this with `vector_sizes [4, 4]`:
```mlir
%r = tensor.insert_slice %src into %dest[2, 6, 0] [4, 1, 4] [1, 1, 1]
: tensor<4x4xi32> into tensor<8x8x8xi32>
```
gave a write masked with `vector.create_mask` of sizes 6 and 8 on a
`vector<4x4xi1>`, which is all true. The write is now unmasked.
[9 lines not shown]
Fetch freebsd-kexts on arm64 too
nextbsd-kernel-extensions now publishes freebsd-kexts-<arch>.tar.gz for
both arches (autofs.kext is on arm64 too, nextbsd-kernel-extensions#7).
Fetch it per arch instead of on amd64 only, failing if it is missing.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>