[PATCH] D100559: [GC][NFC] Make getGCStrategy by name available in IR

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 10:33:52 PDT 2021


reames added a comment.

In D100559#2767733 <https://reviews.llvm.org/D100559#2767733>, @mkazantsev wrote:

> Why are they singleton objects now? In current code, they are instatiated as many times as `getGCStrategy` is called, and it's called once for every function in module from `GCFunctionInfo &GCModuleInfo::getFunctionInfo(const Function &F)` (if I'm reading this correctly). Am I missing something here?

You are missing something.

GCModuleInfo::getGCStrategy maintains a map from name to GCStrategy object.  If you look up the same name repeatedly (e.g. for every function), you get the same GCStrategy object.  There is currently one object per GC name.


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

https://reviews.llvm.org/D100559



More information about the llvm-commits mailing list