[Hexagon] Make global scheduler V2 deterministic (#248187)
Use SetVector and DenseMap for containers the pass iterates or looks up,
and llvm::stable_sort for regions and clusters, so pointer values and
std::sort tie order no longer affect the output.
Assisted by AI
[Hexagon] Replace combines with REG_SEQUENCE (#247702)
Combines that build a register pair (A2_combinew, V6_vcombine,
LX_combine_w) were kept through register allocation when nothing earlier
removed them. For HLX this left an extra combine in loop bodies:
{ L11:10 = combine(L11,L10) }
HexagonPeephole now rewrites any instruction with isRegSequence and a
virtual destination into REG_SEQUENCE, so the register coalescer can
assign both halves directly to the pair. A2_combinew gets the
isRegSequence flag; V6_vcombine and LX_combine_w already had it.
-disable-combines-to-regseq turns this off.
Assisted by AI
Co-authored-by: Ikhlas Ajbar <iajbar at qti.qualcomm.com>
Co-authored-by: Krzysztof Parzyszek <kparzysz at qti.qualcomm.com>
bsdinstall: Fix checksum dist_to_statusvar(), remove evals
Replace crude sed encoding scheme with robust forkless scheme that
cannot lead to evaluated code when trying to set status vars.
Whitespace, control characters, redirects, exclamations, backticks,
dollars, globs, and more could be injected into an eval statement
through DISTRIBUTIONS. Using f_str2varname on the remaining invalid
varname chars makes it safe but use setvar builtin anyways.
Replace shell variable indirection with f_getvar for readability.
Comment status number meanings while here.
Fixes: 47d669f10ea3 (bsdinstall: Encode dists to valid variable names in checksum script)
MFC after: 2 weeks
Reviewed by: kfv
Differential Revision: https://reviews.freebsd.org/D62045
libdevdctl: fix multiple problems with the tests
* Fix a clean buildworld. Only build the tests when MK_TESTS is active.
It won't be during the libs phase when libdevdctl is first built.
* Remove the "-I ${LOCALBASE}/include" directive. It was necessary back
in 2016 when these tests were first added. But it no longer is,
because googletest got imported into contrib in 2019. Also, the
pthread stuff is not needed, because bsd.test.mk sets it.
Fixes: 3cd9170882a ("Acutally connect the libdevdctl tests to")
Reported by: llm-postcr
MFC after: 1 week
Sponsored by: ConnectWise
NAS-145366 / 27.1.0 / Match zpool status when estimating scan and expansion time remaining (#20368)
`pool.query` and `zpool.query` gave a running scrub or resilver a time
remaining without any of the conditions `zpool status` applies. The
Storage Health card could show "8523 years ... remaining" before a scrub
had issued anything, an estimate that kept climbing while a scrub was
paused, a negative or blank time once more had been issued than ZFS
expected, and months or years early in a pass after the pool was
imported mid-scan. The card shows this value whenever no live scan
updates are arriving, which is the case for the whole of a scan that
resumed after a reboot, HA failover or middleware restart. The boot disk
replacement job also prints it in its progress message.
- Scan time remaining follows `zpool status`: there is none while
paused, before a scrub has issued anything, before a resilver has
repaired anything, once more has been issued than expected, or while
this pass's average speed is below 10 MiB/s. Otherwise it is the same
whole-second figure `zpool status` prints.
- RAIDZ expansion time remaining is none while the expansion waits for a
[4 lines not shown]
Fix regression with __has_embed on file that cannot be read
It's unclear if it is desirable, but it's the current behaviour of
clang and gcc that __has_embed is resolved on files that cannot be read, so
avoid changing behaviour even in PCH/modules that use them as inputs.
Independently of whether we want unreadable files to be __has_embedable, this
is slightly better in that it avoids reading such files unnecessarily, and
avoids rebuilding modules when such files change their contents/mtime but not
their size. In principle we could go further and only rebuild if the size
changes between 0 and non-zero, but that would require special handling in the
ASTReader instead of just falling out of existing checks, so I don't think it's
worthwhile.
[Sparc] Remove write-only SparcRegisterInfo::Is64Bit (NFC) (#248364)
The last reader was removed on September 17, 2026 in commit
cd6dab01e6b968fe9eacd417777afb1e1ba7b676. This patch also removes its
initializer and the now-unused STI constructor parameter.
Assisted-by: Antigravity
[Instrumentation] Remove write-only and unused member variables (NFC) (#248363)
FunctionStackPoisoner::IntptrPtrTy: The last readers were removed on
October 14, 2025 in commit 489a921796fe8d33de0f055ca6084e8f54cb1d84.
This patch also removes its initializer.
MemorySanitizerVisitor::OriginPHINodes: Added on November 29, 2012 in
commit d4bd7b73e370eb429d1d2ef884967b88a299b763 without any uses.
FuncPGOInstrumentation::TLI: The last reader was removed on July 11,
2023 in commit 95014050dac528f53ab704d62a16a44ed0df032b. This patch
also removes its initializer.
Assisted-by: Antigravity
[CIR] Emit cir.unreachable after a noreturn call (#248489)
CIRGen kept emitting into the block after a call to a noreturn function,
so a C function like `int f(void) { stop(); }` lowered to a load of the
uninitialized return slot and a `ret`, where classic CodeGen emits
`unreachable` right after the call. This matches classic `EmitCall`: a
noreturn call now ends its block with `cir.unreachable`, and any code
after it goes into a new block without predecessors. The tests check
CIR, lowered LLVM and classic output for a call before falling off the
end, a call in a conditional arm, a call inside a cleanup (lowered to
`invoke`), and an sret-returning call; `noreturn.cpp` now checks the
`unreachable` too.
Assisted-by: Claude Code (Opus 5.5).
NAS-145583 / 28.0.0-BETA.1 / When locking a user account, use the common `before_user_deactivation` check instead of the copy-pasted condition (by themylogin) (#20371)
Original PR: https://github.com/truenas/middleware/pull/20359
Co-authored-by: themylogin <themylogin at gmail.com>
[clang][OpenMP] Emit lastprivate final copies in no-loop kernels (#224045)
Promotion rejected lastprivate because the no-loop branch leaves the
worksharing path before it privatizes or copies out, so the clause would
have been silently dropped.
Privatize the non-counter variables in the parallel region and copy them
out under the last iteration that applyWorkshareLoop publishes. Loop
counters stay at the distribute level and reach EmitOMPSimdFinal.
Split out of #205325.
Depends on: llvm/llvm-project#224040
Assisted by: Claude Opus 5.5
[scudo] Do not allocate in linux report functions. (#248204)
There is a path that could call strerror when trying to get error
messages for an errno value. The old code tried to check glibc for that,
but it might not be sufficient and still fallback to strerror. Instead
use strerrordesc_np if we can guarantee it's available on Android and on
certian versions of glibc. Use strerror on Trusty which is based on musl
and does not allocate.
If none of those are available, simply emit the errno number since this
is an informational message.
Fix the test to only allow the desc message for Android and Trusty and
allow either the desc or errno if on any other OS.
When locking a user account, use the common `before_user_deactivation` check instead of copy-pasted condition
(cherry picked from commit fced49b4eec4a4119dd59a8ae741de3b6260394f)
[flang][Frontend] Add -fexperimental-openacc-exec
The flag enables the experimental support for executing OpenACC constructs.
Plain -fopenacc stays as it is, and the constructs that are not supported yet
are still rejected when it is given. The driver passes the flag to the
frontend, and the frontend keeps it in the language options. Nothing uses it
yet.
Assisted-by: Claude Sonnet 5.5
[AArch64] Fix the sqdmulh combine for v2i16 inputs and narrow multiplies (#247053)
trySQDMULHCombine extended v2i16 inputs to v2i32, so sqdmulh ran on
32-bit lanes and gave the wrong result. Widen them to v4i16 instead.
Also skip the combine when the multiply can wrap, which happens when it
is narrower than twice the input width and has no nsw.
Fixes #246969.
Assisted by Claude (Anthropic).
[CUDA][HIP] Fix Itanium mangler assertion on kernels in template arguments
The Itanium mangler made a `GlobalDecl` from a `NamedDecl` when it mangled a
declaration that is referenced from a template argument or an expression. That
c'tor hits an assertion for a CUDA or HIP kernel ("Use other ctor with GPU
kernels!"), because the `GlobalDecl` of a kernel must tell whether it refers to
the kernel or to its host stub.
For example, clang with assertions crashed on this host code:
```
__global__ void kern();
template <auto F> int prepare() { return 0; }
int use() { return prepare<kern>(); }
```
There are three places that needs to be fixed: `mangleValueInTemplateArg` (the
example above), the `DeclRefExpr` case of `mangleExpression` (a kernel named in
an expression in a function template signature), and `mangleTemplateArgExpr`
[9 lines not shown]
[X86] Return the zero vector directly in the known-zero fold
The fold only handles a single input, so return from the loop instead
of setting a flag.
Assisted-by: Claude Code (Claude Opus 5.5)
[flang][Driver] Make the offload arch detection tool option visible to flang (#247265)
--offload-arch-tool= chooses the tool that detects the architecture of
the GPUs of the system, for --offload-arch=native and when no
architecture is given. It was only visible to the clang driver. Make it
visible to flang, so that the flang driver can be pointed at a tool, and
tested without a GPU.
Assisted-by: Claude Sonnet 5.5
---------
Co-authored-by: Tarun Prabhu <tarun at lanl.gov>
[GVN][MemDep] Handle PartialAlias for lifetime.start more precisely (#247924)
A lifetime.start gets PartialAlias for inbounds accesses to a statically
sized allocation. For such accesses, we can precisely return a Def
instead of treating them as MayAlias, which leads to a clobber.
After taking a look at MDA, we found that we can also fix this over
there, as it uses getAfter, which returns a Clobber for inbounds
accesses to statically sized allocations.
[SPIR-V] Support SPV_INTEL_rounded_divide_sqrt extension (compute only) (#238403)
Implement `SPV_INTEL_rounded_divide_sqrt` extension support, that allows
div and sqrt to have `FPRoundingMode` decoration. Currently it's
supported for compute only, no shader support will be added unless
there's explicit requirement for it in the future.
Note that currently, constrained arithmetic instructions other than div
and sqrt can also be decorated with `FPRoundingMode`. This is illegal
and will be rejected by spirv-val, but it's out of scope for this PR. It
will be fixed by a future PR instead.
[AMDGPU] Insert s_nop 0 for cross-wave VALU co-execution on gfx942/gfx950 (#242519)
On subtargets with FeatureCrossWaveVALUCoexecution, a SIMD can co-issue
VALUs of two waves, depending on both VALUs. While an older wave issues
a sequence of VALUs, a younger wave's VALU that cannot be co-issued with
them stalls, and so do the VALUs that follow it. Inserting s_nop 0 in
the older wave lets the younger wave issue that VALU.
SIPreEmitPeephole now inserts s_nop 0 where this lets the younger wave
co-issue a sequence of VALUs. It does so only in small loops that
consist mostly of such VALUs, outside MFMA shadows, and when the
occupancy is not known to be 1.
-mattr=-cross-wave-valu-coexecution disables the transformation.
Fixes LCOMPILER-3001.
Assisted-by: Claude Opus 5.5