removed caching logic; saves 400MB for an ORC booting compiler (#19989)

This commit is contained in:
Andreas Rumpf
2022-07-09 06:46:05 +02:00
committed by GitHub
parent ad0aee5354
commit 7a29a782f8

View File

@@ -80,12 +80,6 @@ import sets, hashes
proc hash(n: PNode): Hash = hash(cast[pointer](n))
proc aliasesCached(cache: var Table[(PNode, PNode), AliasKind], obj, field: PNode): AliasKind =
let key = (obj, field)
if not cache.hasKey(key):
cache[key] = aliases(obj, field)
cache[key]
type
State = ref object
lastReads: IntSet
@@ -116,9 +110,8 @@ proc mergeStates(a: var State, b: sink State) =
a.alreadySeen.incl b.alreadySeen
proc computeLastReadsAndFirstWrites(cfg: ControlFlowGraph) =
var cache = initTable[(PNode, PNode), AliasKind]()
template aliasesCached(obj, field: PNode): AliasKind =
aliasesCached(cache, obj, field)
aliases(obj, field)
var cfg = cfg
preprocessCfg(cfg)