Skip to content

Commit f5da275

Browse files
authored
simpler remove_movement_ops [pr] (tinygrad#8818)
1 parent c8d878a commit f5da275

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tinygrad/engine/schedule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def append_uop(ctx:ScheduleContext, view:UOp, buf_uop:UOp) -> None:
481481

482482
remove_movement_ops = merge_views+PatternMatcher([
483483
# NOTE: movement ops are always applied to base
484-
(UPat(GroupOp.Movement, name="mov", src=(UPat.any(UPat.var("x").view(), UPat.var("x")))), lambda x,mov: x.view(unwrap(mov.st))),
484+
(UPat(GroupOp.Movement, name="mov", src=(UPat.var("x"),)), lambda x,mov: x.view(unwrap(mov.st))),
485485
# some masked views can collapse to 0, VIEW(x) -> CONST(VIEW)
486486
(UPat(Ops.VIEW, name="view"),
487487
lambda view: view.const_like(0) if (vm:=view.st.views[-1].mask) is not None and any((x[1]-x[0]) == 0 for x in vm) else None),

0 commit comments

Comments
 (0)