[DAG] Fix incorrect ForSigned handling in computeConstantRange calls (#188889)
Fix two places where ForSigned was incorrectly passed to
computeConstantRange, causing wrong signed/unsigned range computation.
In computeConstantRangeIncludingKnownBits (DemandedElts overload),
the call omitted ForSigned, so Depth (unsigned) was implicitly
converted to bool for the ForSigned parameter. Introduced in
a6a66a4e6915.
In visitIMINMAX, the call always passed ForSigned=false, even when
folding SMAX/SMIN which query signed bounds from the resulting range.
[MLIR][Vector] Fix direct operand.set() bypassing rewriter in WarpOpScfIfOp/ForOp (#188948)
In WarpOpScfIfOp and WarpOpScfForOp, the walk that updates users of
escaping values (after moving them to the inner WarpOp) was calling
operand.set() directly, bypassing the rewriter API. This causes the
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS fingerprint check to fail.
Fix by wrapping the operand updates with rewriter.modifyOpInPlace().
Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
[MLIR][MPI] Fix direct getRefMutable().assign() bypassing rewriter in FoldCast (#188943)
The FoldCast canonicalization pattern was calling
op.getRefMutable().assign(src) directly, bypassing the rewriter. This
violates the pattern API contract and causes fingerprint change failures
when
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS is enabled. Wrap the
modification with b.modifyOpInPlace() to properly notify the rewriter of
the changes.
Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
[AArch64][llvm] Redefine some isns as an alias of `SYS`
Some instructions are not currently defined as an alias of `SYS`
when they should be, so they don't disassemble back into the
native instruction, but instead disassemble into `SYS`.
Fix these cases and add additional testcase.
Note that I've left `GCSPUSHM` due to a `mayStore`, `GCSSS1` and
`GCSSS2` as they're used in AArch64ISelDAGToDAG.cpp, and `GCSPOPM`
has an intrinsic pattern in AArch64InstrInfo.td. They will disassemble
correctly though, as they use `InstAlias`.
[DA] Consolidate the logic for checking overlap at the boundary (NFCI) (#189341)
In the Weak Crossing SIV test, there were two places where we checked
the dependency at the boundary, one is at the first iteration, and the
other is at the last iteration. Now the former can be merged into the
latter. There used to be an edge case when the coefficient is zero, and
we had an explicit check for that. This patch removes that check as
well, by moving the boundary check after the assertion that ensures the
(maybe negated) coefficient is positive.
`#pragma redefine_extname`: warn only if conflicting ID is at TU scope. (#188256)
As an example, this should keep warning:
```
static void foo();
```
because here, the identiifer `foo` won't be affected. In fact, it now
becomes (mostly) impossible to even declare anything later that would
get affected, thus the new definition is in active conflict with the
`#pragma`.
This however will not warn anymore:
```
namespace blargh {
static void foo();
}
[30 lines not shown]
Serialize `#pragma redefine_extname` into precompiled headers. (#186755)
Also deserialize them back again on reading.
The implementation is based on the existing implementation of `#pragma
weak` serialization.
Fixes issue #186742.
---------
Co-authored-by: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
DEVICE_IDENTIFY.9: Fix function call to detect driver in example code
Fixes: ccabc7c2e556 ("DEVICE_IDENTIFY.9: Modernize description and use cases")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit c78937677c973c48fd438ea06cfb51e11cc62851)
MAC/do: Comments: Rephrase one, fix a typo in another
No functional change.
MFC after: 3 days
Event: AsiaBSDCon 2026
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 954aaf3958e2ea0e9b1811090ddbb9d8b13a3e5a)
cpufreq(4): cpufreq_levels_sysctl(): Remove always false NULL test
'sc->levels_buf' is initialized with malloc(M_WAITOK), so can never be
NULL. Another sysctl handler function (cpufreq_curr_sysctl()) already
relies on that.
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 953b9164c3d93e820a53b4fdebbde7fabb7b7644)
clang: Return Triple from OffloadArchToTriple instead of a string
Also stop bothering to call normalizeOffloadTriple. This was
produced by code which should always produce normalized triples.
[DA] Stop negating Delta in the Weak Zero SIV test (#188212)
This patch removes the variable `NewDelta`, which was calculated as the
negation of `Delta`, along with its uses. `NewDelta` is now referenced
in only one place, and that code is effectively dead because more
general analysis with ConstantRange is performed at an earlier stage.
Also the test using `NewDelta` is not correct when `Delta` is a signed
minimum value, as negating it yields the same value as original. This
patch also fixes the correctness issue in such a situation.
[mlir][affine] Add ValueBounds-based simplification for delinearize(linearize) pairs (#187245)
`affine.linearize_index` pairs
(`CancelDelinearizeOfLinearizeDisjointExactTail`) only match when basis
elements are exactly equal as `OpFoldResult` values. This means they
cannot simplify cases where dynamic basis products are semantically
equal but represented by different SSA values or affine expressions.
This patch adds a new pass `affine-simplify-with-bounds` with two
rewrite patterns that use `ValueBoundsConstraintSet` to prove equality
of basis products:
- **`SimplifyDelinearizeOfLinearizeDisjointManyToOneTail`**: matches
when multiple consecutive linearize dimensions have a product equal to a
single delinearize dimension (many-to-one).
- **`SimplifyDelinearizeOfLinearizeDisjointOneToManyTail`**: matches
when a single linearize dimension equals the product of multiple
consecutive delinearize dimensions (one-to-many).
[8 lines not shown]
nvme_sim: Fix name in module version metadata
MFC after: 1 week
Fixes: 1e39b5d4833e ("nvme_sim: Attach as a child of nvme")
Sponsored by: The FreeBSD Foundation
vfs: Simplify vfs_write_resume()/vn_start_write_refed()
The call to vn_start_write_refed() from vfs_write_resume() with
'mplocked' set to 'true' exactly boils down to doing an increment of
'mnt_writeopcount', albeit with lots of unnecessary verifications.
Replace it with an inline incrementation. As the original call was the
last with 'mplocked' with 'true', remove the 'mplocked' parameter from
vfs_write_resume(), simplifying its code accordingly ('mplocked' always
false).
While here, in vfs_write_resume(), initialize 'error' out of the mount
lock.
Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56108