don't recreate st uop [pr] (#7092)

This commit is contained in:
qazal 2024-10-16 08:43:19 +03:00 committed by GitHub
parent 9c9c241e58
commit aadc95c2b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ def simplify_and_unbind(ctx, x:UOp) -> Optional[UOp]:
st, var_vals = st.simplify().unbind()
ctx[0].update(var_vals)
ctx[2].add(st)
return st.to_uop()
return st.to_uop() if st != x.st else None
append_vars = PatternMatcher([(UPat(UOps.VIEW, name="x"), simplify_and_unbind)])
enumerate_bufs = PatternMatcher([(UPat(UOps.BUFFER, name="x"), lambda ctx,x: UOp(UOps.DEFINE_GLOBAL, x.dtype, (), ctx[1].index(x.arg[0])))])