clang: Stop marking NVPTX and TCE kernels noinline
Kernels are never called directly. OpenCL kernels called from other
kernels go through the kernel stub and CUDA __global__ functions are
only launched. The target hooks could not distinguish the stub from
the kernel, so the stub also received noinline. The stub handling then
checked that IR noinline to avoid also marking it alwaysinline.
Drop the noinline from the target hooks and decide whether the stub is
alwaysinline from the declaration and options alone. The stub is now
alwaysinline on NVPTX and TCE, as it already is on other targets.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc][regex] Make ExprPool alt spines iterative (#245590)
Wide alternations in ExprPool previously recursed once per branch.
Failed coalescing scans also re-scanned remaining branches, causing
cubic compile times.
Convert make_alt and spine coalescing to iterative loops backed by
ReverseOrderBlockStore<ExprId, 16>:
* insert_sorted_no_coalesce: direct O(K) insertion after failed scans
* coalesce_into_spine: iterative tail/kept coalescing without recursion
* splice_into_sorted_spine: direct sorted rebuild with zero throwaway
Alt nodes
Two-spine merges stay symmetric, and optimised x86-64 frames stay under
256 bytes. derivative still recurses; a later patch converts it.
Compliance: Henry Spencer spencer_tests.txt 268/456 Bool/Err (+0) and
84/456 Full Pos (+0); AT&T testregex 399/400 ERE Bool/Err (+0), 401/473
[2 lines not shown]
www/samdruckerweb: Update to 0.3.1
On a package page, the Versions table now says what each link lists.
The host count beside a version links to the hosts on exactly that
version (new ?version= filter, kept by the downloads), and the
older-than link shows how many hosts it will list, for example
"73 hosts older than 0.3.0_1", or "none" on the oldest version.
Before, the link beside the oldest version read "hosts older than this"
and listed no hosts, which looked like a bug.
No database changes.
Release notes:
https://github.com/dlangille/SamDrucker/releases/tag/0.3.1
sysutils/samdruckerclientshell: Update to 0.3.1
The client is one script again. samdrucker.repo-to-json.stdin, which
converted the pkg repos output to JSON, has been folded into
samdrucker.sh, which now runs that Lua itself with flua -e. The helper
is no longer installed.
What the client sends, and how it reports a failed check-in, are
unchanged. It still needs /usr/libexec/flua from the base system (the
FreeBSD-flua package on pkgbase hosts).
Release notes:
https://github.com/dlangille/SamDrucker/releases/tag/0.3.1
Annotation2Metadata: Preserve function analyses
Only !annotation metadata is added, which does not affect any function
analyses (and probably would never?)
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[OpenMP] Minimally support detachable tasks in the device runtime
The device runtime has no __kmpc_task_allow_completion_event or
omp_fulfill_event, so a task with a detach clause in a target region
fails to link.
Tasks on the device are executed immediately by the encountering thread
and are complete once their structured block has finished, so there is
no completion event to register. Return a null event handle, and make
omp_fulfill_event do nothing.
Co-Authored-By: Carlo Bertolli <carlo.bertolli at amd.com>
Co-Authored-By: Greg Rodgers <Gregory.Rodgers at amd.com>
Assisted-By: Claude
[NFC][KCFI] Factor out lowerTrapBundles and lowerTrapCheck (#245494)
Extract the generic trapping KCFI bundle lowering loop into helper
functions
and replace the unused TargetMachine.h include with Triple.h to prepare
for
lowering diagnostic KCFI bundles in a follow-up change.
Assisted-by: Gemini
[OpenMP] Minimally support detachable tasks in the device runtime
The device runtime has no __kmpc_task_allow_completion_event or
omp_fulfill_event, so a task with a detach clause in a target region
fails to link.
Tasks on the device are executed immediately by the encountering thread
and are complete once their structured block has finished, so there is
no completion event to register. Return a null event handle, and make
omp_fulfill_event do nothing.
Co-Authored-By: Carlo Bertolli <carlo.bertolli at amd.com>
Co-Authored-By: Greg Rodgers <Gregory.Rodgers at amd.com>
Assisted-By: Claude
[Clang][OpenMP] Cast task privates-map arguments to the default address space
The privates mapping function of a task takes its arguments as pointers in
the default address space, but the temporaries whose addresses are passed
to it are allocas, which need not be in that address space: they are in
address space 5 on AMDGPU, and in address space 0 on SPIR-V, whose default
address space is the generic one (4). Since #200427 those addresses have
been passed without a cast, so the call's function type does not match
the callee's. A task with a firstprivate (or private, or lastprivate)
variable in a target region then faults when run on an affected device.
The fix is to cast the arguments to the default address space at each
of the call sites. This is a no-op on targets whose allocas are already
in the default address space, such as x86 and NVPTX.
New tests cover compile-time and runtime behaviour.
Assisted-By: Claude
[GlobalISel] Treat G_ADDRSPACE_CAST as able to create poison (#245701)
GlobalISel's `canCreateUndefOrPoison` treats `G_ADDRSPACE_CAST` like any
other cast and says it cannot create poison, so the pre-legalizer
combiner pushes a freeze above it:
```mir
%1:_(p3) = nonnull G_ADDRSPACE_CAST %0
%2:_(p3) = G_FREEZE %1
```
becomes
```mir
%3:_(p0) = G_FREEZE %0
%2:_(p3) = nonnull G_ADDRSPACE_CAST %3
```
The result of an address space cast is target-defined, and with
[13 lines not shown]
Disable analysis invalidation verification in more tests
These debug-pass-manager tests fail with EXPENSIVE_CHECKS, which enables
the verification and adds extra lines to the output.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CodeGen] Remove separate floating point boolean contents (#245700)
Remove the rest of the changes from D4389, which let a target use
different boolean contents for floating point compares than for integer
compares. Mips R6 was the only user and that was removed in #245469.
- Remove BooleanFloatContents and the two argument setBooleanContents().
- getBooleanContents() no longer takes an isFloat argument.
- Remove the IsFP argument from the GlobalISel helpers that wrapped it
(getBoolExtOp, buildBoolExt, buildBoolExtInReg, isConstTrueVal,
isConstFalseVal, getICmpTrueVal).
- Remove the int/fp special cases in foldSelectOfConstants() and
ScalarizeVecRes_VSELECT().
NFC.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR][OpenCL] Lower kernel execution metadata to LLVM dialect
Lower CIR kernel execution metadata to LLVM dialect function attributes for work-group sizes and vector type hints. Derive the vector hint signedness flag from the CIR scalar or vector element type before conversion, and let LLVM IR translation materialize the metadata.
Propagate unsupported hint type conversions as failures and omit function-only metadata from aliases. Check OpenCL and CUDA/HIP SPIR-V emission against classic CodeGen, including high-bit dimensions and signed, unsigned, and floating-point hints.
Assisted-by: Codex / GPT-6
[CIR][OpenCL] Emit kernel execution metadata in CIR
Preserve the kernel execution attributes accepted by Sema on OpenCL kernels and CUDA/HIP kernels targeting SPIR-V. Evaluate work-group dimensions as constants and retain vector type hints as semantic CIR types.
Keep kernel argument metadata emission restricted to OpenCL kernels, and omit execution metadata when no execution attributes are present.
Assisted-by: Codex / GPT-6
[CIR][OpenCL] Add kernel execution metadata attribute
Represent `reqd_work_group_size`, `work_group_size_hint`, and `vec_type_hint` as a CIR function attribute. Store work-group dimensions as three unsigned 32-bit values encoded in i32 arrays, and require them to be all zero or all nonzero.
Restrict vector type hints to CIR integer and floating-point scalars or fixed vectors of those types. Preserve integer signedness in the hinted CIR type so LLVM lowering can derive its metadata flag without a redundant field.
Assisted-by: Codex / GPT-6
- Always track our lev1pa and only set the %urp if it's actually changed,
thus saving a user ATC invalidation if we switch back to the same
pmap. Instrumentation shows this happens about 50% of the time during
an ATF run.
- Loosen some overly strict KASSERT-ions that fired during an ATF run,
but put assertions around *those* edge cases.
- Track if an ATC invalidation was due to an "enter", a "remove",
a "protection", or a "cache status change".
- In pmap_remove_all(), we can use the regular pmap garbage-collection
scheme, because uvmspace_exec() follows the pmap_remove_all() call
with a pmap_update() call.
- In pmap_destroy(), perform a pmap_update() before actually destroying
the pmap when the last reference is dropped. This is because
uvmspace_free() calls pmap_remove_all() without following with a
pmap_update(). This is a perfectly reasonable optimization for
uvmspace_free() to do, but yah, we need to take care of it ourselves.
[LAA] Find no dependence between non-overlapping loop-invariant accesses
A loop-invariant access touches the same bytes in every iteration, so
two of them are independent iff they do not overlap. LAA proved that
only by showing one ends before the other begins, e.g. p + 4 <=u p + 8
for a and c below, which fails unless SCEV knows the addresses do not
wrap. Otherwise it reported an unknown dependence and gave up on the
loop, so a loop that updates three or more fields of a struct through a
pointer was not vectorized:
struct trio { int a, b, c; };
void acc3(struct trio *p, const int *x, int n) {
for (int i = 0; i < n; i++) {
p->a += x[i];
p->b ^= x[i];
p->c |= x[i];
}
}
[14 lines not shown]
Attributor: Skip looking for callback uses if the callee has no callbacks (#240720)
getAssociatedArgument collected the callback uses of the call even if
the callee has no !callback metadata. Return the callee argument
directly in that case.
CTMark instructions:u with -attributor-enable=light changes by O3
-0.03%, ThinLTO -0.04%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lldb] Count split DWARF parsing in debugInfoParseTime (#245335)
With split DWARF, LLDB times DIE parsing in a .dwo or .dwp file on that
file's `SymbolFileDWARFDwo`, which `statistics dump` never reads, so
`debugInfoParseTime` and `totalDebugInfoParseTime` left out nearly all
DIE parsing.
This change has `SymbolFileDWARFDwo` add its parse time to the main
symbol file's timer. A skeleton unit now stops its timer before parsing
its .dwo unit, which would otherwise count that time twice.
Expect `debugInfoParseTime` and `totalDebugInfoParseTime` to jump for
split DWARF binaries after this change. The parsing itself isn't new,
only its reporting is. Like the rest of the parse time, it is summed
over the threads that parse units in parallel, so it can exceed wall
time.
Attributor: Don't seed simplification without simplification AAs
When seeding, the Attributor asks for the simplified value of every
argument, return, call site and stored value, only to create the AAs that
simplify them. If none of those AAs are allowed, as in the light pass,
this computed simplified values that were thrown away, which includes
walking the returned values of every function.
CTMark instructions:u with -attributor-enable=light:
O3: -0.13%
ThinLTO: -0.12%
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>