RegAlloc: Fix dead flags of defs after failed allocation (#233796)
After an allocation failure, the error register may be assigned to
multiple defs of the same instruction. If one of these is dead and
another live, the instruction fails the verifier check added in #233110.
In RegAllocBase, add the failed defs to the error register's regunit
live ranges so a later assignment cannot also def it, and make the dead
flags of the error defs agree with any def already assigned the
register. In RegAllocFast, clear the dead flags of registers with a
live def on instructions using an error assignment.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[HLSL] Add the `SV_Barycentric` semantic (#233510)
Implements diagnostics, lowering and serialization of the
`SV_Barycentric` semantic for directx and spirv.
Resolves: https://github.com/llvm/llvm-project/issues/210786
Assisted by: ChatGPT Sol 6.1
x11-wm/dwm: Add a RUNTIMEKEYS option
dwm reads key bindings from the root-window property
_DWM_KEYS while it is running. The option is off by default.
Reviewed by: fuz
Differential Revision: https://reviews.freebsd.org/D60933
[mlir][scf] Add scf.execute_region to the structural type conversions (#234405)
This change adds support for `scf.execute_region` to
`populateSCFStructuralTypeConversions`. `scf.execute_region` seems to be
an omission, so this change simply fills a hole.
Add `ConvertExecuteRegionOpTypes` (patterned after `ConvertIfOpTypes`)
to convert the types of `scf.execute_region` and add that to the list of
patterns in `populateSCFStructuralTypeConversions` and legality in
`populateSCFStructuralTypeConversionTarget`.
Also adds a unit test to check for type conversion in
`scf.execute_region`.
Assisted-by: Claude
RuntimeLibcalls: Fix signatures of fmin/fmax libcalls
These used Floating, which always lowered to float regardless of the
libcall type.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for simple FP libcalls
Add signatures for the FP arithmetic, fma, powi, fminimum/fmaximum and
sincospi libcalls, and for the conversions between f32/f64/f80/f128/
ppcf128 and i32/i64.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[CIR] Add 'loop-id' to loop and branch types. (#235052)
While working through the loop-hints lowering, I discovered that we need
a way to make each loop get a 'distinct' loop-annotation in LLVM-IR.
This relationship is lost during FlattenCFG when it splits to multiple
branches. #233890 adds this to the LLVM-IR dialect.
I considered/had a patch to do this to FlattenCFG as well, however when
working on further loop hints (parallel in particular), we need to be
able to spread this value inside of the loop itself, so it makes more
sense to generate the ID from the start.
I suspect this ID will come in handy outside of the loop-hints, so it is
left as a separate attribute.
[AtomicExpand] Let targets keep the release fence out of the reservation (#214867)
`expandAtomicCmpXchg` sinks the leading fence into
`cmpxchg.fencedstore`, between the load-linked and the
store-conditional. A strong cmpxchg recovers, because its retry
re-reserves after the fence. A weak cmpxchg has no retry, so where a
fence clears the reservation it can never succeed.
On a 32-bit PowerPC e500v2, `compare_exchange_weak` with any release
ordering never succeeds. One thread, an uncontended cell, a million
consecutive failures:
```
[atomic: compare_exchange_weak] NO PROGRESS after 1000000 tries in 2.28s
[atomic: compare_exchange] ok
[atomic: fetch_or + fetch_add] ok
```
`fetch_update` in Rust's core is a `compare_exchange_weak` retry loop,
[54 lines not shown]
RuntimeLibcalls: Use a single LibcallImpl for long double functions
Replace the per-format <func>l_{f80|f128|ppcf128} implementations with
a single <func>l implementaton. The concrete type is now derived from
the module/triple's LongDoubleFormat, so this is no longer a static
property.
On targets where long double is double, the l-suffixed functions do
not provide a libcall. This could be fixed in principle, but nothing
would use it in the compiler.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Emit signatures per libcall implementation
Index the signature table by RTLIB::LibcallImpl instead of
RTLIB::Libcall. RuntimeLibcallImpl inherits the signature of the
libcall it provides by default, but an implementation can now override
it. This will help avoid having multiple copies of the same libfunc
for every long double type.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use explicit types for F80, F128 and PPCF128 libcalls
LDbl only makes sense for encoding the long double libm functions. Other
functions have need of the specific type. Separately, LDbl brokenly assumes
double instead of checking the module's long double format. Some functions
are inappropriately using a specific type instead of LDbl. I'll fix both
of these issues separately.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for atomic libcalls (#233601)
Define type signatures in tablegen for the various atomic
library functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
ARM: Stop adding kill flags on new virtual registers (#235113)
Continue purging uses of kill flags.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
openssl: build libcrypto and libssl from upstream's source set
Compared the bmake source lists of libcrypto and libssl with upstream's
own build of 3.5.8 (configured with the options in
crypto/openssl/BSDmakefile), and fix the differences that are not
intentional.
libcrypto:
- aarch64: build bsaes-armv8.S and md5-aarch64.S, and define BSAES_ASM
and MD5_ASM, as upstream does. Both files have been generated into
sys/crypto/openssl/aarch64 since the 3.5.1 import, but were never
compiled.
- Stop compiling der_digests_gen.c, der_dsa_key.c and der_ec_key.c.
Upstream keeps them in libcommon.a, but the linker does not extract
them into libcrypto (checked with --why-extract) as nothing in
libcrypto references them.
libssl:
- Fix the "SRSC" typo that left out ssl3_cbc.c and tls_pad.c.
[17 lines not shown]
openssl: configure with --openssldir=/etc/ssl
BSDmakefile passed --openssldir=etc. A relative openssldir is taken
relative to the prefix, so the generated files described /usr/etc.
FreeBSD has always used /etc/ssl (OPENSSLDIR in
secure/lib/libcrypto/Makefile.common), so configure with that.
Regenerate tools/c_rehash, the only committed generated file that
depends on openssldir. It is not installed. No compiled code changes.
Reviewed by: ngie, markj
Differential Revision: https://reviews.freebsd.org/D60396
(cherry picked from commit cb3d3e5bb0c6bbb1f6ef3efe67e7a6e71bc20f0b)
[MemProf] Fix remapping of matching calls when assigning function clones (#231242)
When a function has several calls with identical callsite metadata, they
are recorded on one context node with the extra calls in
Node->MatchingCalls. If that function is cloned by context
disambiguation, assignFunctions must remap each version's matching calls
through the function clone's CallMap, the same way it remaps the primary
Call.
Two problems in the IR path:
* AssignCallsiteCloneToFuncClone rewrote the matching calls of the
original node (Node->MatchingCalls) instead of those of the callsite
clone being assigned. The clone node (whose MatchingCalls were copied
from the original at creation) kept the original instructions, and the
original node's list was overwritten with the clone's. UpdateCalls then
updated each function version's matching calls with the other version's
callee clone, i.e. swapped.
[15 lines not shown]