IMPL8.md (1291B)
1 # IMPL8: Cache Callers and Function Blocks 2 3 ## Summary 4 5 Precompute call graph and function block ranges/indices to avoid 6 rebuilding them during inter-procedural fixpoint iterations. 7 8 ## Steps 9 10 1) Cache function block ranges 11 - Add a helper in `Audit.AArch64.CFG` to compute 12 `funcBlocks :: Map Text [Int]` or `(start,end)` in a single pass. 13 - Use `isFunctionLabel` to detect boundaries. 14 15 2) Cache call graph and callers 16 - Build `callGraph` once per analysis run. 17 - Invert it to `callerMap` (callee -> [caller]). 18 19 3) Thread caches into inter-proc analysis 20 - Modify `runInterProc` and `runInterProcWithConfig` to accept caches or 21 compute them once and close over them. 22 - Replace `findCallers` with `callerMap` lookup. 23 - Replace repeated `functionBlocks cfg func` with cached lookup. 24 25 4) Optional micro-optimizations 26 - When `funcBlocks` is contiguous, avoid `IntSet` membership checks in 27 `runFunctionBlocks` by using bounds checks. 28 29 5) Tests/Validation 30 - Add a small unit test for cache correctness if feasible. 31 - Benchmark large assembly before/after if available. 32 33 ## Files to Touch 34 35 - `lib/Audit/AArch64/CFG.hs` 36 - `lib/Audit/AArch64/Taint.hs` 37 - `test/` (optional) 38 39 ## Validation 40 41 - `cabal test` 42 - Run auditor on large input with `--interproc` to confirm progress and 43 improved runtime.