[flang] Mark all visible Cray pointer targets (#241388)
When a Cray pointer is set to a variable's address, flang gives that
variable the TARGET attribute so alias analysis knows the pointee can
modify it. It only caught `ptr = loc(x)` with nothing else on the
right-hand side, and it only marked `x`.
This patch marks anything passed to LOC or %LOC anywhere in the
procedure, its host or their internal procedures, however the result
is used. It also marks the variable behind an ASSOCIATE name,
everything that shares storage with a marked variable through
EQUIVALENCE or COMMON, and assumed-shape dummies, which were missed
before.
This fixes an EQUIVALENCE case that is already wrong at -O1 on main,
and it is needed before #230699 can remove the runtime call on
pointee references.
Assisted-by: Claude Code
[3 lines not shown]
lang/idris2: Improve port
- Pet port{clippy,fmt,lint}.
- Simplify building and installing the port.
- Remove leftover file from pkg-plist after using sed.
- Use %%VERSION%% substitution in pkg-plist to reduce large diffs.
Reported by: arrowd
Approved by: Jens Grassel <freebsd-ports at jan0sch.de> (implicit)
[libc][string] Optimize stpncpy() with strnlen() and inline_memcpy() (#246447)
The current stpncpy implementation copies characters using a byte by
byte loop before padding trailing null bytes with inline_bzero. Replace
the copy loop with internal::strnlen and inline_memcpy to leverage
vectorized string and memory operations, matching strncpy.
In a microbenchmark copying a 512 byte string into a 1024 byte buffer,
this reduces execution time by about 83%, or 6.1x faster.
[SPIRV] Enable NSDI features by default for AMD
Enable -spirv-debug-lexical-block-discriminator-scope,
-spirv-debug-scope-forward-refs and -spirv-debug-declare-untyped-variable
when the target vendor is AMD.
[SPIRV] Add flag to allow OpUntypedVariableKHR in DebugDeclare (#244305)
This PR lets `DebugDeclare` use an `OpUntypedVariableKHR`.
[NonSemantic.Shader.DebugInfo](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugDeclare)
requires that _Variable_ operand to be an `OpVariable`, so the new
behavior is off by default and enabled with
`-spirv-debug-declare-untyped-variable`.
On `spirv64-amd-amdhsa` the backend enables `SPV_KHR_untyped_pointers`.
Ordinary allocas are then emitted as `OpUntypedVariableKHR`, so a
`DebugDeclare` for those locals has no `OpVariable` available. This
showed up while running the ROCgdb test suite with the SPIR-V backend.
A follow-up PR will enable this flag by default for
`spirv64-amd-amdhsa`, along with the other NSDI emission defaults for
that triple. I would also be happy to work towards allowing this in the
specification for `DebugDeclare`. The reverse translation was also
validated with the SPIRV-LLVM-Translator.
Live ISO: find the boot media by its NEXTBSD label only (#381)
/init took any /dev/cd0 as the boot medium. The mfsroot is the root
file system, so mountroot never waits for USB: on a machine with an
optical drive, cd0 attached before the USB stick, the settle loop
stopped on it, mount_cd9660 failed (no disc), and the one-pass
candidate loop gave up seconds before da0 and iso9660/NEXTBSD
appeared. init then pivoted into an empty union and the kernel
panicked: Going nowhere without my init!
Look only for /dev/iso9660/NEXTBSD, which GEOM_LABEL gives the
volume on a burned disc and on a USB stick alike. Retry each second
for up to 60 s until it mounts and holds rootfs.uzip, unmounting a
volume without one. If it never turns up, say so, list the labels
and disks, and hold a shell on the console; exiting it looks again.
No optical drive, one, or several make no difference now.
Closes #381
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Use the latency metric to break RP ties in the initial stages (#243116)
When neither pressure was less than the other in mayCauseSpilling, the
schedule was reverted based on the tie. In the initial stages, the old
schedule would be just the input order, so a tie could discard a
schedule and go back to the input order that was never selected for
latency.
Add a new helper, shouldRevertInitialSchedule, for the initial stages.
It reverts when mayCauseSpilling returns true, unless there is a tie in
the before/after register pressure and the new schedule reduces latency.
The Max Occupancy, ILP, and Memory Clause initial stages use this new
helper. The later rescheduling stages keep reverting on a tie, since
their old schedule was already chosen by a previous stage.
Fixes LCOMPILER-3191.
Assisted-by: Cursor/Claude Opus
[2 lines not shown]
[ARM] Never use symbolic register names in .cfi directives for old binutils (#246661)
GNU as handles named CFI registers since version 2.25. To remove the
virtual function from MCAsmInfo, always disable register names in CFI
directives if we are unsure whether they are supported in the end; as it
is unknown at this point whether the integrated assembler will be used,
do this always when the binutils version is explicitly lowered. (Note
that binutils-version defaults to 2.26.)
This saves ~400B of .data.rel.ro.
[mlir][tosa] Require unsigned attribute to be set for unsigned types (#245666)
TOSA carries signedness information via operator attributes
input_unsigned and output_unsigned. This is because tensor data types
are expected to be signless. However, the dialect implemenation also
allows unsigned inputs and outputs to help with conversion. This commit
changes the verifiers of both cast and rescale to ensure the operator
attribute and input/output type are consistent when the input/output
type is unsigned.
bhyve: add basic tests
Add sanity checks for:
* bhyve -l help
* bhyve -s help
* bhyve -o help
* bhyve -o config.dump=1
Validate that commands run successfully, have no duplicates,
sorted where applicable, and the dumped configuration can be consumed
again with the -k option.
Reviewed by: ngie, Osvaldo Janeri Filho <ojanerif at amd.com>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D60981
[CodeGen][AArch64] Expand two lane interleave to shuffles (#243155)
Build each result with a two lane shuffle of two input vectors.
This produces pairwise zip shuffles and avoids costly structured loads
and stores.
[MC][NFC] Remove MCAsmInfo::getStackSection (#246690)
Remove the ELF-only function in favor a bool indicating whether the
section should be emitted (i.e., not Solaris and not BPF).
The downside is that this duplicates the name ".note.GNU-stack" into
AsmPrinter and MCELFStreamer, which seems acceptable as it is unlikely
to change. (Alternatively, this could be a new virtual hook in
MCStreamer, but I'd rather not add that, as the vtables of
MCStreamer+subclasses already take 58 kiB.)
This saves ~400B of .data.rel.ro.
[AMDGPU] Ignore EXEC writes that cannot zero EXEC for VA_VDST
Only an EXEC write that may produce zero can cause later VALUs to be
skipped. Moves of a nonzero immediate, ORs and WQMs of EXEC, and
S_OR_SAVEEXEC keep a nonzero EXEC nonzero, so pending VA_VDST accesses
keep their credit across them.
Assisted-by: Claude
[AMDGPU] Stop crediting skippable VALUs as VA_VDST successors
When EXEC is zero most VALUs are skipped and never increment VA_VDST,
but lane accesses, V_NOP, VALUs that write an SGPR, VCC or NULL, and
WMMA/SWMMAC are still issued. A skipped VALU therefore must not count as
a successor of a pending access that was issued, which happens across
EXEC writes and after these always-issued VALUs.
Mark pending accesses at EXEC writes, and the accesses of always-issued
VALUs. A marked access keeps the count it had already earned and is
otherwise credited only by later always-issued VALUs and ordered XDL
writes. A later skippable access to the same register does not clear
the mark. Partial waits keep unsatisfied marked accesses pending, and
merges take the smaller count.
Assisted-by: Claude