powerpc/pmap: Use dcbz to zero pages in the radix pmap
pagezero() was a plain store loop (bzero), which under the kernel build
flags (-mno-vsx -msoft-float) compiles to byte stores. dcbz
establishes a zeroed cache line directly in the cache without a
read-for-ownership fetch from memory, roughly halving the memory
transactions of page zeroing.
Measured on POWER9 (Raptor Blackbird, DD2.3, bare metal), zeroing a
cold 256 MB buffer with 128-byte scalar loops:
byte stores (current libkern memset) 8.6 GB/s
doubleword (std) stores 26.8 GB/s
dcbz 34.6 GB/s
dcbz raises an alignment interrupt on caching-inhibited mappings, and
the kernel does not emulate it, so mmu_radix_zero_page() falls back to
bzero() for any page whose memattr is not the write-back default. The
internal pagezero() callers only touch freshly allocated page-table
[11 lines not shown]
[flang] Address review comments on chained concatenation fusion
Let concatenation fusion cross operations that only allocate, like the
hlfir.declare of a character literal operand, so that chains ending with a
literal are fused into one buffer. Only operations that may write or free
memory, or whose effects are unknown, now prevent the fusion.
Remove CharacterExprHelper::createConcatenate, which no longer has users.
Add bufferization tests for concatenations whose operands all have a
compile-time length, and for character kind 4.
[flang] Fuse chained character concatenations into one buffer
Lowering creates one binary hlfir.concat per // operator, so a // b // c
was evaluated into an intermediate buffer that was then copied into the
result buffer. Add a canonicalization that folds a single-use hlfir.concat
into its user when no operation in between may modify or release its
operands, and bufferize hlfir.concat with any number of operands. The
buffer is now sized with the hlfir.concat length operand, which can be
computed outside of elemental loops, instead of the sum of the operand
lengths computed in the loop body.
[flang] Track character temporary lifetimes for safe stack placement
Dynamic character expression buffers could grow the stack on every
iteration of an unstructured loop because their lifetimes were hidden
from allocation placement. Emit hlfir.destroy for them, add an explicit
cleanup region to hlfir.yield_element, and preserve both through array
constructor lowering, elemental inlining, WHERE lowering and
bufferization, which now allocates these buffers with fir.allocmem.
When such an allocation cannot be hoisted out of the loop, reclaim its
stack space with one stacksave/stackrestore pair per block. Allocation
placement then keeps these temporaries on the stack in every mode,
including offload regions (except under -fdynamic-heap-array).
[flang] Address review comments on character temporary lifetimes
- stack-arrays: accept blocks with properly nested stacksave/stackrestore
pairs, such as the ones around calls with a runtime-length result, as
long as the allocations made inside a pair are freed before its end.
These allocations then reuse that pair.
Document that the block scope makes the peak stack the sum of the
promoted allocations.
- Only create a cleanup region from the current statement context scope,
so that array constructors do not get empty cleanup regions that block
elemental inlining.
- Always allocate kind conversion buffers on the heap and let allocation
placement move them to the stack, so that constant-length ones are
hoisted out of loops.
- Canonicalize away the hlfir.concat, hlfir.char_trim, hlfir.set_length
and hlfir.char_extremum results whose only uses are hlfir.destroy, such
as the SET_LENGTH bypassed by structure constructor lowering.
- Do not let hlfir.associate take over the storage of an hlfir.no_reassoc
operand that has other uses.
- Use %flang_fc1 in the new Fortran tests.
build: take the OS major from the target headers
OSMAJOR is the compiler builtin __FreeBSD__, which describes the compiler
target: with a cross compiler, such as the native-xtools toolchain of a
poudriere jail, it holds the version of the host instead of the version of
the system pkg is built for. The comparison with the ABI of the running
userland then fails and pkg warns about a major OS upgrade on every call,
and the default INDEX file name is wrong as well.
Query the version from the target headers at configure time and inject it
as a literal, the value is also stringified to build the INDEX file name.
Fixes: #1695
[clang-tidy] Make bugprone-argument-comment useful for C code (#237623)
systemd wants a /*name=*/ comment on every argument that is passed as a
bare
NULL, 0, true or false, and proposes a libclang script to check it
(https://github.com/systemd/systemd/pull/43725).
bugprone-argument-comment
can't do this for C code. It skips literals that come from a macro, and
C
spells NULL, and true and false before C23, with macros. It also skips
calls
in macro arguments such as assert_se(f(NULL)).
Let's add an IgnoreMacros option. When it's false, the check also adds
missing
comments to calls in macro arguments. CommentNullPtrs and
CommentBoolLiterals
now match the macros in the new NullPtrMacros and BoolLiteralMacros
options,
[18 lines not shown]
[mlir][ComplexToStandard] Preserve sign of zero im part in exp lowering (#242359)
The current logic sets `isYZero` to true when `y == +0` or `y == -0`,
and then sets the imaginary part to `+0`, discarding the initial sign.
This PR fixes this by instead setting the im part to y when `isYZero` is
true.
[AArch64][SystemZ] Don't crash on inline asm non-simple reg ops (#242225)
An aggregate operand whose size is not 1, 8, 16, 32, 64 or 128 bits has
ConstraintVT == MVT::Other. getRegForInlineAsmConstraint called
getSizeInBits() on it for the 'r' and 'x' constraints on AArch64 and the
'r', 'd', 'f' and 'v' constraints on SystemZ, hitting llvm_unreachable.
Return no register class for MVT::Other so the usual "cannot handle
indirect register inputs" / "could not allocate output register"
diagnostics are reported instead.
This is in line with already existing checks, e.g. on AArch64 for other
asm constraints (`w`).
Fixes #239086
Assisted-by: IBM Bob
powerpc/pmap: Use dcbz to zero pages in the radix pmap
pagezero() was a plain store loop (bzero), which under the kernel build
flags (-mno-vsx -msoft-float) compiles to byte stores. dcbz
establishes a zeroed cache line directly in the cache without a
read-for-ownership fetch from memory, roughly halving the memory
transactions of page zeroing.
Measured on POWER9 (Raptor Blackbird, DD2.3, bare metal), zeroing a
cold 256 MB buffer with 128-byte scalar loops:
byte stores (current libkern memset) 8.6 GB/s
doubleword (std) stores 26.8 GB/s
dcbz 34.6 GB/s
dcbz raises an alignment interrupt on caching-inhibited mappings, and
the kernel does not emulate it, so mmu_radix_zero_page() falls back to
bzero() for any page whose memattr is not the write-back default. The
internal pagezero() callers only touch freshly allocated page-table
[11 lines not shown]
mail/imapgoose: Fix build on i386
While here, adopt the new USE_FORGEJO helper to simplify the Makefile.
PR: 300811
Approved by: osa, vvd (mentors, implicit)
[CGP] Drop support for non-gep address sinking (#242387)
We had two address sinking implementations, one using geps and the other
using ptrtoint + add + inttoptr. There was a TTI hook to control this,
but due to the way the check was performed, the gep mode was effectively
always enabled.
There is no good reason to ever use the non-gep sinking logic (which
does not preserve provenance information) and the code is effectively
dead right now, so delete it entirely.
[JumpTableToSwitch] Use ConstGlobalIterator to read jump table entries
Replace JTTS's own jump table parsing with the `ConstGlobalIterator` helper,
which is also used by instcombine's `foldCmpLoadFromIndexedGlobal`.
As a result JTTS now also handles GEPs without nusw/nuw flags, by masking the
index the same way instcombine does.
Note that the helper requires the indices to be in canonical index type, so
JTTS only works with canonical index types now. This is not a problem in
practice as JTTS only runs after instcombine.
pkg-upgrade.8: document the downgrade of --force
Every installed package is upgraded to the version offered by the
repositories when -f is given, including when that version is older than
the installed one.
sched_ule: Fix two typos in comments introduced in previous commit
Reported by: kib
Fixes: 538c48bf6247 ("sched_ule: Fix rare deadlock on stealing a migrated lock-blocked thread")
Sponsored by: The FreeBSD Foundation
[mlir][Vector] Reuse args buffers in WarpOpToScfIfPattern (#204311)
Args buffers are unused after lane 0 reads them inside the scf.if (the
Step 3 barrier fences other lanes), so reuse their storage for yielded
values via `memref.subview` when sizes are compatible. Reduces shared
memory footprint with no runtime overhead.