[APFloat] Extend fltSemantics and drop special case E8M0 bit conversionJan/apfloat e8m0 (#204200)
This is one step towards being able to make APFloat extensible with
custom formats in the future.
fltSemantics gained a new flag to indicate lack of denormal support.
Combined with hasZero = 0 it means exponent 0 does not have a special
meaning. This makes it possible to remove the special case
implementation for initFromFloat8E8M0FNUAPInt and handle it in the
generic version.
The generic initFromIEEEAPInt function now also supports existing
fltSemantics flags for hasZero, and hasSignedRepr which where only
needed in the specialized initFromFloat8E8M0FNUAPInt.
Also adds new tests for bitcasting to and from APInt. There are several
tests involving bitcastToAPInt together with convert functions but none
explicitly verify the functionality of bitcastToAPInt.
[4 lines not shown]
[AArch64] Move aggressive-interleaving.ll test to LoopVectorizer tests. NFC (#204652)
It looks like this test was put into CodeGen where it would better live
with
other vectorizer tests in Transforms/LoopVectorize/AArch64.
[lldb][Mach-O] Fix two fuzzer-found hangs/crashes parsing universal Mach-O fat headers (#204471)
This fixes two denial-of-service issues in the universal (fat) Mach-O
container parser, both found by `lldb-target-fuzzer` and both reachable
from
`SBDebugger::CreateTarget` → `ObjectFile::GetModuleSpecifications` →
`ObjectContainerUniversalMachO::{GetModuleSpecifications,ParseHeader}`.
### 1. Bound the fat header arch loop by available data
`ParseHeader` read the untrusted 32-bit `nfat_arch` field and used it
directly
as the loop bound when indexing the `fat_arch` records, without
validating it
against the data actually present. A crafted header claiming
`nfat_arch = 0xFFFFFFFF` with only a few bytes of payload made the loop
spin
~4.29 billion times — `ValidOffsetForDataOfSize()` fails on every
iteration
[44 lines not shown]
[mlir][emitc] Apply type converter to memref element types in -convert-memref-to-emitc (#203742)
This change fixes a few places where the memref-to-emitc
conversion didn't properly convert memref element types.
This PR updates both memref.alloc and memref.copy to convert the memref
element type when using the element type for `sizeof` calls, as well as
generating the output pointer type (just for `alloc`).
This was missed because there are no `convert-to-emitc` tests that use a
type converter with custom types, so I added such a registration to the
test dialect. It is worth noting that, while this patch only affects
`-convert-memref-to-emitc`, the change has no impact without the
additional type converter registrations in `-convert-to-emitc` because
there are no builtin types that have nontrivial emit conversions today.
As a drive-by improvement, I deduped a "total size in bytes" calculation
that was happening in the lowerings for both `memref.alloc` and
`memref.copy`.
[RISCV][XCV] Fix incorrect llvm.ctlz lowering to cv.fl1 (#197288)
Fixes #197006.
The XCVbitmanip pattern `def : PatGpr<ctlz, CV_FL1, i32>;` is
semantically incorrect: `cv.fl1` returns a bit position while
`llvm.ctlz` returns a leading-zero count. They differ by up to 31 on
every non-zero input, miscompiling every use of `__builtin_clz`,
including compiler-rt's `__udivdi3`.
This PR:
- Replaces the pattern with one matching `llvm.ctlz` with
`is_zero_poison=true`, lowered to `xori (cv.fl1 rs1), 31`.
- Adds explicit `setOperationAction` calls in `RISCVISelLowering.cpp`
to route `ISD::CTLZ` to generic expansion and keep
`ISD::CTLZ_ZERO_*` matched by the `.td` pattern.
The companion `def : PatGpr<cttz, CV_FF1, i32>;` is correct as-is
(both return 32 on zero, coincide on non-zero), and is left
[3 lines not shown]
[scudo] Remove static error info functions. (#204483)
Android was the only platform using the static error info functions. The
latest Android no longer uses them, so delete these unused functions.
These functions were implicitly exporting implementation details and
made it difficult to implement the multi-region code. This is the final
step to submit the multi-region code and modify how the region code
works.
Remove the error info fuzzer since that was only necessary since so many
values were passed in to the function.
[flang][OpenMP] Emit warning that REVERSE_OFFLOAD is not supported
Right now we quietly ignore it, whereas the OpenMP spec mandates a
compilation error for requirements that the implmentation does not
support.
The REVERSE_OFFLOAD was not causing a compilation error to allow
testing of incremental implementation improvements, but we should
at least warn about not supporting it.
AMDGPU: Use module flags to control xnack and sramecc
This ensures these ABI details are encoded in the IR module
rather than depending on external state from command-line flags.
Previously, these were encoded as function-level subtarget features.
The code object output was a single target ID directive implied
by the global subtarget. The backend would previously check if a
function's subtarget feature mismatched the global subtarget. This
is avoided by making xnack and sramecc module-level properties from
the start. This also provides proper linker compatibility
enforcement, moving the error point earlier.
The old encoding was also an abuse of the subtarget feature system.
Subtarget features are a bitvector, and later features in the string
can override earlier ones. The old handling added a special case
where explicit settings were preserved: ordinarily +feature,-feature
should result in the feature being disabled, but +xnack,-xnack would
preserve the explicit "-xnack" state, which differs from the absence
of any xnack setting.
[25 lines not shown]
AMDGPU: Add subtarget feature for controllable xnack modes
This replaces the previously removed xnack-any-only feature,
with the inversion xnack-on-off-modes. All pre-gfx12.5 xnack
targets support the controllable mode. Ignore explicitly
set xnack settings the same way as is done for xnack requests
on other unsupported targets.
[AMDGPU] Keep i64 carry chains on VCC when feeding VALU users
This PR fixes an issue where ISel could mix scalar and vector carry chains when
lowering widened integer add/sub operations. A scalar-looking i64 carry producer
may feed a divergent carry consumer, so ISel now keeps that carry chain on VCC
to avoid invalid MIR.
iked: Avoid stack exhaustion by unbounded recursion
Problem found and patch supplied by mfriedl at genua.de. Similar
report from zhangph12138 at 163.com, thanks!
ok markus@
NAS-141273 / 26.0.0-RC.1 / Remove shared pydantic `Field()` from API type aliases (by themylogin) (by bugclerk) (#19155)
## Problem
Several API fields that are declared *required* are silently treated as
**optional with a bogus default** at runtime. For example, on the
current API
(v25_10_4):
VMRAWDevice.path = '127.0.0.1' # required path field, no default
declared
`VMRAWDevice.path` is `path: NonEmptyString = Field(pattern=...)` — it
should be
required, but it inherits `'127.0.0.1'` (leaked from
`VMDisplayDevice.bind`).
So `vm.device.create` for a RAW device with no `path` passes validation
and
silently uses `'127.0.0.1'` as the file path instead of being rejected.
[73 lines not shown]
[BOLT][AArch64] Only reserve constant-island space when an island exists (#204261)
`tentativeLayout()` aligns every function's tail to its constant island
alignment even when the function has no constant island. This over-padded
nearly every function, drifting tentative layout from emitted layout non
trivially, while the emitter only pads when emitting real constant island.
Guard with `estimateConstantIslandSize() > 0` so tentative better matches
emitted.
Merge tag 'ext4_for_linus-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 updates from Ted Ts'o:
- A major rework of the fast commit mechanism to avoid lock contention
and deadlocks. We also export snapshot statistics in
/proc/fs/ext4/*/fc_info
- Performance optimization for directory hash computation by processing
input in 4-byte chunks and removing function pointers, along with new
KUnit tests for directory hash
- Cleanups in JBD2 to remove special slabs and use kmalloc() instead
- Various bug fixes, including:
- Early validation of donor superblock in EXT4_IOC_MOVE_EXT to
avoid cross-fs deadlock
- Fix for a kernel BUG in ext4_write_inline_data_end under
data=journal
[30 lines not shown]