ARC Analysis in one pass (#16849)

* Analyse last reads all at once

* Integrate firstWrite analysis

* Small cleanup

* Use sets instead of seqs

* Remove instrTargets

* Reap the benefits

* Implement error diagnostics

* Operate on DFA index for lastRead analysis

* Use mgetOrPut
This commit is contained in:
Clyybber 2021-02-09 14:20:58 +01:00 • committed by GitHub
commit ab740cb5b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 139 additions and 128 deletions

View file

@ -298,11 +298,11 @@ proc genArgNoParam(p: BProc, n: PNode, needsTmp = false): Rope =
initLocExprSingleUse(p, n, a)
result = rdLoc(withTmpIfNeeded(p, a, needsTmp))
from dfa import instrTargets, InstrTargetKind
from dfa import aliases, AliasKind
proc potentialAlias(n: PNode, potentialWrites: seq[PNode]): bool =
for p in potentialWrites:
if instrTargets(p, n) != None:
if p.aliases(n) != no or n.aliases(p) != no:
return true
proc skipTrivialIndirections(n: PNode): PNode =