mirror of https://github.com/commaai/tinygrad.git
Don't touch UOps.DEFINE_GLOBAL (#3575)
This commit is contained in:
parent
50e1445e60
commit
fb8acd1851
|
@ -88,12 +88,14 @@ class UOpGraph:
|
|||
return ret
|
||||
|
||||
def remove_childless(self):
|
||||
UOPS_W_SIDE_EFFECTS = {UOps.DEFINE_GLOBAL, UOps.STORE}
|
||||
|
||||
while 1:
|
||||
has_child: Set[UOp] = set()
|
||||
for ru in self.uops:
|
||||
for vu in ru.vin:
|
||||
has_child.add(vu)
|
||||
nu: List[UOp] = [x for x in self.uops if x in has_child or x.uop is UOps.STORE]
|
||||
nu: List[UOp] = [x for x in self.uops if x in has_child or x.uop in UOPS_W_SIDE_EFFECTS]
|
||||
if len(nu) == len(self.uops): break
|
||||
if DEBUG >= 4: print(f"reduced UOp count from {len(self.uops)} to {len(nu)}")
|
||||
self.uops = nu
|
||||
|
|
Loading…
Reference in New Issue