Incomplete/buggy rule breaks process replay on #4976 (#4978)

* Incomplete/buggy rule breaks process replay on #4976

* test passes

---------

Co-authored-by: qazal <[email protected]>
This commit is contained in:
uuuvn
2024-06-15 15:18:35 +03:00
committed by GitHub
co-authored by qazal
parent d91f0ee85b
commit 033fb53f9e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ class TestNonFloatUOps(TestUOps):
value = -y+x
uops = UOpGraph([UOp(UOps.STORE, None, (data0, idx, value))])
with self.assertRaises(AssertionError): assert uops[-1].vin[2].arg is BinaryOps.SUB
assert uops[-1].vin[2].arg is BinaryOps.SUB
class TestBoolUOps(TestUOps):
def _test_uop_bool_fxn(self, op, fxn):
+1 -1
View File
@@ -181,7 +181,7 @@ constant_folder = PatternMatcher([
# -(-x) -> x
(UPat(UOps.ALU, UnaryOps.NEG, (UPat(UOps.ALU, UnaryOps.NEG, (UPat(name="x"),)))), lambda x: x),
# x+-y -> x-y
(UPat(UOps.ALU, BinaryOps.ADD, (UPat(name="x"), UPat(UOps.ALU, UnaryOps.NEG, name="my"))), lambda x, my: x-my.vin[0]),
(UPat(UOps.ALU, BinaryOps.ADD, [UPat(name="x"), UPat(UOps.ALU, UnaryOps.NEG, name="my")]), lambda x, my: x-my.vin[0]),
# -1*x -> -x
(UPat(UOps.ALU, BinaryOps.MUL, [UPat(name="x"), UPat(UOps.CONST, -1)]), lambda x: -x),
# bool < False is always false, True < bool is always false