[AMDGPU] Replace getRepeatRate with getBlockingCycles (#239855)
The commit 85c730242e74 added a shim for getRepeatRate -- yet when the
final version landed upstream via e863ca8c67b6 it was renamed to
getBlockingCycles.
This PR switches the GCNHazardRecognizer to use the upstreamed version.
This is not NFC, the version in e863ca8c67b6 includes modelling for all
relevant instructions, whereas the shim does not contain modelling and
is merely a placeholder.
Raise AppUpdate alert for custom app image updates
Manual port of #20365 to stable/27's older code style: the alert filter
in AppService.update_app_upgrade_alert, the alert refresh after
app.image.op.check_update, and their unit tests.
[mlir][Presburger] NFC: harden asserts and use gcd in eliminateColumnUsingRow
- Assert row < getNumRows() in IntMatrix::eliminateColumnUsingRow.
- Compute elimination multipliers via llvm::gcd instead of llvm::lcm to
avoid unnecessary intermediate bitwidth growth.
- Assert atEq(eqIdx, col) != 0 in IntegerRelation::eliminateVarUsingEquality
even when the relation has no other constraints.
[mlir][Presburger] NFC: match parameter order to eliminateColumnUsingRow / eliminateVarUsingEquality names
Reorder IntMatrix::eliminateColumnUsingRow to (col, pivot, targetRow)
and IntegerRelation::eliminateVarUsingEquality to (col, eqIdx) so the
column and pivot/equality arguments match the method names.
[mlir][Presburger] NFC: extract eliminateColumnUsingRow and eliminateVarUsingEquality
Extract IntMatrix::eliminateColumnUsingRow (eliminating a column from a
row using a pivot row with the smallest positive multiplier on the row)
and IntegerRelation::eliminateVarUsingEquality (applying it to every
other equality and every inequality of the relation).
Replace the file-local eliminateFromConstraint helper with these
primitives in gaussianEliminateVars, gaussianEliminate, and
removeRedundantLocalVars, and add a unit test for
IntMatrix::eliminateColumnUsingRow.
[ConstraintElim] Fold the observed doesHold depth into the decomposition cache key (#247302)
... so that depth-limited queries still get cached, re-limiting the worst-case
compile time behavior for those cases, per Florian's [follow up](https://github.com/llvm/llvm-project/pull/243985#discussion_r4654851374) to #243985.
hwpmc: Size and walk per-CPU state by CPU ID
pm_pcpu_state is indexed by CPU ID but sized by mp_ncpus, and the log
code walks CPUs 0 to mp_ncpus - 1. CPU IDs can have holes, for example
on riscv when a hart fails to start, so the array is too short and the
loops bind to an absent CPU and skip the last ones.
Size the array with pmc_cpu_max() and walk with CPU_FOREACH().
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Advanced Micro Devices, Inc.
Signed-off-by: Osvaldo Janeri Filho <ojanerif at amd.com>
Differential Revision: https://reviews.freebsd.org/D62377
Revert "[libc++] Simplify the implementation of iterator_traits a bit" (#246517)
Reverts llvm/llvm-project#222297, since it causes a conformance regression
for C++17 iterators that don't have all of the `difference_type`, `reference`
and other members.
[HLSL] -Gis disables Fast math, contract=fast by default and is set to on when fast math is disabled. (#245704)
HLSL enables fast math by default but never enabled FP contraction. This
change makes HLSL default to -ffp-contract=fast, falling back to on when
fast math is disabled. An explicit -ffp-contract= still takes
precedence.
• Driver: sends -fno-fast-math to cc1 whenever the final FP options
aren't full fast math, so the frontend's fast-math default no longer
overrides options like -ffp-model=strict.
• -Gis: now expands to -fno-fast-math -ffp-model=strict.
• DirectX: removed the custom isFast helper, which ignored contract, in
favor of FPMathOperator::isFast(). Ops that opt out of contraction now
get dx.precise.
• Tests: added HLSL driver tests for fast-math forwarding and
contraction defaults, and updated CodeGenHLSL tests for the new contract
flag.
Closes https://github.com/llvm/llvm-project/issues/194079
NAS-145478 / 28.0.0-BETA.1 / Raise AppUpdate alert for custom app image updates (#20365)
Issue 1:
In https://github.com/truenas/middleware/pull/18084, we reduced alerts
to only catalog version bumps of major/minor (not patch). This also
dropped out any image updates for custom apps.
For custom (YAML), image updates is the only thing that "updates" them.
For custom (form), they also get template updates for the catalog.
So alerts are raised on:
| Change | Catalog app | Custom app (form, ix-app) | Custom app (YAML) |
|------------------------------------------------|-------------|---------------------------|-------------------|
| Catalog `version` major/minor bump (1.2 → 1.3) | Yes | Yes | N/A |
| Catalog `version` patch bump (1.2.3 → 1.2.4) | No | No | N/A |
| `app_version` change (e.g. 10.9.0 → 10.9.1) | Yes | No, `app_version`
is fake | N/A |
[14 lines not shown]
[libc++] Fix vector::insert_range with a sized input range when not reallocating (#229763)
`vector::insert_range` inserts the new elements in the wrong place when
all of these hold:
- the range is sized but only an input range (e.g. `views::counted` over
a single-pass iterator),
- the vector has enough spare capacity, so it does not reallocate, and
- fewer elements follow the insertion point than are being inserted.
The new elements are left at the end of the vector instead of at the
insertion point. This patch fixes that.
Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
Co-authored-by: A. Jiang <de34 at live.cn>
[LangRef] Document !alloc_token propagation through inlined wrappers (#248158)
Allocation wrappers' !alloc_token is propagated by the inliner to the
allocation calls whose result the inlined wrapper returns (#198535,
#244314). Document this in the alloc_token metadata section, as
suggested in post-commit review of #244314.
[lldb] Allow the static libxml2 library on Windows. (#244505)
Link a static version of the LibXml2 library for the Windows targets or
if it was requested by LLVM_USE_STATIC_LIBXML2.
Depends on #244503
[CMake] LibXml2 pkg module adjustments for Libxml2Static and Windows targets. (#244503)
There are few adjustments in LibXml2 module to properly handle the
static libxml2 library usage for the Windows targets.
* provide LIBXML2_STATIC compiler definition for LibXml2::LibXml2Static
package, also for LibXml2::LibXml2 is only the static version has been
found.
* add required bcrypt.lib on Windows when the static libxml2 version is
used (or requested).
---------
Co-authored-by: Charles Zablit <c_zablit at apple.com>
[mlir][Presburger] NFC: clarify PresburgerRelation::gist docstrings and comments
Document how the PresburgerRelation overload differs from the
IntegerRelation overload via the union-level isSubsetOf check, and note
that the hasOnlyDivLocals() check is a cost guard to avoid expensive
Fourier-Motzkin elimination during subtraction.
[mlir][Presburger] Deduplicate candidate constraints in getValidConstraintsHull
Normalize and deduplicate candidate constraints across disjuncts, skip
trivially valid constraints and empty context disjuncts, and avoid
re-checking a context disjunct's own constraints against its own Simplex.
[mlir][Presburger] Expand PresburgerRelation::gist unit test coverage
Add tests exercising getValidConstraintsHull with shared and unshared
equalities, local variables (filtering and Simplex column padding),
symbolic variables, and mixed rationally-empty/non-empty context
disjuncts.
[mlir][Presburger] Add PresburgerRelation::gist
Add PresburgerRelation::gist (and PresburgerSet forwarding overloads)
for a convex context and for a context that is itself a union of
disjuncts, following ISL's isl_map_gist / isl_map_gist_basic_map.
For a convex context, each disjunct is simplified separately with
IntegerRelation::gist; disjuncts that become empty are dropped and if any
disjunct becomes the universe, the universe is returned.
For a non-convex context, the trivial cases (universe set or context,
empty context, equal set and context, context being a subset of the
set) are handled first. Otherwise, the context is approximated by a
convex set. Instead of ISL's unshifted simple hull of the context and the
set, we use the universe together with all constraints of the disjuncts
of the context and of the set that are valid for every disjunct of the
context (checked with Simplex); including the constraints of the set
allows removing constraints that are implied by every disjunct of the
context even if they are not implied by the simple hull.
[mlir][Presburger] Fix universe early returns in PresburgerRelation::gist
- Canonicalize isObviouslyUniverse() inputs to getUniverse(getSpace())
instead of returning *this with redundant extra disjuncts.
- Delegate context.isObviouslyUniverse() to gist(IntegerRelation::getUniverse)
so redundant constraints and empty disjuncts are simplified consistently
with the convex overload.
[mlir][Presburger] Skip obviously empty context disjuncts in getValidConstraintsHull
Skip disjuncts where isObviouslyEmpty() holds (e.g., failing the equality
GCD test while remaining rationally feasible) before building a Simplex
so they do not needlessly weaken the hull.
[mlir][Presburger] Prefer smallest non-zero pivot in IntMatrix::rowReduce
Select the unpivoted row with minimal |at(r, col)| (stopping early on
|entry| == 1) rather than the first non-zero row to keep intermediate
integer coefficients smaller during Gauss-Jordan elimination.
[mlir][Presburger] NFC: clarify and polish IntegerRelation::gist docstring
- Document the universe-context behavior (removeRedundantConstraints
with unused local cleanup) and the case where context is rationally
non-empty but integer-empty.
- Replace FPL with Presburger and normalize bullet punctuation and
backticks.
[mlir][Presburger] Normalize constraints after each pivot in reduceUsingEqualities and gistAligned
Normalize modified rows by GCD after each pivot elimination to prevent
intermediate coefficient growth when eliminating multiple variables with
non-unit pivot coefficients.
[mlir][Presburger] Only copy equalities in gistAligned affine hull emptiness check
Copying all inequalities of *this into combined caused gaussianEliminate
to eliminate every equality from every inequality and GCD-tighten them
on each pivot, only to discard combined before reduceUsingEqualities
rewrites *this. Construct combined with only the equalities of *this
and ctx instead.
[mlir][Presburger] Tighten asserts in rowReduce, eliminateVarUsingEquality, and reduceUsingEqualities
- Validate all column indices up front in IntMatrix::rowReduce so out-of-bounds
columns are still caught when pivotRow == numRows exits early.
- Assert eq.size() == getNumCols() and eq[col] != 0 in
IntegerRelation::eliminateVarUsingEquality(ArrayRef, col) even when the
relation has no constraints.
- Simplify space equality check in reduceUsingEqualities to space.isEqual.
[mlir][Presburger] Canonicalize trivial universe/empty early returns in IntegerRelation::gist
Drop unused local variables in the zero-constraint and universe-context
early returns, and canonicalize obviously empty relations to
getEmpty(getSpaceWithoutLocals()) so all early returns match gistAligned.
[mlir][Presburger] Avoid duplicating equalities when restoring division defs in gist
When restoring a nested division whose inner division was dropped,
getLocalReprs() initially fails to find a representation for an outer
equality-defined local even though its defining equality is still
present. Since removeTrivialRedundancy() only deduplicates inequalities,
unconditionally re-adding the equality produced duplicate constraints
and broke idempotency. Check whether the equality is already present
before adding it back.