ARCH15.md (963B)
1 # ARCH15: Optimize Check Module Accumulation and Lookups 2 3 ## Goal 4 5 Reduce allocation and overhead in the check pass by using strict folds, 6 O(1) accumulation for audit results, and avoiding unnecessary Map 7 conversions during inter-procedural checks. 8 9 ## Scope 10 11 - Replace per-line `acc <> result` accumulation with strict counters and 12 list accumulation. 13 - Avoid building `Map` from `IntMap` for per-block lookups. 14 - (Optional) Add a per-block memory-access flag to skip blocks with no 15 loads/stores. 16 17 ## Rationale 18 19 `AuditResult` uses list concatenation and aggregate updates that are 20 expensive when done per-line. Inter-proc check currently builds an extra 21 `Map` just to lookup by block index. 22 23 ## Changes 24 25 - Introduce strict accumulator in `checkBlock`/`checkBlockWithSummary`. 26 - Use `IM.findWithDefault` directly in inter-proc checks. 27 - If desired, add `bbHasMemAccess :: Bool` to `BasicBlock` (or compute on 28 the fly) to skip blocks with no memory accesses.