drop unused invalid conditions (#12635)

* drop where conditions if the ranges are not used inside the index

* remove allow_any_len
This commit is contained in:
Sieds Lykles
2025-10-13 10:52:21 +02:00
committed by GitHub
parent 9ab06dffad
commit e537e895b1
4 changed files with 17 additions and 8 deletions

View File

@@ -70,7 +70,8 @@ class TestLinearizer(unittest.TestCase):
ranges = [i for i,u in enumerate(uops) if u.op is Ops.RANGE]
# RANGE -> ALU -> RANGE -> ALU + LOAD -> STORE
assert any(x.op in GroupOp.ALU for x in uops[ranges[0]:ranges[1]])
assert not any(x.op is Ops.LOAD for x in uops[ranges[0]:ranges[1]])
# the index of the load doesnt depend on the second range
assert any(x.op is Ops.LOAD for x in uops[ranges[0]:ranges[1]])
assert any(x.op in {*GroupOp.ALU, Ops.LOAD} for x in uops[ranges[1]:])
def test_range_outer_op_before_phi(self):