[LV] Narrow truncated inductions in a VPlan transform (#220730)
VPRecipeBuilder::tryToOptimizeInductionTruncate matched a truncate of an
induction phi on the underlying IR, and it built the narrowed
VPWidenIntOrFpInductionRecipe from the recipe behind the truncate's
operand.
VPlanTransforms already answers the same question on VPValues in
getOptimizableIVOf, which returns the header IV whether the operand is
the IV
itself or an add of the IV and its step.
Add VPlanTransforms::narrowInductionTruncates and do the match there,
reusing
getOptimizableIVOf and restricting it to the phi for now. The pass runs
right
after makeCallWideningDecisions, which preserves the ordering against
makeScalarizationDecisions that the recipe builder relied on. Building
the
recipe in the transform also removes the need for the conversion loop to
[3 lines not shown]
[libc] Implement dual freestore rotation for baremetal heap (#209811)
Implement dual FreeStore rotation in FreeListHeap under
LIBC_COPT_BAREMETAL_HEAP_ENABLE_FREESTORE_ROTATION option for baremetal
targets.
- Allocations pull from active store; free() quarantines blocks into
non-active store (1 - active).
- On allocation failure in active store, rotate() flips active index and
migrates/coalesces quarantined blocks into the new active store.
- Added 2-bit prev_free tracking in BlockRef metadata to distinguish
freestore indices.
- Added unit smoke tests and updated fuzzer for dual freestore rotation.
Assisted-by: Gemini and Claude based automation tool (human-in-the-loop)
---------
Co-authored-by: Yifan Zhu <yfzhu at google.com>
Co-authored-by: Claude Fable 5.1 <noreply at anthropic.com>
[lldb] Consistently use "null-terminated" across LLDB (NFC) (#224801)
It appears that both spellings are correct, but "null terminator" is far
more common, while "NUL terminator" is technically precise regarding the
ASCII character name. Most common in LLDB was "NULL terminated" which is
the worst of both worlds. This rallies around "null-terminated".
- Adjective -> null-terminated
- Verb -> null-terminate
- Nouns left unhyphenated but lowercased: null terminator, null
termination
[SLP]Fix crash in bool bitmask reduction match after tree vectorization
The known bits of the narrowed reduction leaves were computed after the
tree vectorization, which drops the operands of the vectorized scalars,
so the analysis dereferenced null operands. Match the bitmask form before
the vectorization and pass the result to the emission.
Fixes #225538
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/225568
[mlir][memref] Reject empty collapse_shape and expand_shape reassociation groups (#225348)
`memref.collapse_shape` and `memref.expand_shape` both accept an empty
reassociation group, which is not a valid reassociation: every group
must be a
non-empty, contiguous segment of dimensions.
* `memref.collapse_shape` with an empty group aborts the compiler for a
non-identity source layout. `CollapseShapeOp::verify` forwards the
reassociation to `computeCollapsedLayoutMap`, which calls
`ArrayRef::back()`
on each group and asserts on the empty one:
mlir-opt: llvm/include/llvm/ADT/ArrayRef.h:151:
const T& llvm::ArrayRef<T>::back() const [with T = long int]:
Assertion `!empty()' failed.
With an identity source layout the op is instead silently accepted.
[18 lines not shown]
[RegAlloc] [X86] Enable callee saved register optimization for x86 (#220090)
Enable callee saved register optimization implemented in
RAGreedy::tryAssignCSRFirstTime() for x86. It can replace save/restore
instructions in prologue/epilogue with register spill/reload in cold
blocks or register splits.
Spec cpu 2006 int result with fdo on skylake.
```
regalloc-csr-cost-scale 0 30
400.perlbench 42.0 42.7
401.bzip2 25.5 26.3
403.gcc 42.1 41.4
429.mcf 45.0 44.4
456.hmmer 38.2 38.2
458.sjeng 32.3 32.0
462.libquantum 68.0 68.9
471.omnetpp 26.9 27.3
[5 lines not shown]
[SelectionDAG] Add ISD::ARITH_FENCE to SelectionDAGDumper. (#225485)
We seem to have no consistency on CamelCase or snake_case in node
naming. I've gone with CamelCase to match the nearby nodes, but happy to
change.
[clang] Return early if a value dependent recovery init appeared in constant evaluation context in legacy constant evaluator (#225027)
A recovery default member initializer can be value-dependent even when
the expression referring to the variable is not. Clang should return
early to avoid crash.
This fix the issue found in
https://github.com/llvm/llvm-project/issues/185874#issuecomment-4058045596.
---------
Signed-off-by: yronglin <yronglin777 at gmail.com>
18447 header-tests ALL environment omits XPG3 and XPG4
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at oxidecomputer.com>
18392 Fill in header-tests sys_timeb.h config
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at oxidecomputer.com>
18389 Fill in header-tests strings.h config
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at oxidecomputer.com>
18445 header test missing SUSv5 in some environments
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at oxidecomputer.com>
[orc-rt] Simplify bit.h countl_zero and bit_width (#225547)
The old countl_zero algorithm wasn't recognized / optimized by clang on
arm64 or x86-64. Switch to a simpler loop that clang recognizes and
rewrite bit_width in terms of countl_zero. NFCI.
[Driver] Link ubsan_loop_detect with --whole-archive (#225498)
`addSanitizerRuntimes` places sanitizer archives before user object
files on the linker command line.
Because `ubsan_loop_detect` was in `NonWholeStaticRuntimes` without `-u`
symbols, single-pass linkers like GNU `ld.bfd` discarded
`libclang_rt.ubsan_loop_detect.a` before seeing references to
`__ubsan_install_trap_loop_detection` or `__ubsan_is_trap_loop`. Move
`ubsan_loop_detect` to `StaticRuntimes` so it is linked with
`--whole-archive`.
Point pool.dataset.update at zfs.resource.set
## Problem
`pool.dataset.update` carried its own copy of every ZFS policy check (ACL coupling, headroom, blocksize alignment, recordsize choices, dedup licensing, SMB/snapdev guards, LUN resyncs) and wrote through the raw `update_impl`, so the two write paths could drift and the pool path skipped whatever `zfs.resource.set` and its delegates enforce.
## Solution
Translate the pool payload into a `zfs.resource.set` request (lowercasing the index values the pool Literals uppercase, passing sizes and `copies` as ints, `quota: null` as 0, `INHERIT` and removed user properties as `inherit`) and let `zfs.resource.set` and its delegates validate and write. The update validation keeps only the field-shape rejections and the `user_properties_update` handling; everything else, the resyncs and the `ZFSException` mapping go.
When the shim itself already found errors, the request is run through `zfs.resource.set` as a `dry_run` so the caller still gets shim-side and zfs-side errors in one `ValidationErrors`. The request model is built inside the same `try`, so a value the zfs models reject comes back as a validation error rather than a raw pydantic one. Errors are re-keyed onto `pool_dataset_update.<field>`: the property's own field when the caller sent it, `acltype` for the derived `aclmode`/`aclinherit`, `volsize` for the re-reservation a volsize grow triggers, `user_properties_update`/`user_properties` for the caller's own user properties, and bare `pool_dataset_update` for anything structural.
Behaviour changes worth knowing: `copies` outside 1..3 and a negative `reservation` are now rejected; the recordsize and shrink messages come from the zfs rules; the ACL combination error lands on `acltype` rather than `aclmode`; a ZFS failure is keyed on `pool_dataset_update` instead of `pool.dataset.update`; the dRAID volblocksize check on update is gone, and `force_size` no longer bypasses the headroom check (its description says so). An empty payload still skips the write and emits CHANGED.
[CIR] Use cleanup active flag with logical operators (#225554)
When temporary expressions are created within a logical binary
operation, we need to use a "cleanup active" flag to guard any cleanups
that are created in the right-hand side of the expression because the
expression may short-circuit and not evaluate the RHS. Failure to do so
had been leading to destructors being called for objects that had never
been constructed.
This fix introduces a regression in destructor call ordering when both
sides of a logical operation create temporaries that require cleanup.
This is a known ordering bug that preceeded this PR but was incidentally
avoided by the previous incorrect handling. The orderig bug will be
fixed in a follow-up change.
Assisted-by: Cursor / various models
[CIR] Fix 'cir.not' lowering behavior for >64 bit size (#225541)
We were only inverting the lower 64 bits because we used the
int64_t/uint64_t overload, which only filled in 64 bits. This patch
replaces that with a 'getAllOnes' of the right size.
Resolve snapshot names to their dataset in the locked-path check
## Problem
`pool.dataset.path_in_locked_datasets` opened the resource named by the path and read its `crypto()`; a snapshot-backed iSCSI extent, NVMe-oF namespace or VM disk (`zvol/<dataset>@<snap>`) therefore reached it with an `@` name, pylibzfs returned a snapshot object with no `crypto`, and the AttributeError escaped, so `iscsi.extent.create` on such an extent inserted its row and then crashed in `get_instance`, and every later extent query failed on the orphan.
## Solution
A snapshot holds no keys, so its lock state is its dataset's: strip the snapshot suffix before the parent walk, which also lets the ancestor-prefix check see the dataset. Pinned with a unit test over the three accepted path forms.
[CIR] Lower nobuiltin attribute (#225545)
This causes a problem in tests for global allocation functions, but we
are not currently lowering the 'nobuiltin' attribute to LLVM-IR. This
patch adds the lowering.