Restructure virt68k clocks to be more or less the same way that clock
handling is structures in hb68k, with a few tweaks:
- Keep the "delay clock" that virt68k requires to implement delay().
- Add the notion of "clock priority"; higher-priority clocks get chosen
for duty before lower-priority clocks.
shader-slang: update to 2026.23
- Establish AST builder scope in Linkage::specializeType
- Diagnose generic entry points specialized with an interface type
- Fix hang in reverse-mode CFG normalization of existential
temporaries
- Build Windows aarch64 CMake option jobs on native ARM64
- Keep existential bindings when the parser checks a generic base
- CI: do not require the SM80 jobs in check-ci
- Split slang-test coverage between the nogpu, T4 and SM80 CI tiers
- Fail basic-type joins when neither type is better
- Specialize descriptor-heap fetch arguments into callees
- Support HLSL declarations as if and while conditions
- Run more tests on more targets with targets=3Dall
- Call suppressDebugDialogs in render-test-tool innerMain
- Add test for multidimensional array declaration ordering
- Overhaul integer constant folding in the front-end
- CUDA: forward entry-point uniform aggregates by address
- Fix SPIR-V crash when a function uses a texture chosen at run time
[19 lines not shown]
devel/sgb: Update to version 2021-02-02
This adds one file (word_giant.ch), increases a buffer in gb_gates.w,
and brings two editorial fixes to documentation.
On the way switch the download site from ftp to https.
[X86][APX] Fold loads into NDD CMOVs that are converted to branches (#245602)
Without prefer-ndd-mem, ISel folds only RIP-relative loads into NDD
CMOVs, so select(c, load, x) becomes MOVrm + CMOVrr_ND instead of
CMOVrm. The force-mem-operand conversion in X86CmovConversion no longer
sees the load, and the CMOV is kept where non-APX code gets a branch.
Fold any load into an NDD CMOV when X86CmovConversion converts memory
operand CMOVs to branches, so the existing CMOVrm conversion applies.
Where it keeps such a CMOV (e.g. an unpredictable select), unfold the
non-RIP-relative load again.
X86::foldNDDCmovLoads() holds the condition, so ISel and
X86CmovConversion agree on when a load is folded and unfolded.
-x86-cmov-converter-ndd-load=false disables the fold.
Assisted-by: Claude Opus 5.5 <noreply at anthropic.com>
amd64: Avoid redundant CR0 writes on switches to kernel threads
fpu_activate_sw() sets CR0.TS whenever it switches to a kernel thread,
or to a thread inside fpu_kern_enter(). The bit is clear only while a
thread owns the FPU, and at a context switch the only possible owner is
the old thread. When fpcurthread is NULL the bit is already set and
the write to CR0, which is serializing, changes nothing. That is the
common case for switches between kernel threads, such as the idle
thread and interrupt threads on a router.
Write CR0 only when fpcurthread was set, as cpu_switch() did before
the eager FPU switch became the default in d1a07e31e5cc, and assert
that TS is set otherwise.
Reviewed by: kib
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D62206
[lld][MachO] Stream FunctionStartsSection from laid-out code sections
Currently, `FunctionStartsSection::finalizeContents()` scans every
`ObjFile`'s full symbol table, resolves `defined->getVA()` for each live
code symbol, sorts all addresses with `llvm::sort`, and encodes ULEB128
deltas through `raw_svector_ostream`.
By the time `FunctionStartsSection::finalizeContents()` runs, output
segments, their sections, and each `ConcatOutputSection`'s inputs are
already laid out in ascending virtual address order, and each input
section's `symbols` list is kept sorted by offset. This PR walks those
laid-out code sections directly and streams ULEB128 deltas straight into
`contents` via `llvm::appendLEB128`. If a malformed input produces an
out-of-order symbol address, it reports an `error()` and skips the
symbol.
To avoid calling `isCodeSection()` on every subsection, we add a
`SectionView` wrapper so `isCodeSection()` can accept either a `Section`
or an `InputSection`, and cache its result across consecutive inputs
[10 lines not shown]
[VPlan] Remove header masks whose tail lanes aren't used
Replace a use of header-mask && x with x if the user, transitively
through freeze, logical-and, not and mask.beforefirst(freeze ...), only
reaches masks that are and'ed with the header mask again. The header
mask is a prefix and lane i of mask.beforefirst only depends on lanes
0..i, so the lanes outside of the header mask are never used.
This avoids the i1 vp.merge that EVL tail folding needs for the inner
header mask, e.g. in the early exit mask.beforefirst(freeze(header-mask
&& c)) and in switch default edges.
[VPlan] Allow tail folding early exits with side effects
Continues the work in #179595.
This allows us to tail fold e.g. the following loop:
```c
extern char a[1024], b[1024], c[1024], y[1024];
void two_guards(void) {
for (int i = 0; i < 1000; i++) {
if (a[i] == 0)
break;
if (b[i] > 3) {
if (c[i] < 9)
y[i] = 1;
}
}
}
```
[30 lines not shown]
[VPlan] Support tail folding uncountable early exits
Enables the first step towards #179595. After #237254, the MaskedHandleExitInVectorLoop early exit style uses the CFG to handle masking for early exit loops. This allows it to compose with tail folding which is also handled via the CFG in #176143.
This allows us to tail fold the following loop:
```c
extern char x[256];
int f(char * restrict y) {
for (int i = 0; i < 256; i++) {
if (x[i] == 0)
return i;
}
return -1;
}
```
Into this on RISC-V:
[18 lines not shown]
[VPlan] Use vputils::findCanonicalIVIncrement in more places. NFC
In a future patch we want to enable more scenarios with early exits and tail folding. In these scenarios the terminator will no longer be a BranchOnCount/BranchOnCond but a BranchOnTwoConds, so a bunch of canonical IV matchers break. Use vputils::findCanonicalIVIncrement instead since it searches the users of the canonical IV instead of looking at the terminator.
[VPlan] Allow early exit loops with side effects by masking in the vector loop.
When all blocks with side effects are dominated by every early exit, we can vectorize the loop if we mask off any lanes past the exit. We can do this with control flow:
```mermaid
flowchart TD
header --> exiting
exiting -->| exit mask | sideeffects --> latch --> latch.split
exiting -->| !exit mask | latch.split
```
For every early exiting block we add a branch to the latch on `!mask.beforefirst(exitcond)`. This is implemented in UncountableExitStyle::ReadOnly which is now renamed to MaskedHandleExitInVectorLoop.
This is a complementary exit style to MaskedHandleExitInScalarLoop. If any of the side effects aren't dominated by the early exit it still falls back to the scalar loop style, which is why none of the existing early exit side effect tests changed. Masking in loop is profitable for RISC-V and I'm assuming it's also profitable for AArch64 too, but if not then we can add a TTI hook for a preferred exit style.