[PATCH] D141110: [RS4GC] Remove the hardcoded GC strategy names (v2)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 07:43:59 PST 2023


reames added a comment.

Please don't couple all uses of statepoints to RS4GC.  Adding another function to GCStrategy should be straight forward, please do it.



================
Comment at: llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:3049
+/// function doesn't have a GC tag. The strategy is stored in the cache.
+static GCStrategy *findGCStrategy(Function &F, GCStrategyCache &cache) {
+  if (!F.hasGC())
----------------
I'm confused by your implementation here.  getGCStrategy uses the register of GCStrategy objects internally.  If calling that works, why do you need another caching layer here at all?

As a bit of history, the GC registery was initially in CodeGen and not available in the rest of LLVM due to some weird linkage problems.  I think - though I don't quite remember details, so check - that got fixed years ago.  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141110



More information about the llvm-commits mailing list