[PATCH] D77130: [DAG] Change isGCValue detection for statepoint lowering

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 22:50:52 PDT 2020


skatkov updated this revision to Diff 254429.
skatkov edited the summary of this revision.
skatkov added a comment.

Philip, thank you for your suggestion.


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

https://reviews.llvm.org/D77130

Files:
  llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp


Index: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -482,8 +482,14 @@
   const bool LiveInDeopt =
     SI.StatepointFlags & (uint64_t)StatepointFlags::DeoptLiveIn;
 
-  auto isGCValue =[&](const Value *V) {
-    return is_contained(SI.Ptrs, V) || is_contained(SI.Bases, V);
+  auto isGCValue = [&](const Value *V) {
+    auto *Ty = V->getType();
+    if (!Ty->isPtrOrPtrVectorTy())
+      return false;
+    if (auto *GFI = Builder.GFI)
+      if (auto IsManaged = GFI->getStrategy().isGCManagedPointer(Ty))
+        return *IsManaged;
+    return true; // conservative
   };
 
   // Before we actually start lowering (and allocating spill slots for values),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77130.254429.patch
Type: text/x-patch
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200402/cc800e23/attachment.bin>


More information about the llvm-commits mailing list