[PATCH] D125000: [RS4GC] Cache IsKnownBase for bases and BDVs (NFC)

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 04:55:13 PDT 2022


mkazantsev requested changes to this revision.
mkazantsev added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:462
   if (auto *GEP = dyn_cast<GetElementPtrInst>(I))
-    return findBaseDefiningValue(GEP->getPointerOperand());
+    return findBaseDefiningValue(GEP->getPointerOperand(), KnownBases);
 
----------------
Should it be `findBaseDefiningValueCached`? Otherwise you don't benefit from caching in recursion.


================
Comment at: llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:514
     // See constant.ll file for relevant test cases.
-
-    return BaseDefiningValueResult(
-        ConstantPointerNull::get(cast<PointerType>(I->getType())), true);
+    
+    auto *CPN = ConstantPointerNull::get(cast<PointerType>(I->getType()));
----------------
nit: tab


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

https://reviews.llvm.org/D125000



More information about the llvm-commits mailing list