[mlir][SCFToControlFlow] Remove dependency on the LLVM dialect (#238311)
SCFToControlFlow references LLVMDialect just to identify LLVM attributes
when propagating loop metadata. This introduces an unnecessary
dependency on the LLVM dialect implementation and further dependencies
transitively.
Identify attributes by dialect namespace instead, this will preserve
attribute propagation without having to reference LLVMDialect's type
identity. Also remove corresponding CMake and Bazel dependencies.
[LoongArch] Compute exact offset value in foldLargeOffset() (#242943)
foldLargeOffset() reconstructed the offset additively with a mask of the
bits overwritten later, which is only valid for the canonical sequences
produced by LoongArchMatInt where every instruction writes a disjoint
bit field. Non-canonical chains reach the pass when part of the constant
is materialized in another basic block, e.g. ORI on top of ORI, or ORI
after SLLI.D, and the computed offset was wrong:
ori 256; ori 1 -> g+1 (expected g+257)
lu12i.w+ori 0x678; ori 0xf -> g+305418255 (expected g+305419903)
ori 0xabc; slli.d 4; ori 0xf0 -> g+41200 (expected g+44016)
Collect the chain first, then evaluate it in program order with the
exact semantics of each instruction. The existing restrictions (single
non-debug use, no target flags, at most 4 instructions,
LU32I.D/LU52I.D/SLLI.D only with the pcala64 sequence) are kept.
Assisted-By: LLM
[LoongArch][NFC] Add tests for folding non-canonical large offset chains (#242942)
Add tests where the offset is partially materialized in another basic
block, so the offset chain seen by foldLargeOffset() is not in the
canonical form produced by LoongArchMatInt. The current output is wrong:
ori_ori: expected g+257, got g+1
ori_ori_overlap: expected g+305419903, got g+305418255
ori_slli_ori: expected g+44016, got g+41200 (large code model)
Assisted-By: LLM
swapoff: release vnode held since swapon
kern_swapon looks up the proposed swap path and aquires a vnode which is
held (unlocked) throughout the life of the swap device. In the device
case (swapgeom) it was never released in the swapoff path.
Remove an incorrect comment about swapgeom_close being called from
biodone. It is only called directly via swapoff(2) or at the end of the
shutdown path.
Reviewed by: kib, markj
Reported by: llm-postcr
MFC after: 3 days
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D61465
contrib/gcc-12: Patch gcc-ar.cc to find the liblto_plugin.so
We place all the tools and the LTO plugin in a common location:
/usr/libexec/gcc120, so need to patch gcc-ar.cc to search this location,
similar to the patch to gcc.cc.
[AMDGPU][NFC] Pre-commit test for true16 VGPR-to-SGPR copies of 16-bit subregs (#239230)
On gfx1250 (true16), a conditional f16 load whose value reaches a PHI
through a VGPR-to-SGPR copy is deleted: in the new test, the %ld block
ends up with only an implicit-def. Add the test with the current, wrong
output.
Co-Authored-By: Claude Opus 5.5 [noreply at anthropic.com](mailto:noreply at anthropic.com)
top: fix off-by-one in screenbuf
There is a heap overflow for screenbuf originating from
the top import to the tree. The i_process()/u_process() functions
write a terminating NUL one byte past each screenbuf line slot
when the line fills the slot, which is a 1-byte heap overflow on the last slot.
The display_resize() function allocates screen_width bytes per line.
i_process() and u_process() cut lines to screen_width characters and
then stpcpy() them into the slot, which writes screen_width + 1 bytes.
line_update() can do the same with *old = ch. For inner slots,
the NUL lands in byte 0 of the next slot. This can corrupt the saved
contents used when updating the next line. For the last slot, it writes
one byte past the end of screenbuf.
Fix by allocating (screen_width + 1) bytes per line and updating the
line offsets to fit the terminating NUL.
Reviewed by: kib
[3 lines not shown]
vendor/GCC120: Add back gcc-ar.cc and lto-dump.1
* gcc-ar.cc is required to build gcc-{ar,nm,ranlib} wrappers for LTO
function.
* lto-dump.1 is the man page for the lto-dump utility to be installed.
[libc] Leave mmap offsets with the top bit set to the kernel (#239985)
The kernel reads the mmap offset as unsigned, and drivers use its top
bits
to tell mappings apart: KFD's doorbells sit at 0xebff000000000000.
Rejecting
negative offsets in libc made ROCr's doorbell mapping fail, and HIP then
died on its first dispatch. mmap2 keeps the check, as there the offset
is
divided before it reaches the kernel.
AI disclosure: this patch was written with Claude Code. I reviewed the
change.
Assisted-by: Claude
security/hashcat: fix build on powerpc64le
Build with MAINTAINER_MODE=1 so the bridges don't get -march=native.
Clang 21 rejects it on powerpc and packages shouldn't use it anyway.
lang/pocl: backport fix for crashes with big work-groups
Worker threads were created with the default 2 MB stack, which is too
small for kernels that keep a lot of private data per work-item.
Programs like hashcat crash because of that.
Obtained from: https://github.com/pocl/pocl/commit/0222df2be566a3e74816f6ba9856efae7d1a8d80
editors/gram: fix build on powerpc64le
Pull in the upstream fix for KINFO_FILE_SIZE, which is only defined on
amd64 and i386. The vendored minidump-writer and crash-handler crates
also lack powerpc64 in their arch switches.
Approved by: portmgr (blanket)
devel/simde: fix the roundeven fallback on powerpc64
clang turns __builtin_roundeven into a roundeven() call when there is no
native rounding instruction and our libm doesn't have it, so consumers
fail to link on powerpc64. Backport the glibc check from simde
6b772fe4e9a0 and cb5b957aa7db.
Approved by: portmgr (blanket)
audio/surge-synthesizer-xt-lv2: fix build on powerpc64
The bundled simde uses __builtin_roundevenf when there is no VSX and
clang turns it into a call to roundevenf, which our libm doesn't have.
Backport the glibc check from simde 6b772fe4e9a0 and cb5b957aa7db.
Approved by: portmgr (blanket)
sysutils/mise: fix build and runtime on powerpc64
sonic-number refuses to build on big-endian and sonic-simd's portable
fallback puts the bitmask bits in the wrong order there, so sonic-rs
runs off the buffer on the first string it escapes. Backport the fix
from cloudwego/sonic-rs#265.
www/waterfox: fix build on powerpc64
The WASM sandbox isn't available on big-endian, so only pass
--with-wasi-sysroot and pull in the wasi dependencies on other
architectures, like www/firefox does.
math/kalc: fix build on powerpc64
The bundled GMP fails its own make check with clang 21: the PowerPC inline
asm only clobbers "cc", so clang keeps a carry in XER across it and
mpn_div_qr_1 comes out wrong. Declare "xer" too.