[KnownFPClass] Refine `KnownFPClass::bitcast` deductions for `x86_fp80` (#224072)
Improves `KnownFPClass` deductions `i80` to `x86_fp80` bitcasts.
Non-canonical NaN's are treated as `fcSNan` if the quiet bit is known
clear, and `fcQNan` if the quiet bit is known set.
AI Disclosure:
I used ChatGPT Codex (5.6 sol and Astra-6) and Claude (Sonnet/Opus 5) to
help generate the tests and to review the code.
[libc++] Suppress unsigned-integer-overflow warning in <charconv> (#225801)
Invoking __complement with 0 as parameter triggers the unsigned integer
overflow UBSan.
[lldb][minidump][test] Disable test_size_of_image... when remote testing (#231498)
The test assumes that the program can load the shared library, which it
cannot unless we copy it to the remote.
The shared library is also built outside of the usual build process, so
it's using the host compiler and possibly other host things.
[X86] Don't form (FM)ADDSUB for bf16, or for narrow f16 vectors without VLX (#231445)
The shuffle combines that form (FM)ADDSUB only check for FMA, and only
exclude f16 from ADDSUB. There are no bf16 (FM)ADDSUB instructions, and
the AVX512-FP16 FMADDSUB needs VLX for 128/256-bit vectors. So an
add/sub shuffle of `<8 x half>` with `+avx512fp16` but no VLX, or of `<8
x bfloat>` (from FSUB/FADD or from FMA/FMSUB) with `+avx10.2`, fails to
select:
```
LLVM ERROR: Cannot select: t16: v8f16 = X86ISD::FMADDSUB t2, t4, t6
LLVM ERROR: Cannot select: t20: v8bf16 = X86ISD::FMADDSUB t7, t8, t9
```
Check the element type in both combines: reject bf16, and accept f16
only where f16 FMA is legal for the vector type (512-bit with
AVX512-FP16, 128/256-bit also with VLX). The new tests cover
128/256/512-bit f16 with and without VLX, and bf16 with and without
`contract` and from FMAs; the f16 no-VLX and bf16 RUN lines crash
[6 lines not shown]
System: Trust - openssl_x509_parse() and friends only evaluate the first certificate found and ignores the rest, which means we should ensure only a single certificate is actually offered for certs and ca's.
This improves the general validation of imported certificates.
PR: GHSA-7wvp-6m2q-953c
[flang] Fix null pointer dereference in OUT_OF_RANGE folding (#224270)
Folding `OUT_OF_RANGE` could crash when the default logical kind is
8:`CompareUnsigned` assumed intrinsic comparisons always yield
`LogicalResult`(LOGICAL(4)). Unwrap as `SomeLogical` and convert to
`LogicalResult`.
Add a `fold-out_of_range.f90` RUN line with `-fdefault-integer-8` and
a`test_kind` check.
Fixes #212392
[AMDGPU] Widen scalar bf16 minimumnum and maximumnum to packed ops (#230467)
Promote scalar bf16 minimumnum and maximumnum to v2bf16 on targets with
packed BF16 instructions. This uses the existing scalar-to-vector
legalization and selects a single packed min/max instruction on gfx1250.
Add gfx1250 coverage in both register modes to the existing BF16 min/max
tests.
Fixes #230156
Assisted by GPT 6.1 Sol
pf: Set the reassembly flags under the rules lock
DIOCSETREASS stored V_pf_status.reass twice with no lock, first the
flags it was given and then, if reassembly was not among them, zero.
pf_normalize_ip() and pf_normalize_ip6() read the flags with the rules
lock held for reading, so a packet could see the intermediate value.
Compute the flags first and store them once, with the rules lock held
for writing, as DIOCSETDEBUG and DIOCSETHOSTID do.
Reviewed by: kp
Fixes: 39282ef356db ("pf: backport OpenBSD syntax of "scrub" option for "match" and "pass" rules")
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60531
[orc-rt] Add connectors for tcp:connect and tcp:listen. (#231473)
registerTCPConnect registers a "tcp" connector that supports only
"connect". registerTCPConnectAndListen registers one that also supports
"listen", and is used instead of it. A process that should be reachable
only by the controller it names never links the code to listen.
Descriptors are "<host>:<port>" or "[<IPv6 address>]:<port>". The host
for "listen" must be a numeric address. A listening executor accepts one
controller and then stops listening. It must name its port, since
nothing would report one the system chose. TCP does not identify the
peer, so both actions trust it as VettedPeer::unchecked.
On Windows, the TCP primitives and the socket CA are stubs that report
the transport as not yet supported.
ogre now registers registerTCPConnectAndListen, so it accepts
"tcp:connect" and "tcp:listen" specs as well as "socket:adopt".
Assisted-by: Claude
[examples] Set target triple on modules in examples. (#231480)
If no triple is set then the object format component of the Module's
triple will be set by getDefaultFormat in Triple.cpp, typically to ELF.
In AArch64AsmPrinter::emitStartOfAsmFile, the "ELF" default will cause
control to fall through the following check:
if (!TT.isOSBinFormatELF())
return;
and into a region that assumes an MCTargetStreamer. On Darwin/arm64,
which does not set an MCTargetStreamer, this will cause a nullptr
access.
Fix the issue by setting the Module's triple to the host triple.
Updates examples not fixed earlier by commit 9b989cbefc7.
rdar://189532634
pf: first-match-wins for nat rules, even in anchors
Ensure we stop evaluating nat rules if we find a match in a nat-anchor.
PR: 299320
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
[SLP]Recalc deps for copyable scalars of cancelled bundles
Only the non-copyable members of a cancelled bundle of a trimmed node
were marked for the dependency recalculation. Copyable scalars kept
stale dependencies, were never picked by the final scheduling and
stayed far from their users, extending live ranges. This regressed
709.cactus_r by 2% on Grace.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/231499
tests/netinet6: Turn off stable addresses in ndp_prefix_len_mismatch
ndp_prefix_len_mismatch exercises the fallback in in6_ifadd() for an
interface whose link-local address does not have the advertised prefix
length (9e792f7ef729). Since a2eb0894b79b made stable addresses
(RFC 7217) the default, in6_ifadd() takes the interface identifier from
in6_get_stableifid() and never looks at the link-local address, so the
case passes without reaching the fallback. Turn stable addresses off
on the interface.
Sponsored by: Rubicon Communications, LLC ("Netgate")
[libc++] Optimize basic_string::operator=(const value_type*) (#227622)
This refactors `__assign_no_alias` to accept aliased strings and uses it
in `assign(const value_type*)` (which `operator=` forwards to).
[lldb][test] Attempt to fix flakyness of TestEmptyThreadList.py (#231486)
Has failed in CI and our buildbots, on AArch64 and x86_64.
```
FAIL: test_thread_list_goes_empty (TestEmptyThreadList.TestEmptyThreadList.test_thread_list_goes_empty) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/functionalities/gdb_remote_client/TestEmptyThreadList.py", line 61, in test_thread_list_goes_empty
self.assertState(process.GetState(), lldb.eStateStopped)
File "/home/buildbot/workspace/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 3117, in assertState
self.fail(self._formatMessage(msg, error))
AssertionError: exited (10) != stopped (5)
Config=aarch64-/home/buildbot/workspace/lldb-aarch64-ubuntu/build/bin/clang ----------------------------------------------------------------------
```
My theory is that "S13" is being mapped to 19 aka SIGCONT in the base
UnixSignals list. This has stop=False, so when the test passes, the
empty thread path wins and we stop. When it is failing, it's because
that auto resume executed first.
To fix this use SIGTRAP which has stop=True. Fixes #227396.
hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class
The IRPERF MSR counter (0xc00000e9) exposes an instructions-retired count
when read. Its support is advertised through CPUID leaf 0x80000008 EBX bit 1.
If this bit is set, the CPU supports the IRPERF MSR. For it to be used
by the system, bit 30 of the HWCR MSR (0xC0010015) needs to be enabled.
This patch checks for availability of the feature and enables the bit. If
the feature is available, the hwpmc PERF class detects its presence and
registers a third PERF MSR counter that allows hwpmc users to measure
instructions retired using IRPERF. This is AMD-only, as Intel does not
support IRPERF.
Due to erratum #1054 affecting AMD Zen 1 before model 30h, IRPERF is only
enabled for AMD Zen 1 model 30h onwards and later microarchitectures. This
commit also implements a validation step to make sure the IRPERF counter
is actually incrementing; otherwise, the feature is not enabled. This
guarantees it is working as expected before being made available to the
system and users.
[20 lines not shown]
[clang] Fix failed assertion crash when initializing compound literal pointer at file scope with error value (#229940)
e.g.
```C
x y; // error: unknown type name 'x'
constexpr int *p = (int*){y}; // failed assert
```
The fix was: before attempting to check if the pointer is null, first
make sure its not value dependent.
Fixes #229888
---------
Co-authored-by: aalmkainzi <aa.almkainzi at wakeb.tech>
[clang][ThreadSafety] Support lock_returned on function pointers (#226561)
d1e84bb9ad3b allowed the thread safety function attributes on function
pointers, but not lock_returned, so a call through a function pointer
could not return a known capability:
struct Ops {
struct Mutex *(*lock_of)(struct Dev *d) LOCK_RETURNED(&d->lock);
};
Handle lock_returned like the other attributes:
- Allow it on variables and fields of function pointer or function
reference type, rechecked after template instantiation.
- Parse its argument in the prototype's scope, so it can name the
pointee's parameters.
- Look it up on the callee declaration rather than only a direct callee,
substituting the call's arguments for the pointee's parameters.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[mlir] Avoid rewriting unreachable blocks in the greedy driver
A rewrite can disconnect a block after the iteration's initial CFG
sweep. Queued operations can develop self-referential SSA uses in
unreachable code, causing crashes or repeated rewrites that prevent the
worklist pass from returning. Track reachability through rewriter
notifications and skip these operations until the next iteration removes
their blocks.
The reproducer in #221152 exposes this gap in the initial sweep added by
#153957 for #153732. #154038 similarly skips unreachable blocks in the
walk-based driver. Reachable graph-region self-cycles in #194824 and
#205064 remain separate; #207185 proposes a fold-specific fix for them.
A forwarding ReachabilityListener sits between the rewriter and the
worklist driver and records, per region, which blocks changed their
terminator and which blocks were removed. Queries happen between
rewrites, once per popped operation, and update a per-region cache of
reachable blocks and their successors incrementally: added edges extend
[47 lines not shown]
NAS-144299 / 28.0.0-BETA.1 / Use cached `tn_connect.hostname.details` to render WebShare config file (#19995)
Changes to TN Connect plugin left the webshare TN hostname cache behind.
It uses stale cache item that is now not updated.
Let's move that cache to TN Connect plugin to prevent things like this
from happening in the future.