[PATCH] D80957: [LiveDebugValues] Cache LexicalScopes::getMachineBasicBlocks, NFCI
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 4 01:02:29 PDT 2020
Orlando marked an inline comment as done.
Orlando added inline comments.
================
Comment at: llvm/lib/CodeGen/LexicalScopes.cpp:328
+ return Set->count(MBB) != 0;
}
----------------
vsk wrote:
> 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.
That makes sense, thanks!
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