[PATCH] D94469: [Statepoint Lowering] Add an option to allow use gc values in regs for landing pad

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 20:48:57 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG157efd84abf8: [Statepoint Lowering] Add an option to allow use gc values in regs for landing… (authored by skatkov).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94469

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
@@ -64,6 +64,10 @@
     "use-registers-for-deopt-values", cl::Hidden, cl::init(false),
     cl::desc("Allow using registers for non pointer deopt args"));
 
+cl::opt<bool> UseRegistersForGCPointersInLandingPad(
+    "use-registers-for-gc-values-in-landing-pad", cl::Hidden, cl::init(false),
+    cl::desc("Allow using registers for gc pointer in landing pad"));
+
 cl::opt<unsigned> MaxRegistersForGCPointers(
     "max-registers-for-gc-values", cl::Hidden, cl::init(0),
     cl::desc("Max number of VRegs allowed to pass GC pointer meta args in"));
@@ -549,14 +553,15 @@
   // Pointers used on exceptional path of invoke statepoint.
   // We cannot assing them to VRegs.
   SmallSet<SDValue, 8> LPadPointers;
-  if (auto *StInvoke = dyn_cast_or_null<InvokeInst>(SI.StatepointInstr)) {
-    LandingPadInst *LPI = StInvoke->getLandingPadInst();
-    for (auto *Relocate : SI.GCRelocates)
-      if (Relocate->getOperand(0) == LPI) {
-        LPadPointers.insert(Builder.getValue(Relocate->getBasePtr()));
-        LPadPointers.insert(Builder.getValue(Relocate->getDerivedPtr()));
-      }
-  }
+  if (!UseRegistersForGCPointersInLandingPad)
+    if (auto *StInvoke = dyn_cast_or_null<InvokeInst>(SI.StatepointInstr)) {
+      LandingPadInst *LPI = StInvoke->getLandingPadInst();
+      for (auto *Relocate : SI.GCRelocates)
+        if (Relocate->getOperand(0) == LPI) {
+          LPadPointers.insert(Builder.getValue(Relocate->getBasePtr()));
+          LPadPointers.insert(Builder.getValue(Relocate->getDerivedPtr()));
+        }
+    }
 
   LLVM_DEBUG(dbgs() << "Deciding how to lower GC Pointers:\n");
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94469.316315.patch
Type: text/x-patch
Size: 1850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210113/8df19f6a/attachment.bin>


More information about the llvm-commits mailing list