mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
parent
097264853d
commit
290441dd44
1 changed files with 4 additions and 1 deletions
|
|
@ -22,9 +22,12 @@ def linearize(u:UOp) -> list[UOp]:
|
|||
|
||||
# simple priority override
|
||||
match u.op:
|
||||
# the order and placement of these is important
|
||||
case Ops.DEFINE_GLOBAL | Ops.DEFINE_LOCAL | Ops.DEFINE_REG | Ops.DEFINE_VAR: priority = -20
|
||||
# early consts
|
||||
case Ops.CONST: priority = -10
|
||||
# place loads early
|
||||
#case Ops.LOAD: priority = -1
|
||||
case Ops.LOAD: priority = -1
|
||||
# control flow resets priority
|
||||
case Ops.RANGE|Ops.END|Ops.IF|Ops.ENDIF: priority = 0
|
||||
# prevent priority inversion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue