[mlir][ODS] Migrate generated and test attribute access to use split inherent/properties API (#218872)
Teach operation generators and the test dialect to use explicit
discardable or inherent attribute APIs. Update TableGen unit coverage
for the generated accessors.
Assisted-by: Codex
[MLIR][XeGPU] Enable strict property assembly format (#217281)
Enable strict property assembly format mode for XeGPU. Spell the DPAS
and atomic layout properties directly in custom assembly formats so
their syntax remains explicit under strict parsing.
Update XeGPU tests to use the direct layout spelling for those
operations.
Assisted-by: Codex
[clang][analyzer] Model function addresses in constant initializers (#217608)
`SValBuilder::getConstantVal()` does not currently handle direct
function addresses, as a result, a const function pointer initialized
with a function is loaded into `UnknownVal`, preventing the analyzer
from resolving and inlining calls through that pointer.
Fixes #216983
build/distfiles: clear the existing distfiles cache dir
This can cause issues on nightly builds so avoid it by clearing
all temporary files in there. The actual cache we use is in a
chroot (un)packed via the distfiles set.
vmm: Emulate CPUID leaf 1Fh for guests
On an Intel N150 host a guest started with sockets=1, cores=4,
threads=1 reports "1 package(s) x 2 core(s) x 2 hardware threads"
instead of four cores with one thread each, while the host itself
detects its topology correctly.
A FreeBSD guest picks the topology leaf in topo_probe_intel_0xb(),
sys/x86/x86/mp_x86.c, and since 6badb512a94d it prefers leaf 1Fh over
leaf 0Bh whenever cpu_high is 1Fh or higher. bhyve passes leaf 0
through unmodified, so the guest sees the maximum basic leaf of the
host, which is 1Fh or above on Alder Lake and newer, and takes that
path. x86_emulate_cpuid(), sys/amd64/vmm/x86.c, derives the topology
from vm_get_topology() for leaves 1, 4 and 0Bh, but has no case for
1Fh, so the request ends up in default_leaf and the host values are
returned verbatim. The guest therefore enumerates the topology of the
host: with an SMT shift of 1 in the host's leaf 1Fh and four vCPUs this
gives core_id_shift = 1 and pkg_id_shift = 2, which is exactly the
reported 2 cores x 2 threads. Hosts whose maximum basic leaf is below
[15 lines not shown]
mkimg: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks mkimg during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Make the existing 'sep' pointer const to fix the first case, and
for the second, introduce a new non-const pointer for strchr,
since we do modify the result in that case.
MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58493
(cherry picked from commit 9fd8f5e761ba663c8e99eeff64c5a7fd7bcf1e05)
rpcgen: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks rpcgen during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
For mkfile_output(), the pointed-to value is never modified, so
fix this by making the pointer const as well.
For open_log_file(), the current code modifies the supposedly const
value in-place to remove the filename suffix, which happens to work
but is wrong even in older versions of C. Change the code to use a
printf "%.*s" format specifier to strip the suffix instead.
MFC after: 1 week
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
[3 lines not shown]
xinstall: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks xinstall during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.
MFC after: 1 week
Reviewed by: ray, markj, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58492
(cherry picked from commit 2296c39a9ebc4f081d90b6554d8839e8cde8490a)
m4: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks m4 during the
bootstrap build, since it assumes the return value is always a
mutable pointer.
Since the returned value is never modified, simply make the
temporary const.
MFC after: 1 week
Reviewed by: bapt, dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58494
(cherry picked from commit 1d94e2e0f2ee21d5a4596efc0570d06e3dea0a6e)
libelftc: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks libelftc during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Since the returned pointer is never modified in either case, make
it const.
MFC after: 1 week
Reviewed by: jkoshy, markj, dim, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58497
(cherry picked from commit 85b07e977b04fceec84783facdb308492f17b155)
libc: getopt{,_long}: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks getopt during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Since the pointed-to value is never modified, fix this by making
the pointer const.
MFC after: 1 week
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58488
(cherry picked from commit f1d98862044f7748c6f930e9d4339abc166a5b16)
libucl: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks libucl during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
Instead of assigning directly to params->prefix (which is const),
use a non-const temporary variable and assign the result after
we've done the modification.
MFC after: 1 week
Reviewed by: bofh, bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58490
(cherry picked from commit bcee560d390eb8aa8fd0f08a7a0bffb6e77fffc6)
mandoc: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks mandoc during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
In read.c, make the existing temporary pointer const, and for the
mandoc_asprintf() call, add a new mutable local.
In mdoc.c and out.c, since the data is mutable and is mutated here,
remove const from the temporary pointers.
MFC after: 1 week
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58495
(cherry picked from commit 9f18614d5353ce513511ccbf59d09e76c93f7bc9)
sort: Const correctness for C23
On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks sort during
the bootstrap build, since it assumes the return value is always
a mutable pointer.
As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.
MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58491
(cherry picked from commit 78f842dda35b7280e8682f90506ff05b591c6b3a)
[libc] Disable fenv tests that don't work in Arm/AArch64 softfp (#217334)
The fenv tests do not work in Arm and AArch64 without proper floating
point environment support.
This patch adds preprocessor directives that effectively disable the
tests in this case.
[OpenMP] Seed noalias for host callback captures
The generic Attributor can derive noalias and the related lifetime facts for callback-mapped capture arguments, but OpenMPOpt does not seed AANoAlias in its restricted host run. Consequently capture-container loads remain in loops under dereferenceable-at-point semantics.
Seed AANoAlias for pointer arguments mapped to broker operands by callback metadata. Existing call-site reasoning checks every callback and direct call site and rejects escaped or aliased slots. LICM can then hoist immutable capture-container loads without changing the callback ABI or adding an OpenMP-specific hoisting transform.
Add LLVM, Clang, and Flang coverage for pointer, scalar, and aggregate captures together with escaped, duplicated, unmapped, and unknown-use negatives.
Reland "[OMPIRBuilder] Don't use invalid debug loc in task proxy fn." (#218427)
The proxy function built by `emitTargetTaskProxyFunction` inherited
whatever debug location the builder happened to carry, which belongs to
the target region rather than to the proxy. Save and restore the
insertion point around the proxy and clear the debug location while it
is emitted, so its instructions get none.
History of this change:
Landed in https://github.com/llvm/llvm-project/pull/148284
Reverted in https://github.com/llvm/llvm-project/pull/148728
Sanitizer issue fixed in
https://github.com/llvm/llvm-project/pull/148887
The revert was needed because the `InsertPointGuard` added here restores
an insertion point that the `PostOutlineCB` callbacks had meanwhile
invalidated: they erase the instruction the insertion point refers to,
so the guard read freed memory in its destructor. #148887 clears the
[15 lines not shown]
[KnownFPClass] Refine known classes for `atan2(y, x)` when `x` is negative (#214629)
`|atan2(y, x)| >= pi/2` when `x` is negative, which allows us to deduce
that the result cannot be zero or subnormal.
There are two possible deductions that I did not add since they rely on
one of the arguments being a known infinity/NaN. If we can determine
that one of the arguments is infinity/NaN at compile time, then the code
is probably erroneous:
- `atan2(y, inf)` is not subnormal
- `atan2(inf, x)` is not zero or subnormal
Also moved `atan2` tests to their own file.
AI disclosure:
I used OpenAI Codex (GPT-5.6-terra and GPT-5.6-sol) to help generate the
test updates and to retrieve the denormal-mode, which I reviewed and
tested locally.
RuntimeLibcalls: Add LibraryRef for dispatch-with-exclusion
Let a SystemRuntimeLibrary dispatch a shared provider library while dropping the
impls the target replaces, since a library reference cannot nest inside (sub ...).
This is a compromise from the ideal of explicitly listing all calls, but getting
to that point is prooving to be difficult.
The opt-out is emitted inside setAvailableLibFuncs_<lib>, so the single library's
logic is self contained.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[Clang][Docs] Clarify no_specializations wording (#218758)
Fixes #143719
`[[clang::no_specializations]]` diagnoses both explicit specializations
and partial specializations. The old wording, "explicitly specialized",
is ambiguous because that term means only `template <>` specializations
in the C++ standard.