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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 09:53:26 PDT 2020


vsk marked an inline comment as done.
vsk added inline comments.


================
Comment at: llvm/lib/CodeGen/LexicalScopes.cpp:328
+  return Set->count(MBB) != 0;
 }
 
----------------
Orlando wrote:
> I'm not familiar with the extent of the usage of `LexicalScopes` throughout llvm, so I wonder if there's ever a case where we don't want the caching behaviour. i.e. is it conceivable that the result of `dominates` should change for the same inputs between calls?
> 
> Given this unfamiliarity I probably shouldn't be the one to give the final LGTM on this.
LexicalScopes is used by LiveDebugValues and the debug info generators (it's referenced by DebugHandlerBase). A LexicalScopes instance can't be used to describe a changing MachineFunction, so the result of `dominates` can't change for the same inputs between calls. Also, the `dominates` method is currently only used by LiveDebugValues, where the caching seems to be useful.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80957/new/

https://reviews.llvm.org/D80957





More information about the llvm-commits mailing list