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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 09:52:44 PDT 2020


vsk added a comment.

In D80957#2068276 <https://reviews.llvm.org/D80957#2068276>, @Orlando wrote:

> This makes sense to me.
>
> If you're going to subclass and are paying for the callback indirection in LexicalScopes now anyway, would it not make sense to make `getMachineBasicBlocks` virtual instead of using a callback? Seems like it could be simpler that way but I don't know if one way is better than the other, I'm just curious.


I think that could work, but I'm not sure it'd be cleaner, since there'd still be a need for some override of dominates() to pass a cached set into getMachineBasicBlocks.

Maybe a simpler approach would be to sink the cache into the LexicalScopes instance? I'll take a stab at this.


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