remove old reduce collapse rule (#12889)

* comment this out

* remove
This commit is contained in:
Sieds Lykles
2025-10-23 13:51:49 +02:00
committed by GitHub
parent cdfb8e31ae
commit 04b3e51f1b

View File

@@ -109,9 +109,6 @@ pm_reduce_collapse = pm_reduce_unparented + PatternMatcher([
# reduce on gated load becomes can substitute the range and remove the reduce
((UPat.var("idx")!=(UPat(Ops.RANGE, name="r").or_casted())).where(0, UPat.var("expr")).reduce(UPat.var("r"), arg=Ops.ADD),
lambda r,idx,expr: (v:=(idx.cast(r.dtype) >= 0) & (idx.cast(r.dtype) < r.src[0])).where(expr.substitute({r:idx.cast(r.dtype).valid(v)}),0)),
# AND on WHERE
((UPat(Ops.DEFINE_VAR, name="x") & UPat.var("y")).where(UPat.cvar("c"), 0).reduce(arg=Ops.ADD, allow_any_len=True, name="r"),
lambda x,y,c,r: y.where(c, 0).reduce(*r.src[1:], arg=Ops.ADD)*x.cast(c.dtype)),
])+symbolic_flat
def reduce_collapse(red:UOp):