[CGP] Fix incorrectly sized ConstantInt crash (#239885)
Fixes a buildbot failure after #226197,
https://lab.llvm.org/buildbot/#/builders/210/builds/13772.
We were always using a 64-bit APInt for StructSize which causes a type
mismatch and crash for 32-bit targets with scalable vectors, e.g.
riscv32 with +v
Drop the webui dataset consumers unit test
## Context
The test only ran the matcher against hand-built rows; `webui.dataset.details` is better checked through the API on a live system.
Read pool.dataset.details from zfs.resource
## Problem
`pool.dataset.details` collected its datasets through `pool.dataset.query` and the legacy `generic_query` walk, which counts snapshots by iterating every snapshot of every dataset.
## Solution
List the datasets with `zfs.resource.list_impl` and count snapshots with `zfs.resource.snapshot.count_impl`, then pass each row through the existing legacy property and user property normalizers and rebuild the nested children, so the output is unchanged down to key and list order. The consumer matching is untouched. If the recursive snapshot count fails, each dataset is counted on its own so only the one that fails reports 0, as before.
Add webui.dataset.details
## Context
The Datasets page loads everything through `pool.dataset.details`, which returns the legacy property shape, repeats every dataset once per ancestor under `children`, attributes a locked child's shares to its parent too, lists an iSCSI extent once per target it is mapped to, and runs every consumer query whatever the caller's roles.
## Solution
`webui.dataset.details` returns one flat row per dataset, each after its parent, carrying the zfs.resource properties and user properties, tier, snapshot count, and the shares, VMs, containers, apps and data protection tasks that use it.
- **Ownership**: a share, extent or namespace belongs to the dataset mounted exactly at its path, otherwise to the dataset its stored `dataset` column names, otherwise to whatever the kernel resolves the path to. Each iSCSI extent is listed once.
- **Authorization**: each consumer and task section, and the snapshot count, is null when the caller may not call the method it comes from, and that source is not queried.
- **Cost**: one dataset walk, one snapshot count and one query per source, with path resolution only for paths that have neither an exact mountpoint nor a usable column.
Use plain loops and tuple constants in dataset details
## Problem
The task matchers in `webui.dataset.details` counted through nested generator expressions wrapped in `Counter` and `dict`, which were hard to read, and the property lists for both details endpoints were mutable module-level lists.
## Solution
The matchers count with plain loops, and both property lists are tuples passed to the query as lists, in the same order as before.
Inline the legacy details property list and drop the remaining comprehensions
## Problem
`pool.dataset.details` kept its property list as a module-level constant that only one call used, and `webui.dataset.details` still built its gating, sections and entry fields through conditional comprehensions.
## Solution
The property list is back inline in the query call, in the same order, so the legacy output is unchanged. The gating, section and entry field building in `webui.dataset.details` use plain loops.
Fix snapshot count shortcut and consumer path ownership
## Problem
The snapshot count shortcut read the link count of `<mountpoint>/.zfs/snapshot` without checking which dataset is mounted there, so an unmounted dataset whose mountpoint is another dataset's root, or the lower of two datasets stacked on one path, got the other dataset's count. In `webui.dataset.details`, paths that needed the kernel were resolved with an O_RDONLY open, so a FIFO at a share, app, container or VM path hung the call and a device node had its driver opened. The stored share dataset also won over a dataset mounted on top of the path later, and an unmounted dataset took sole credit for shares that really sit in its parent.
## Solution
- **Snapshot count**: the shortcut asks statmount for the source of the mount holding that directory and uses the link count only when it names the dataset being counted, otherwise it iterates the snapshots as before. That is one extra cheap syscall per uncached mounted dataset.
- **Consumer paths**: paths are resolved with statmount on an O_PATH lookup, the same way `pool.dataset.details` does, so the file itself is never opened. Only mounted or locked datasets claim their mountpoint, and the stored dataset is trusted only while it is still the nearest such claim above the path or is an unmounted dataset at exactly that path, so most consumers still need no syscall at all.
SelectionDAG: Use the physical register class for tied inline asm inputs (#238705)
When an inline asm input is tied to a physical register output, the
input's virtual register was created in the class for its value type.
That class is not required to contain the physical register, in which
case the input is materialized in the wrong bank and then copied into
the output register. On AMDGPU, an immediate tied to an AGPR output was
materialized in an SGPR, then copied to the AGPR, through a VGPR on
gfx908.
Use the minimal class of the physical register when the class for the
value type does not contain it. Untyped operands already did this
unconditionally; this extends it to typed operands. Keep the value
type's class if the physical register's minimal class is not
allocatable.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add missing attributes to memory and allocator libcalls
Add the attributes inferLibFuncAttributes would give these functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[RISCV] Cache repeated subtarget lookups
Cache repeated RISC-V subtarget queries by the complete function
attribute set, following the AArch64 implementation. Avoid temporary
copies of CPU and feature strings when constructing a new lookup key.
Three interleaved CTMark pairs reduce median compile time by 0.247%
and geomean by 0.261%.
Assisted-by: TRAE CLI (GPT-6)
Reviewers: nikic, topperc, lukel97, mshockwave
Reviewed By: lukel97, topperc
Pull Request: https://github.com/llvm/llvm-project/pull/240339
[RISCV] Minor code improvements to extractRotateInfo. NFC (#240727)
Remove a subtraction of 1 by increasing the RunEnd values. This makes
RunEnd more like an end iterator where it is one past the last position.
Increase the constant for the non-negative case to (64+12). This
guarantees that RunEnd - Run is always a positive value. The final
Rotate value is taken modulo 64 so this doesn't affect the result. It
does remove an AND with a negative value which felt off to me. Replace
the AND with 63 with modulo 64 and let the compiler make the AND.
Fix an off by one mistake in the comment.
[ELF] includeInSymtab: Fix crash for SHF_MERGE section symbol with out-of-range addend (#240732)
includeInSymtab passes a section symbol's st_value, which is not
range-checked, to getSectionPiece. A value at or past the end of the
SHF_MERGE section causes an assertion failure or crash.
A local section symbol is not copied to .symtab, and a non-local one
gets the "offset is outside the section" error from getSymVA.
Fix #235203
[AVR][MSP430] Explicitly specify the underlying type of wchar_t (NFC) (#240653)
Make the choice deliberate instead of relying on the default.
The changes are covered by existing preprocessor tests.
Do not allow TIOCSCTTY, TIOCNOTTY, or TIOCSPGRP on the pty master. Return
ENOTTY for all 3 of these. They could create incoherent session states,
leading to dangerous UAF reported by openai (unfortunately their proposed
patch was batshit crazy and made the situation worse, due to not identifying
this as root cause, and writing code to support the condition). with claudio
various versions ok kettenis kirill and others
MC: Handle XCOFF directives in the null streamer (#239821)
MCNullStreamer only overrode emitXCOFFSymbolLinkageWithVisibility, so
llc -filetype=null on AIX hit the llvm_unreachable in the MCStreamer
base implementations of .lcomm, .ref, .except and .info emission.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>