[mlir][acc] Clone `scf.execute_region` blocks in dominance order (#248375)
`ACCCGToGPU` cloned the blocks of an `scf.execute_region` in region
order. A block can come before a block that dominates it and use values
defined there, e.g. after a forward branch into a loop built from
branches. Such a use was cloned before its value was mapped, so the
clone kept using the original value, and erasing the original
`acc.compute_region` asserted with "expected that op has no uses".
Clone the blocks in reverse post-order, which visits every block after
the blocks that dominate it.
Assisted-by: Claude Code (Claude Opus 5.5)
[RISCV][NVPTX] Expand scalar FMINIMUM/FMAXIMUM without Zfa (#233254)
Use legal FMINIMUMNUM/FMAXIMUMNUM operations in the generic expansion to
preserve signed-zero behavior without extra fixups. Expand non-Zfa
f32/f64 minimum and maximum operations and update RISC-V and NVPTX
codegen checks.
Updates #173446.
[orc-rt] Make IntervalMap insert/erase of empty range a no-op. (#248807)
Previously, inserting an empty range could store it in the map, and
erasing an empty range from the interior of an existing range would
split that range into two adjacent ranges with the same value. Both
violate the map's invariants.
Empty ranges are legitimate inputs (e.g. zero-sized sections), so insert
and erase now return early for them in all build modes, matching
llvm::AddressRanges. Reversed ranges (KS > KE) are asserted against.
vm_page: Make every shared unbusy a release
vm_page_sunbusy() and vm_page_busy_release() drop a shared busy that
other threads still hold with a relaxed atomic_fcmpset_int(). Only the
last sharer's update is a release, but any sharer can modify the page.
The next thread to busy the page exclusively synchronizes with the last
sharer's release, so on weakly ordered CPUs it need not see the changes
by a sharer that was not the last.
Found by: Claude Code (Opus 5.5)
Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D62391
[GVN] Scan MemUses of the clobber found by the MemorySSA walker
Previously, if the clobber found in Phase 1 is a MemoryPhi or a
MemoryDef outside the current BB, we proceed directly to Phase
2/3. However, the clobber returned by the walker may still have users
in the current BB, which can be candidates for available values.
As a result, we add support for scanning MemoryUses of the clobber
returned by the walker before proceeding to Phase 2/3.
Assisted-by: Claude # Test
[X86] Handle more INLINEASM_BR shapes in X86FlagsCopyLowering
A copy before an INLINEASM_BR that leaves EFLAGS alone reaches the asm's
indirect targets, but the pass stopped at a later redefinition of EFLAGS
in the block and never rewrote the reads there. It could also hoist the
test position to the end of a block with an asm, which the indirect path
skips, and splitting a block between two conditional branches moved the
asm's indirect edges to the new block.
Follow the copy into the indirect targets of an asm that it reaches,
don't hoist the test into a block with an INLINEASM_BR, and keep the
asm's indirect edges in the first half of a split block. A block that
both the copy and an indirect path from an asm before it reach needs a
PHI, which the pass can't insert, so report it as it already does for a
use that the copy doesn't dominate.
Assisted-by: Claude Opus 5.5
[orc-rt] Add IntervalMap::overlaps. (#248794)
IntervalMap::overlaps(KS, KE) returns true if [KS, KE) overlaps any
range in the map. An empty query range [P, P) overlaps only ranges that
strictly contain P, matching ExecutorAddrRange::overlaps.
IntervalMap will be used in upcoming patches that register memory
ranges, and the overlaps operation will allow us to verify that new
registrations don't overlap old ones.
[clang][Sema] Handle length modifiers with OpenBSD kernel printf %b (#120689)
The OpenBSD kernel printf %b takes a length modifier, like %x, and
reads the value with the type it gives. sparc64 has various %llb
formats. Check the length modifier and the value type for %b when
targeting OpenBSD. FreeBSD %b only takes an int, so it stays as is.
Assisted-by: Claude Opus 5.5
[Mips] Preserve filled delay slots in inline asm division macros (#233235)
In reorder mode, wrap branches whose delay slots an expansion fills
itself in .set push/noreorder/pop, so the textual output (e.g. inline
asm) doesn't get a second delay slot when assembled again. Also fill the
mulo/mulou overflow check delay slot in noreorder mode, like div already
does.
As @brad0 remind, for abs on main branch current we will also get the
wrong code: bgez gets an extra nop, and the hardcoded offset lands on
neg. After this pr, it will also be fixed.
Fixes #174909