mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
removed caching logic; saves 400MB for an ORC booting compiler (#19989)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user