[DSE] Restrict partial-overlap store merging to matching orderings. (#199728)
Partial-overlap store merging folds the later killing store into the
earlier dead store and erases the killing store. That is invalid if the
killing store is volatile or has stronger-than-unordered atomic
ordering, because erasing it drops an observable write. It is also invalid
if the killing and dead stores have different atomic orderings, because
the bytes originally written by the killing store would inherit the dead
store's atomicity after the merge -- silently dropping (or adding)
atomicity for those bytes.
Require both stores to be unordered (i.e. non-volatile with ordering at
most unordered) and to share the same ordering. This preserves the
existing fold for two simple stores or two unordered-atomic stores
(e.g. simple.ll's test43a) while leaving volatile, ordered-atomic, and
atomicity-mismatched cases in place.
This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply at anthropic.com>
NAS-141169 / 27.0.0-BETA.1 / Clean up `plugins.certificate.utils.get_private_key` (#19008)
Remove `plugins.certificate.utils.get_private_key`. Dead code that was
passing private key twice. Preserves behavior.
[llvm][Object] Add COFF support to extractOffloadBundleFatBinary (#199574)
Use PointerToRawData from the COFF section header to compute the section
offset, replacing the previous stub that returned an error for all COFF
object files.
This enables llvm-objdump --offloading and llvm-readobj --offloading to
work on COFF fatbins produced by HIP on Windows.
---------
Co-authored-by: James Henderson <James.Henderson at sony.com>
Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
Require a selector when lowering WHEN
This patch ensure we don't have missing selector as unconditional in
lowering since `WHEN` requires a context-selector.
Added negative test to replace the positive test testing against missing
selector.
Preserve metadirective user condition scores
The user-condition path returned before getTraitScore was called, so a
score on condition(...) was silently ignored during variant selection.
Extract the score before dispatching user-condition handling, pass it to
the condition traits, and add a test where a scored true condition wins
over an unscored candidate.
Fix trait-property mapping and improve metadirective tests
- In processTraitProperties, restrict the device_isa___ANY fallback to
only isa selectors. Unknown properties under arch, kind, or vendor
now produce an invalid trait so the variant does not match. Previously,
device={arch("neon")} would incorrectly match via ISA target-feature
checking.
- Add metadirective-nothing tests for OpenMP version >= 5.1.
- Add explicit -triple flags to ISA tests so AArch64 features run
under an aarch64 triple and x86 features under an x86_64 triple.
- Split device={arch()} tests into metadirective-device-arch.f90
- Add omp.terminator checks for begin/end metadirective match cases.
- Remove begin-metadirective.f90 TODO test (now supported).
Assisted with copilot
Use selected variants in metadirective construct context
Construct traits gathered only from PFT parents miss constructs introduced
by an enclosing selected begin-metadirective variant. This can cause an
inner construct selector to reject a matching variant.
Use already-emitted enclosing OpenMP operations as the effective context,
falling back to PFT parents when no such operation exists. Add a test for
an inner selector matching target plus an outer-selected parallel.
Fix metadirective implicit-nothing candidate ordering
Preserve whether a metadirective variant was explicitly
specified so selection can distinguish explicit nothing
from an omitted directive variant. Order explicit candidates
before implicit nothing candidates when invoking the OpenMP
context scorer, matching the metadirective tie-break rule.
Add standalone and begin/end metadirective regression tests
where an implicit nothing candidate appears before an
otherwise-tied explicit directive variant.
Reference:
OpenMP 5.0 [2.3.4] says that if multiple when clauses have
compatible context selectors with the same highest score, and
at least one of them specifies a directive variant, "the first
directive variant specified in the lexical order of those when
clauses" replaces the metadirective.
[flang][OpenMP] Support lowering of metadirective (part 1)
This patch implements following feature in metadirective:
- implementation={vendor(...)}
- device={kind(...), isa(...), arch(...)}
- user={condition(<constant-expr>)}
- construct={parallel, target, teams}
- default, nothing, and otherwise clause
Dynamic user conditions, target_device, and loop-associated
variants are deferred to follow-up patches.
This patch is part of the feature work for #188820.
Assisted with copilot and GPT-5.4
[libc][ci] Improve full build precommit CIs caching keys. (#199742)
Currently full build precommit CIs only uses c_compiler as the cache's
key which will be the same for many of them listed in the matrix list.
We change to use the combination of (target + build_type + c_compiler)
as keys to uniquely distinguish them and the future gcc builds.
[clang-doc] Add option for compact JSON (#190822)
By default all JSON is serialized "pretty" with whitespace. This patch
adds an option to serialize JSON without whitespace. This trims the size
of the JSON folder for clang from around 1.3 GB to 785 MB, which is a
39.6% decrease.
[clang][SemaOpenACC] Reject VLA reduction (#199178)
`GenerateReductionInitRecipeExpr` only handled `ConstantArrayType` when
walking the operand type to build an InitListExpr. A VariableArrayType
`(int arr[i+1])` fell through to the final else branch and tripped
`assert(Ty->isScalarType())`.
Rather than silently accepting VLAs (which have no reasonable lowering.
unlike pointers, there is an expectation of initialized values,but we
cannot statically enumerate elements), reject them outright in
`CheckVarType` with a new diagnostic err_acc_reduction_vla. This is
consistent with the fact that neither codegen nor lowering currently
supports VLA reductions, and other compilers (GCC crashes, NVC++
silently ignores) do not meaningfully handle them either. The fix
upgrades the existing warning path for non-constant arrays in
`CheckVarType` to an error when the clause kind is Reduction, so VLAs
never reach `GenerateReductionInitRecipeExpr`.
Reproducer:
[18 lines not shown]
NAS-141161 / 27.0.0-BETA.1 / Switch to truenas_pyos access check function (#19003)
This commit switches from using our process-pool based permissions
checker with on that's streamlined inside truenas_pyos and executes with
GIL dropped. Historically this area has been troublesome to keep good
performance and so simplifying middleware design here is worthwhile.
sigqueue: In capability mode, only allow signalling self
This is copied from the check in kern_kill.
Reviewed by: markj, oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57244