[X86] Emit ADD instead of SHL by 1 when shrinking TEST with a mask (#217508)
The immediate-TEST shrink rewrites (and x, 0x7fffffffffffffff) == 0 into
SHL64ri $1 + TEST64rr, expecting the redundant TEST to be "subsequently
eliminated" (per the comment). For shift amounts 1-3 it never is:
isDefConvertible() rejects those SHLs so that they stay convertible to
LEA, and the dead TEST survives into final binaries.
Emit ADD64rr x, x instead when the shift amount is 1. Doubling is value-
and ZF-identical to the shift at the same encoding length, executes on
more ports, and ADDrr is def-convertible, so the peephole really does
fold the TEST away, leaving add+jcc/setcc instead of shl+test+jcc/setcc.
The shape is common: it is Rust libstd's panic-counter fast path
(GLOBAL_PANIC_COUNT & ~(1 << 63) == 0, inlined at every
std::thread::panicking() check -- 249 copies in uutils coreutils) and
LLVM's own is_fpclass zero-class lowering, as the is_fpclass.ll diff
shows.
[7 lines not shown]
[mlir][SparseTensor] Use split discardable/inherent attribute APIs (#218904)
Migrate SparseTensor IR, lowering, code generation, and loop emission to
explicit discardable or operation-specific attribute access.
Assisted-by: Codex
[mlir][Func][Async][EmitC] Use split discardable/inherent attribute APIs (#218905)
Use operation-specific accessors and explicit discardable attribute APIs
in the Func, Async, and EmitC dialects and their associated conversions.
Assisted-by: Codex
[AMDGPU] Fix unsaturated add when moving 64-bit ctlz/cttz to the VALU (#216707)
The ffbh/ffbl add is saturated via a clamp modifier, but on gfx6/7/8 it
lowers to V_ADD_CO_U32_e32, which has no clamp operand, so
ctlz/cttz.i64(0, false) returns 31 instead of 64 there
ffbh/ffbl only produce 0..31 or -1, so uaddsat(x, 32) is just x | 32
Use V_OR_B32_e32 instead, which needs no clamp and works everywhere
[MLIR][Shape] Enable strict property assembly format (#218903)
Enable the strict properties assembly format mode for the Shape dialect.
Bind the broadcast diagnostic attribute directly. Keep its optional
clause unambiguous after variadic operands, and cover the custom and
rejected attr-dict spellings.
Assisted-by: Codex
mvc: advanced marker for form/dialog fields (#10795)
Add a marker for advanced options behind their respective field
name in order to better spot what was toggled. In OpenVPN
the dialog extends beyond the screen size so having a visual
clue helps navigate the additional settings.
py-datamodel-code-generator: Import py-datamodel_code_generator-0.75.1 as wip/py-datamodel-code-generator
Generate Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct
from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw
JSON/YAML/CSV.
[mlir][LLVM] Verify that constant attribute and result types match
`llvm.mlir.constant` only checked that the kind of the value attribute suits
the kind of the result type, never that the types themselves agree. All of the
following verified:
%0 = llvm.mlir.constant(1 : index) : i64
%1 = llvm.mlir.constant(1 : i8) : i16
%2 = llvm.mlir.constant(dense<1> : vector<4xi32>) : vector<4xi64>
Translation ignores the attribute type and uses the result type, so the
attribute type was effectively decorative for integers, and passes that read it
back could observe a type that has nothing to do with the value.
Require exact type equality for integer attributes and exact element type
equality for integer elements attributes, mirroring the `AllTypesMatch`
constraint `arith.constant` gets from ODS. The op cannot use that trait itself
because `value` is an `AnyAttr` that also holds `StringAttr` and `ArrayAttr`.
The element type check is also run on the scalable vector path, which
[11 lines not shown]
py-genson: Import py-genson-1.4.0 as wip/py-genson
GenSON is a powerful, user-friendly JSON Schema generator built in
Python.
GenSON's core function is to take JSON objects and generate schemas
that describe them, but it is unique in its ability to merge schemas.
It was originally built to describe the common structure of a large
number of JSON objects, and it uses its merging ability to generate a
single schema from any number of JSON objects and/or schemas.