[PATCH] D80957: [LiveDebugValues] Cache LexicalScopes::getMachineBasicBlocks, NFCI

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 15:11:25 PDT 2020


vsk created this revision.
vsk added reviewers: jmorse, Orlando, aprantl, nikic.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Introduce a subclass of LexicalScopes which caches the results from
getMachineBasicBlocks. This replaces the cache in UserValueScopes, to
reduce memory traffic when a VarLoc is copied (e.g. when a VarLocMap
grows), and to enable caching across basic blocks.

When compiling sqlite 3.5.7 (CTMark version), this patch reduces the
number of calls to getMachineBasicBlocks from 10,207 to 1,093. I also
measured a small compile-time reduction (~ 0.1% of total wall time, on
average, on my machine).

As a drive-by, I made the DebugLoc in UserValueScopes a const reference
to cut down on MetadataTracking traffic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80957

Files:
  llvm/include/llvm/CodeGen/LexicalScopes.h
  llvm/lib/CodeGen/LexicalScopes.cpp
  llvm/lib/CodeGen/LiveDebugValues.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80957.267740.patch
Type: text/x-patch
Size: 8070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200601/5834e2a1/attachment.bin>


More information about the llvm-commits mailing list