improve call/param rendering (#15023)

This commit is contained in:
George Hotz
2026-02-27 08:35:04 +08:00
committed by GitHub
parent 0f94a4bb73
commit 2bbf8bbefa
2 changed files with 3 additions and 0 deletions

View File

@@ -1422,6 +1422,7 @@ def bitcast(x, in_dtype:DType, out_dtype:DType):
renderer = PatternMatcher([
(UPat((Ops.DEFINE_VAR,), name="x"), lambda x: x.expr),
(UPat(Ops.PARAM, src=(UPat(), UPat(), UPat(), UPat(), UPat(Ops.NOOP, name="x"))), lambda x: x.arg),
(UPat((Ops.SPECIAL), name="x"), lambda x: x.arg),
(UPat(Ops.RANGE, name="x"), lambda x: f"r{range_str(x)}"),
(UPat((Ops.CONST, Ops.VCONST), name="x"), lambda x: str(x.arg)),

View File

@@ -128,6 +128,8 @@ def uop_to_json(x:UOp) -> dict[int, dict]:
label += f"\n({multirange_str(rngs, color=True)})"
if u._shape is not None:
label += f"\n{shape_to_str(u.shape)}"
if u.op is Ops.CALL:
label += f"\n{u.src[0].key.hex()[:8]}"
if u.op in {Ops.INDEX, Ops.BUFFERIZE}:
if len(u.toposort()) < 30: label += f"\n{u.render()}"
ranges: list[UOp] = []