Consolidate metadirective lowering TODO tests
Group related block, loop data-environment, iteration-variable, and unsupported-replacement cases into split-file tests. This keeps each diagnostic isolated while reducing the number of TODO test files.
[SPIR-V] Legalize wide-vector atan2 by splitting first (#213341)
fixes #213340
This was simple fix we just had to change the order in which we were
doing the splitting and widdening.
This change prioritize splitting G_FATAN2 vectors wider than four
elements before attempting power-of-two widening, which G_FATAN2 does
not support.
Add float and half coverage for vector widths 6, 8, 9, 12, and 16.
AMDGPU: Validate generic processor features in TargetParser emitter
Perform some initial validation that the feature set of generic
targets is consistent with the set of covered targets. For now, this
only validates the frontend exported list so it should be good for
catching missed builtins that ought to be accepted on the generic.
In the future arbitrary features should be validated, but this is
complicated by workaround features and size features which need to
clamp to the common monimum.
Co-authored-by: Claude (Claude-Opus-4.8)
AMDGPU: Export the TargetParser feature bitset
Previously this bitset was only used to populate the feature
name string map used by clang. Eventually this will replace
the current bitmask integer. AArch64 already has a similar
interface.
Co-authored-by: Claude (Claude-Opus-4.8)
ng_ipfw: provide a tree for faster hook lookup
This should assist setups that connect a lot of nodes to ipfw: and then
distribute traffic with ipfw(4) tablearg feature.
Reviewed by: pouria
Differential Revision: https://reviews.freebsd.org/D58547
AMDGPU: Tablegenerate TargetParser feature sets (#212945)
Traditionally we maintained 2 parallel feature mechanisms,
one in clang (later moved to TargetParser), with largely
mirrored subtarget features defined in the backend. Start
directly taking feature information from the backend and putting
it into TargetParser. This is still in a compromise mid-migration
state. We still have both the legacy "ArchAttr" bitfield integer,
plus a new AMDGPUFeatureBitset field stored in the table, which
isn't yet exported.
For the moment, the new bitset is only used to populate the
feature string name map, which is the big maintainability win.
This also lists an explicit subset of exported features to
avoid churn.
Co-authored-by: Claude (Claude-Opus-4.8)
[libc] Fix elf_proxy header generation (#213737)
Followup to fix the generated proxy header after #211428.
Assisted-by: Automated tooling, human reviewed.
uexterr_gettext(3): support dynamic kernel categories
Add an uncached sysctl based implementation which retrieves individual
categories. A cache would be an obvious extension should this optional
feature that can only be enabled by an environmental varible have a
noticable performance impact in a case that matters.
Reviewed by: kib
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D58238
kdump(1): minimally adapt to exterror category sources
Add some minimal handling of category sources other than static kernel
sources. We don't actually look up dynamic sources yet (that would
require extended trace records to add the file names to the trace file
since we can't assume the trace file is running on a kernel with the
same numbers.)
Make the decision to append a "src/" prefix to each file name
dependent on the category source.
Reviewed by: kib
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D58412
exterror(9): dynamic kernel categories
Make it possible to define categories without compiling their
paths into libc (important for third-party modules). The
EXTERR_CATEGORY_DYNAMIC macro can be defined to a string describing the
compilation unit (generally the path relative to src/sys) which takes
the place of EXTERR_CATEGORY.
These strings are assembled in linker sets with category numbers
assigned at system startup or module load time. The strings can be
retrieved from the kern.exterr.categories.<category> sysctl.
Reviewed by: kib
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D58237
exterror(9): split category into multiple sources
The static, global index into an array of strings is simple, cheap,
and works for the base kernel, but is unworkable for (potentially
third-party) kernel modules or for arbitrary userspace code. Swipe a
few of the top bits of category to indicate a source with all-zeros
being the current model (EXTERR_CAT_SRC_KERN_STATIC). Add two
additional sources EXTERR_CAT_SRC_KERN_DYNAMIC and EXTERR_CAT_SRC_USER
with stub implementations.
Reviewed by: kib
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D58236
[lldb][minidump] write the memory after an unreadable page when saving minidump (#212641)
**Issue**
An internal failing test found a latent bug in lldb's save-core
(minidump writer). When it saved a memory range that had an unreadable
page in it, it:
- stopped at that page and threw away the readable memory after it,
Result: We couldnot get the stack traces from the minidump. in the below
example the **current logic is bailing out at the 6th region and not
writing other 70 regions.**
```
[satyajanga at devgpu011.eag2 ~/fbsource/fbcode (eacbfddefa|remote/master)]$ lldb
(lldb) file /data/users/satyajanga/fbsource/buck-out/v2/art/fbcode/55005549ebc49982/sand/tests/__Coro__/Coro
Current executable set to '/data/users/satyajanga/fbsource/buck-out/v2/art/fbcode/55005549ebc49982/sand/tests/__Coro__/Coro' (x86_64).
(lldb) b coro.cpp:44 Breakpoint 1: where = Coro`::co_main() + 197 at coro.cpp:44, address = 0x00000000002335a5
(lldb) r
Process 3374177 launched: '/data/users/satyajanga/fbsource/buck-out/v2/art/fbcode/55005549ebc49982/sand/tests/__Coro__/Coro' (x86_64)
[47 lines not shown]
[offload] Use pinned memory for KLE
Reduce kernel launch latency by using the fast path "pinned host memory
-> device memory" for submitting the kernel launch environment.
Claude assisted with this patch.
bin/sh: Fix history long line truncation/corruption
When reading from standard input with editline history enabled, increase
buffer size to accomodate long lines so that history is recorded
correctly. Cleanup el_gets() handling avoiding potentially dangerous
retention of pointers to editline buffers across calls. Ensure struct
parsefile objects are properly zero initialised when created. Remove
push argument from setinputstring() and simplify logic as it was always
called with a value of one and as was written was potentially dangerous
if ever called with a value of zero.
This commit does not fix long lines when history is enabled but editing
is not (e.g. if there is no terminal).
MFC after: 3 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/2028
Signed-off-by: Kristofer Peterson <kris at tranception.com>
(cherry picked from commit 95e4fce8f0c4fc6bf828288b1d63faf0f1300198)
[flang][OpenMP] Lower DO and SIMD variants in metadirectives
A standalone metadirective and its associated DO are sibling PFT evaluations,
so a selected loop replacement cannot directly reuse ordinary OpenMP loop
lowering. Runtime selection must also preserve exactly one copy of the loop in
each reachable branch. Temporarily associate the evaluations while lowering
to support DO, SIMD, and DO SIMD replacements without losing or duplicating the
ordinary fallback loop.
For example:
```fortran
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
a(i) = i
end do
```
[49 lines not shown]
[CIR]Add RecordType to our dense-array optimization in lowering (#213725)
This is an issue in AMDGPUAsmParser.cpp self-build, we have a lot of
record elements (~360k+!) in an array that causes us to have this TU be
near-never-ending(hour+). Classic codegen compiles this sub-minute on my
machine. With this patch, we are only about a 30% increase in time.
Note: Claude wrote much of the tests after I got through every exception
I could think of. I think this covers everything, and I hope there is no
missing coverage.