[CodeGen] Clarify LiveStacks test comments
Say what to observe in the spill slot test to tell that the slots
were not merged, and make the unit test comment self-contained.
Only rewrite VPExpandSCEVRecipe users that are dominated by the stride check
This "regresses" the code a bit, including relative to LAA-based side
speculation - see
`@stride_dependent_btc`/`@stride_dependent_btc_non_preventive`. We'd
probably need bigger changes around `VPlan::getTripCount` if we'd want
to optimize that in a safe manner.
[Clang][SYCL][Object] Compile SYCL device code once per IGCA target (#239010)
Compile SYCL device code once per IGCA target.
Several Intel GPUs can share an IGCA target, e.g. `xe-mtl-u` and
`xe-mtl-h` are both `igca_30r`.
Until now, `-fsycl --offload-arch=xe-mtl-u,xe-mtl-h` compiled the device
code once per GPU.
Now it is compiled once for `igca_30r`, and then for both GPUs with a
single `ocloc -device xe-mtl-h,xe-mtl-u` call.
The device image records the GPUs, as
`arch=igca_30r,code=xe-mtl-h,xe-mtl-u`.
`clang-linker-wrapper` links device code with the same `arch` and `code`
together, passes the GPUs to `clang-sycl-linker` with a new hidden
`--code=` option, and merges the results into one offload binary, as the
SYCL runtime loads only one. To decide which device images are linked
together, `OffloadFile::TargetID` is now a struct with `Triple`, `Arch`
and `Code` instead of a `std::pair`, so that `areTargetsEquivalent` and
[13 lines not shown]
[flang][OpenMP] Evaluate composite DISTRIBUTE clauses outside PARALLEL
In composite DISTRIBUTE PARALLEL DO [SIMD], omp.distribute is nested
inside omp.parallel, and the DISTRIBUTE clauses were evaluated after
omp.parallel was created. A DECLARE VARIANT call in the DIST_SCHEDULE
chunk-size expression therefore matched construct={parallel}, although
DISTRIBUTE encloses PARALLEL in the source, and every thread evaluated
the expression.
Evaluate the DISTRIBUTE clauses before creating omp.parallel, as for the
explicit nesting, and destroy their temporaries once, after omp.parallel.
Fixes #244760
Assisted-by: GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning
tests/sys/fs/fusefs/xattr.cc:572:50: error: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Werror,-Wstrlcpy-strlcat-size]
572 | strlcpy((char*)out.body.bytes, attrs1, sizeof(attrs1));
| ~~~~~~~^~~~~~~
The warning is correct in that the size is the size of the source, but
that is intended in this case. Use memcpy() instead of strlcpy() to
match the same code in the size_only_race_smaller test above.
Differential Revision: https://reviews.freebsd.org/D49786
(cherry picked from commit faae895fec6571242ae05b11bc7eba0dff83fa49)
[flang][OpenMP] Build the variant construct context from source nesting
Currently, METADIRECTIVE and DECLARE VARIANT selection builds the
construct trait set by walking the MLIR operations around the insertion
point, and that nesting doesn't always match the source. For
```fortran
!$omp teams distribute parallel do
do i = 1, n
a(i) = f()
end do
```
lowering creates omp.teams > omp.parallel > omp.distribute > omp.wsloop,
so the walk sees DISTRIBUTE inside PARALLEL. For
```fortran
!$omp atomic update
x = x + f()
[21 lines not shown]
[mlir][openacc] Anchor OffloadLiveInValueCanonicalization on FunctionOpInterface (#245399)
In preparation to use the pass in the CIR/OpenACC pipeline, CIR uses
cir.func that implement the FunctionOpInterface so the pass is better
anchored on it than func.func.
kernel - Move mfence into selected_apic_ipi() and single_apic_ipi()
* Make sure pending writes are flushed before issuing APIC IPIs.
Probably only needed for MSR-based IPIs, but do it for both
MEM and MSR.
* Remove explicit mfence prior to issuing IPI.
[clang][Sema][ThreadSafety] Accept attributes without arguments as meaning 'this' (#242937)
An attribute such as ACQUIRE or RELEASE without capability arguments is
documented to refer to 'this': the analysis translates it to the self
argument of the call (ThreadSafetyAnalyzer::getMutexIDs). But Sema
accepts one only on a non-static method of a capability class, and
elsewhere warns, even though it keeps the attribute.
On a function pointer field, the meaning of such an attribute has slowly
changed without being explicitly proposed. d1e84bb9ad3b (#191187)
allowed these attributes on function pointer fields. A call through a
field had no self argument then, so such an attribute on a field
translated to no capability and was dropped. dfeadc6b0836 (#231602) made
the base of the member access the self argument of a call through a
field, so that the attribute could name a sibling member. As a side
effect, an attribute without arguments on a field came to name that
object, as it does on a method. For
struct CAPABILITY("mutex") Node {
[39 lines not shown]
[clang][Sema][ThreadSafety] Name a member through 'this' in a parameter's attribute (#241077)
When parsing a parameters attribute, `this` wasn't in scope, so it
turned into a `DeclRefExpr`, which got turned into a wildcard for `&mu`
or matched nothing for `mu`. But the `DeclRefExpr` was only supposed to
turn into a wildcard for `&S::mu`, not to unexpectedly degrade accuracy
in all cases when parsing was imprecise. For example, in:
struct S {
Mutex mu;
void run(void (*cb)() REQUIRES(mu));
};
The analysis then read 'mu' as no particular object, matching no held
capability, so 'cb()' warned with 'mu' held; and '&mu' as the wildcard
'&S::mu', matching the 'mu' of any object.
This PR now parses a parameter's late-parsed attributes in the
function's scope, along with the function's own: at the end of the
[16 lines not shown]
Add USB quirk for WCH-Link adapter
WCH-Link is a debug adapter from QinHeng Electronics that features a
(proprietary) debug bridge for their RISC-V MCUs, as well as a serial
gateway, implemented as a CDC device. The CDC's call management
descriptor declares the data interface to be 1, but it is actually
interface 2. UQ_IGNORE_CDC_CM has already been implemented before to
handle this kind of firmware bug, so just add this quirk for WCH-Link.
Reported by: Holm Tiffe
MFC after: 1 week
vfs: drop S_ISGID on create when not a member of the group
A new file on tmpfs, HAMMER or HAMMER2 gets the directory's group and
the mode the caller asked for. If the creator was not a member of
that group, S_ISGID was kept, so any user who can write to a
directory owned by another group could create a set-group-ID
executable for that group; with /tmp on tmpfs (root:wheel 1777) that
is wheel. UFS and ext2fs already drop the bit when they create the
inode.
Do the same check as ufs_makeinode() in tmpfs_alloc_file(),
hammer_create_inode() and hammer2_inode_create_normal(), after the
group has been chosen: keep S_ISGID only for a member of the group or
with SYSCAP_NOVFS_SETGID. As in FreeBSD's fix for tmpfs, this covers
every node type.
Same issue as FreeBSD-SA-26:94.tmpfs (CVE-2026-127749).
Tested on tmpfs, UFS, HAMMER and HAMMER2: a file created with mode
[6 lines not shown]
[flang][OpenMP] Build the variant construct context from source nesting
METADIRECTIVE and DECLARE VARIANT selection collected the construct trait
set by walking the MLIR operations that enclose the current insertion
point. Those operations do not match source nesting: only some
constructs create an operation, composite constructs nest their
operations in a different order, and a clause is emitted wherever the
operation it belongs to is being built.
Collect the context from the source instead. The OpenMP constructs that
enclose the current PFT evaluation give the context of a statement. A
frame is recorded for each construct region entered while lowering an
evaluation, so that a clause sees the outer leaf constructs of its
compound directive. A METADIRECTIVE contributes the directive it
selected.
No functional change is intended. The context still contains only the
constructs counted before: TARGET, TEAMS, PARALLEL, DO, SIMD and
DISPATCH. Counting the remaining enclosing constructs is left to
[11 lines not shown]
[flang][OpenMP] Require an enclosing SIMD for construct={simd}
A construct={simd} selector without properties was ignored, because SIMD
is a predefined trait selector name (it can take clause properties)
rather than a directive name. A DECLARE VARIANT or METADIRECTIVE
alternative that requires SIMD was therefore selected everywhere,
including outside any SIMD construct.
Record the SIMD construct trait for such a selector. Lowering builds the
construct trait set from the enclosing MLIR operations, so also recognize
omp.simd there; otherwise calls inside SIMD would no longer match.
Fixes #244759
Assisted-by: GitHub Copilot
[SLP]Handle CouldNotCompute GEP pointer diff
getMinusSCEV returns CouldNotCompute for different pointer bases.
SCEVs cached before LCSSA formation make that possible for GEPs on
the same pointer operand; isLoopInvariant then crashed.
Fixed #245379
Pull-request: https://github.com/llvm/llvm-project/pull/245398
[X86] isGuaranteedNotToBeUndefOrPoisonForTargetNode - add X86ISD::VBROADCAST_LOAD/SUBV_BROADCAST_LOAD handling (#245057)
Similar to #241972 - inspect constant loads by
X86ISD::VBROADCAST_LOAD/SUBV_BROADCAST_LOAD nodes for UNDEF/POISON
pr45443.ll - fixes regression from #243097