[Hexagon] Emit unwind info for HLX callee-saved registers, caller's VSP (#243180)
The HLX callee-saved registers L12-L15 are spilled to the HLX vector
stack, which is addressed by VSP rather than the CFA. Describe each of
them with a DW_CFA_expression relative to VSP, or as DW_CFA_same_value
when the function does not save it.
With -hexagon-save-parent-vsp, functions that allocate an HLX vector
stack frame also save the caller's VSP on the scalar stack and describe
it in the CFI, so a debugger can unwind VSP. Clang enables this for -g
builds. The VSP is copied through R7.
Assisted by AI
Co-authored-by: Fateme Hosseini <fhossein at qti.qualcomm.com>
Co-authored-by: Ankit Aggarwal <aankit at qti.qualcomm.com>
[AArch64] Don't lower i16 to f16/bf16 bitcasts through vectors without NEON (#242705)
Since #196341, `LowerBITCAST` lowers an i16 to f16 or bf16 bitcast as a
`scalar_to_vector` to v8i16 plus an extract from the v8f16 bitcast.
Without NEON these vector types aren't legal, and type legalization
scalarizes them back into the same bitcast, so llc never finishes. For
example, `bitcast i16 %x to half` with `-mattr=-neon` hangs. `-O0` hangs
too, because GlobalISel falls back to SelectionDAG for these functions.
When v8i16 isn't legal, return SDValue() so that the bitcast is expanded
through a stack slot. Codegen with NEON doesn't change.
Assisted by Claude (Anthropic).
CodeGen: Collect shrinkToUses subrange uses once per interval (#243345)
shrinkToUses on an interval with subranges repeatedly walked the
register's use list and looked up each use's slot index. Collect the
used slots and lanes once and share them across all the subranges.
llc instructions:u, AMDGPU sample: -0.07%, output identical.
Subrange-heavy files: rocsolver stedc -0.40%, rocprim warp_sort
(gfx1100) -0.50%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
NAS-145276 / 28.0.0-BETA.1 / Reject "/" in nvmet NQNs and guard configfs entry names (#20230)
NQNs are used as directory names below /sys/kernel/config/nvmet, but
validation only checked the part before the first colon, so a hostnqn or
subnqn (or a subsystem name used to generate one) containing "/.." could
create entries outside of it.
Reject "/" and control characters in NQNs, validate subnqns generated
from the subsystem name, and check that each name is a single entry
before the kernel render uses it in a path.
PowerPC: Remove clearKillFlags calls on virtual registers (#239803)
Kill flags are no longer permitted on virtual registers, so clearing
them is a no-op. Remove the calls where the register can only be
virtual.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Show a clean message when an app migration blocks an upgrade
App migration scripts that block an upgrade raise an exception, so the user sees a full Python traceback in the error dialog. The app was also stopped before the migrations ran and was left stopped after the failure.
A migration script can now refuse an upgrade by printing its reason to stderr and exiting with os.EX_CONFIG. Middleware then fails the upgrade with only that message and the EOPNOTSUPP error code, which the webui can tell apart from an unexpected failure. Migrations now run before the app is stopped, so a refused upgrade leaves the app running. Any other failing exit code is reported as before.
IR: Answer mayHaveSideEffects with one switch (#242589)
Previously this emitted 3 calls, each switching over the opcodes. Fold
to one which only needs to query attributes for calls.
CTMark instructions:u: O3 -0.13%, ThinLTO -0.17%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Use EOPNOTSUPP for a blocked app upgrade
The webui treats an EFAULT error as unexpected. A blocked upgrade is an expected refusal, so it now raises with EOPNOTSUPP and the webui can show the message on its own.
Return a string from get_upgrade_block_message
The block_upgrade value is read from YAML and is typed as Any, so mypy refused to return it from a function declared to return a string. The value is now converted with str before it is returned.
[CIR] Make cir-canonicalize a full canonicalizer
cir-canonicalize applied the CIR canonicalization patterns and folders
only to a hand-written list of operations. It now builds the pattern set
once in initialize() and runs the greedy driver over every operation, so
every pattern and folder applies everywhere. Only operations that
rewriting left dead are erased, such as the inputs of a folded
operation: CIR stays close to the source, so unused locals and ignored
expressions are kept as in classic codegen. Empty scopes and switches
were removed only because they were dead, so they get explicit
canonicalization patterns.
The pass uses the multi-op driver because the region driver always
erases blocks without a CFG predecessor, and a block that starts with
cir.label is reached only through cir.goto until the goto solver runs.
Region simplification stays off for the same reason. The new
test-convergence option fails the pass when the driver does not reach a
fixpoint, as in the upstream canonicalizer.
Assisted-by: Claude Code (claude-opus-5-5).
[mlir] Add a dead code elimination mode to the greedy rewriter
The greedy pattern rewrite driver always erases trivially dead
operations, so a client that wants canonicalization patterns and
folders without dead code elimination has no way to get it. Add
GreedyRewriteConfig::setDeadCodeElimination and the matching
dead-code-elimination option of the canonicalizer pass, with three
modes:
- all, the default, erases every trivially dead operation as before.
- newly-dead keeps the operations whose results are unused when
rewriting starts and erases any other operation once it is dead, so
what a fold or pattern leaves unused goes away.
- disabled erases an operation only by a pattern or by folding.
Region simplification is separate and still removes dead values unless
it is disabled too. The deadness cache skips invalidation while it is
empty, so a run that never queries it pays nothing for its tracking.
Assisted-by: Claude Code (claude-opus-5-5).
[DAGCombiner] Mark uint_to_fp widened through trunc nuw as nneg
The source of a trunc nuw fits in a strictly narrower type, so it is
non-negative. Without nneg x86 lowers the widened conversion through the
unsigned i64 expansion.
Assisted-by: Claude Code Opus 5.5
[X86] Mark vXi64 int to fp undesirable without AVX512DQ
Without avx512dq there is no vector conversion from i64 elements to f32
or f64, so widening the conversion of a source truncated with nsw or nuw
back to i64 makes it slower.
avx512fp16 converts i64 elements to f16 directly, so the widening folds
now pass the node and the check sees the result type.
Assisted-by: Claude Code Opus 5.5