[Clang][RAV] Simplify TraverseTemplateArgumentLocsHelper (#199131)
We were checking the result of getTemplateArgsAsWritten() to skip over
implicit instantiations, with an assert to ensure that it has the
desired effect, before checking getTemplateSpecializationKind() ==
TSK_ExplicitSpecialization which would skip over implicit instantiations
anyway. As the included tests show, the invariant that we were relying
on did not hold, but we no longer have any need to rely on that, we can
now just check the result of getTemplateSpecializationKind() directly.
Fixes: #198903
Fixes: #169302
[BOLT][Bazel] Configure Rewrite target backends (#205179)
`RewriteInstance.cpp` only creates target-specific `MCPlusBuilder`
instances when `X86_AVAILABLE` or `AARCH64_AVAILABLE` is defined. The
Bazel `Rewrite` target defines neither macro and hard-codes `TargetX86`,
so `createMCPlusBuilder()` returns null for both target backends defined
by the Bazel overlay. Derive the definitions and dependencies from the
generated `bolt_targets` list, restricted to the `TargetAArch64` and
`TargetX86` rules defined in this BUILD file, and use the same target
dependencies for `llvm-bolt`.
Validation: `buildifier -mode=check -lint=warn
utils/bazel/llvm-project-overlay/bolt/BUILD.bazel`; an equivalent
overlay change built and executed BOLT for Linux x86_64 and Linux
AArch64 in [hermetic-llvm's remote `//prebuilt/llvm:all`
build](https://app.buildbuddy.io/invocation/7943a005-c159-4cb9-af0e-00ffbaa40bb5).
AI tool disclosure: Co-authored with OpenAI Codex.
[CIR] Compute union base subobject for tail-padding reuse (#201428)
A [[no_unique_address]] field whose type is a union with reusable tail
padding made CIRGen trip the insertPadding "offset >= size" assertion in
CIRGenRecordLayoutBuilder. CIR sized the union member at its full size, so a
following field that the ABI places in the union's tail padding overlapped the
union and insertPadding asserted.
CIR already computed a distinct, smaller base subobject type for structs and
classes whose tail padding can be reused, but not for unions. A union has
reusable tail padding when one of its members is itself a [[no_unique_address]]
field with tail padding, which makes the union's data size smaller than its
size.
computeRecordLayout now builds that base type for unions too, sized from
getDataSize(), and lowerUnion emits the storage type plus trailing padding as
ordinary struct fields so the reusable padding is exposed, mirroring classic
CodeGen. The base-type gate also no longer skips records marked final, which
classic CodeGen never skipped and which otherwise hit the same assertion for a
[3 lines not shown]
[X86] Hoist getMOVriOpcode to X86InstrInfo.h and share it, NFC
The x86 backend often needs to materialize potentially 64-bit immediates
into registers, and the logic to pick between the available opcodes
exists in 3 places at least. Move this to X86InstrInfo.h so we can share
it over the x86 backend without copying it.
CI: Re-allow workflow_dispatch on zfs-qemu
Allow zfs-qemu to be invoked from a workflow_dispatch event (a.k.a,
manually running a workflow). This may have been accidentally disabled
in 1916c2c55.
Reviewed-by: Chris Longros <chris.longros at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #18680
zfs_ioctl: fix EBUSY race between quota queries and mount
zfsvfs_hold() fell back to zfsvfs_create() -> dmu_objset_own()
(exclusive) for unmounted datasets. A concurrent zfs_domount()
also calls dmu_objset_own(), causing EBUSY on the same dataset.
Introduce zfsvfs_create_hold() using dmu_objset_hold() (shared
hold) instead. Shared holds do not conflict with exclusive owns,
eliminating the race. The release path (zfsvfs_rele,
zfsvfs_create_impl error) uses dmu_objset_ds()->ds_owner to
determine whether to disown or rele, avoiding the need for an
extra flag in zfsvfs_t.
Added tests userspace_005, groupspace_005, projectspace_006
(50 iter race test).
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: HeonJe Lee <lhjnano at gmail.com>
Closes #18611
kern: add a security knob to disable unprivileged access to kenv
We sometimes store sensitive things in the kenv that get zapped, but we
really shouldn't rely on that zapping to actually happen. Most
unprivileged processes don't really need to read from the kernel
environment in the first place, so add a knob that allows it to be
disabled.
Note that we consider jailed root to be unprivileged from this
perspective; they have their own meta/env concepts and we should
encourage users to take advantage of those for passing information to
jails.
"Hey we should do something about that": dch
Reviewed by: imp, ziaee, zlei (all slightly previous version)
Differential Revision: https://reviews.freebsd.org/D57697
[LAA] Collect no-wrap predicates separately in getPtrStride/isNoWrap. (#203787)
Add an overload of getPtrStride and update isNoWrap to collect no-wrap
SCEV predicates in a vector, and have the caller add them to PSE if
needed.
This also requires to explicitly build the wrap predicate via
ScalarEvolution::getWrapPredicate (clearing statically implied flags)
rather than going through PredicatedScalarEvolution::setNoOverflow,
which can now be removed together with the flags map.
This also requires generalizing SCEVUnionPredicate::implies so a wrap
predicate can be recognized as implied by an existing wrap predicate
after applying equal predicates, avoiding redundant predicates when the
collected predicates are committed.
The only functional changes is re-ordering of runtime check groups in a
single test case; no functional IR changes across a large IR corpus (32k
modules)
[4 lines not shown]
[LSR] Preserve LCSSA in critical edge splitting
This was another case where LSR failed to preserve LCSSA, which will
trigger an assertion under the NewPM. This is currently only enabled
under the NewPM to avoid pessimizing any optimizations while unblocking
work on the NewPM.
Reviewers: fhahn, vikramRH, nikic, arsenm
Pull Request: https://github.com/llvm/llvm-project/pull/192371