[DirectX] Prevent `dxil-resource-access` from entering an infinite phi loop (#211345)
The pass will enter an infinite loop when collecting the handles if the
phi nodes loop: https://godbolt.org/z/77sr89oMj.
The pass will enter an infinite loop when trying to resolve the handle
index of a dynamic resource if the phi nodes loop:
https://godbolt.org/z/h4oW7Me5G.
This is resolved by updating `collectUsedHandles`/`getAccessIndices`
with a visited set of phi nodes.
Resolves, in part, https://github.com/llvm/llvm-project/issues/211121
Assisted by: Claude Opus 4.8
CodeGen: Fix machine sink critical edge crash on an undef register
Found by AI while working on something else.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
CodeGen: Fix MachineSink trivial coalescing crash on an undef register (#216632)
Fix unchecked getVRegDef use. Found by AI while working on something
else.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[MLIR][NVVM] Enable strict property assembly format
Enable strict property assembly format for NVVM and bind every inherent
property directly in operation formats. Use declarative oilist clauses for
unordered modifiers and named optional operands, while retaining custom
assembly only for compact MMA syntax and the optional CTA group.
Update the NVVM and Flang tests to use the direct property syntax.
Assisted-by: Codex
I noticed boot-time /tmp pruning could take a substantial amount of time.
The purpose is two-fold, to remove cruft, and stop newly authenticated users
from seeing it. Took about 20 drafts to get it right. The /tmp files
are now pushed into a mktemp directory, then deleted async, except a few are
removed immediately for the case of the filesystem being full. After daemon
startup has completed, we wait for the removal job to complete (let's keep an
eye on this, because it is possible we actually don't need to wait)
draft iterations with millert, afresh1, and dgl
[clang][HLSL] Complete the pattern an instantiation is built from, not the primary template (#216388)
Fixes https://github.com/llvm/llvm-project/issues/212575
When an external AST source lazily supplies class template patterns,
Clang stopped asking it for definitions once the primary pattern had
been completed. A partial specialization declared after that point is
then instantiated from a pattern that had never been defined, failing
with `err_template_instantiate_undefined`.
So whether a declaration compiled depended on what had been declared
before it (as seen in https://hlsl.godbolt.org/z/vW3xGY6sW).
The problem Is that `ClassTemplateSpecializationDecl::Create` copies the
`hasExternalLexicalStorage()` flag only from the primary template, and
only while the primary template was still incomplete. Partial
specializations therefore failed when the primary template was
completed, hence exhibiting the aforementioned
`err_template_instantiate_undefined` error behavior when the primary
template was completed.
[14 lines not shown]
[libc][realpath][test] Allow test directory to contain symlinks (#216828)
CI for https://github.com/llvm/llvm-project/pull/212925 failed because
the `libc-riscv32-qemu-yocto-fullbuild-dbg` buildbot on Yocto uses a
symlink for `/tmp` to `/var/volatile/tmp`
([source](https://github.com/openembedded/openembedded-core/blob/07a342aa80c7349dd014f743a695a5e006add8df/meta/recipes-core/initscripts/initscripts-1.0/volatiles#L32)).
It's fair enough that a system may define `/tmp` as a symlink, so this
PR updates the realpath tests to call `realpath` on the test directory
to resolve symlinks.
This PR also updates the test to use `libc_make_test_file_path` instead
of `/tmp`. Previously, the tests used `/tmp` because
`libc_make_test_file_path` might have symlinks in it. Since we fully
resolve symlinks now, we can use the more standard approach now.
[NVPTX] Add NewPM codegen pipeline (#215712)
This exactly mirrors the LegacyPM implementation and produces identical
PTX for all lit tests. Right now this is opt-in with `-enable-new-pm`
for llc and clang.
[MLIR][NVVM] Spell strict assembly properties directly
Bind every NVVM inherent property in its operation assembly format and
re-enable strict property parsing for the dialect. Use direct named clauses
for declarative formats and custom MMA parsers while retaining dictionaries
for discardable attributes.
Assisted-by: Codex
[flang][cuda] Allow call to len intrinsic on host with device argument (#216846)
This is fine to call `len` intrinsic on the host with a device actual
argument since the descriptor is allocated in managed memory.
Refuse snapshot rollback up front when newer snapshots are blocked
## Problem
Rolling a dataset back to an older snapshot crashed with a raw traceback whenever a newer snapshot had a dependent clone. Two separate failures were in play: `clone_rsrc.destroy()` does not exist on any pylibzfs resource type, so it raised `AttributeError`, which is not a `RuntimeError` and so escaped both surrounding handlers; and `lzc.destroy_snapshots()` raises `ZFSCoreException`, a sibling of `ZFSException` rather than a subclass, so the handler wrapping it never fired. There was also no pre-flight of any kind, so nothing could refuse cleanly — and because destroy failures were silently swallowed and the loop continued, a failed destroy left the rollback to fail later with a message telling the user to pass a flag they had already passed.
## Solution
- **Destroy clones through the handle.** `tls.lzh.destroy_resource(name=...)` replaces the non-existent resource-level `destroy()`, matching how the destroy path already does it.
- **Catch both exception families.** `lzc.destroy_snapshots()` failures are now caught alongside `ZFSException` and converted, rather than escaping as a raw traceback.
- **Refuse before destroying anything.** A new pre-flight walks the whole dataset set — including the full `recursive_rollback` tree, before the fan-out loop rather than inside it — and collects every blocker it can see: dependent clones when `recursive_clones` is not set, holds in all cases, and clones that cannot be destroyed non-recursively because they have children or snapshots of their own. Previously a blocker on a child was discovered only after the parent had been irreversibly rolled back. This is fail-first, not atomic: a clone or hold created between the pre-flight and the destroy still fails mid-loop, and only a concurrently pruned snapshot (ENOENT) is tolerated.
- **Typed errors at both boundaries.** Blockers raise `ZFSRollbackBlockedException`, mapped to `EBUSY` with a message naming each blocking snapshot and what blocks it. `pool.snapshot.rollback` had no exception mapping at all and leaked every impl failure as an untyped traceback; it now mirrors `zfs.resource.snapshot.rollback`.
- **`force` now means how forcefully, not whether.** Clones are always unmounted before destroy, since `zfs_destroy()` does not unmount and a mounted clone could never be destroyed otherwise; `force` selects a forced unmount, matching the `zfs destroy` CLI. Unmount no longer requests a key unload, matching what the CLI's rollback path does.
Adds unit coverage for each defect and the pre-flight, plus integration coverage for clone-present, nested-clone, hold-present, and cross-dataset cases. `pool.snapshot.rollback` had no api2 coverage before this.
Newer bookmarks remain unhandled: pylibzfs exposes no bookmark primitives, so a newer bookmark still fails the rollback with an empty conflict list. That needs a pylibzfs change first and is tracked separately.
[RISCV] Simplify the SelectCompressOpt patterns. NFC (#216819)
Use a PatLeaf and a predicate to check the condition code instead of
having a SETEQ and SETNE pattern. CCtoRISCVCC will take care of
converting the condition code.
[CIR] Mark bit-field access units as their own member kinds
A bit-field access unit is only as wide as the compiler needs it to be,
which can be narrower than the type the bit-fields were declared with.
Nothing in the record type says so. The unit just gets `data`, or
`empty` when none of its bit-fields are named, and an ordinary field
gets those same marks.
That makes `struct { long long x : 32; }` and `struct { unsigned x; }`
look identical here. Classic CodeGen tells them apart and coerces the
first to `i64`, the second to `i32`. It reads the declared type, where
the bit-field still leaves user data past bit 32.
The fix is to give a unit its own marks, `bitfield` and
`empty_bitfield`. Nothing reads them yet, and no record's emptiness
answer changes. The next PR records a zero-width bit-field, which the
marks miss too, and pad-aware classification can then use both.
Assisted-by: Cursor / claude-opus-5
[VPlan] Verify VPIRFlags when creating VPWidenRecipe. (#213039)
VPWidenRecipe's constructor didn't check its flags at all, unlike
VPInstruction and VPWidenCastRecipe. Add checks and fix remaining
violations.
PR: https://github.com/llvm/llvm-project/pull/213039
To fix test failures. (#216763)
This PR is to fix test failure in the AIX buildbot.
Flang supports 64-bit mode only. Add a config file to set OBJECT_MODE.
[MLIR][SCF] Prioritize single-iteration loop inlining (#188986)
Loops with a statically known trip count of one expose a single acyclic
path and can be handled by the existing region branch op inliner.
Give that rewrite a higher benefit than the generic region branch op
canonicalizations. This ensures that the loop is inlined before dead
successor inputs can be removed independently and temporarily invalidate
the op under expensive pattern API checks.
This fixes some tests with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS
enabled.
Assisted-by: Codex