use the lastRead analysis; it's correct by construction, not a mess of special cases and seems to be just as fast as the old algorithm
This commit is contained in:
parent
112f7e650a
commit
2655f242a8
1 changed files with 2 additions and 2 deletions
|
|
@ -176,8 +176,8 @@ proc isLastRead(n: PNode; c: var Con): bool =
|
||||||
# we go through all paths beginning from 'instr+1' and need to
|
# we go through all paths beginning from 'instr+1' and need to
|
||||||
# ensure that we don't find another 'use X' instruction.
|
# ensure that we don't find another 'use X' instruction.
|
||||||
if instr+1 >= c.g.len: return true
|
if instr+1 >= c.g.len: return true
|
||||||
when false:
|
when true:
|
||||||
result = isLastRead(n.sym, c, 0, -1) >= 0
|
result = isLastRead(n.sym, c, instr+1, -1) >= 0
|
||||||
else:
|
else:
|
||||||
let s = n.sym
|
let s = n.sym
|
||||||
var pcs: seq[int] = @[instr+1]
|
var pcs: seq[int] = @[instr+1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue