[llvm] db8ae2f - [llvm][doc] Update comments and documentation of custom stackmap formats in GC

Markus Böck via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 15 03:17:25 PST 2022


Author: Markus Böck
Date: 2022-02-15T12:17:19+01:00
New Revision: db8ae2fef1592126a8ce52d97e1d6df069ff1e58

URL: https://github.com/llvm/llvm-project/commit/db8ae2fef1592126a8ce52d97e1d6df069ff1e58
DIFF: https://github.com/llvm/llvm-project/commit/db8ae2fef1592126a8ce52d97e1d6df069ff1e58.diff

LOG: [llvm][doc] Update comments and documentation of custom stackmap formats in GC

Since https://reviews.llvm.org/D53892 it is possible to emit a custom stackmap by overwriting the emitStackMaps method of GCMetadataPrinter. That way even AOT compilers can generate a more efficient and more suitable format for their needs.

This patch updates documentation and stale comments in source code. In particular it removes the issue from the issue list in the Statepoints documentation and adjusts comments in GCStrategy.

Differential Revision: https://reviews.llvm.org/D119660

Added: 
    

Modified: 
    llvm/docs/Statepoints.rst
    llvm/include/llvm/IR/GCStrategy.h

Removed: 
    


################################################################################
diff  --git a/llvm/docs/Statepoints.rst b/llvm/docs/Statepoints.rst
index 4c017317eba58..15b4406761ef6 100644
--- a/llvm/docs/Statepoints.rst
+++ b/llvm/docs/Statepoints.rst
@@ -795,18 +795,6 @@ also has relocations.  See `this llvm-dev discussion
 <https://groups.google.com/forum/#!topic/llvm-dev/AE417XjgxvI>`_ for more
 detail.
 
-Support for alternate stackmap formats
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-For some use cases, it is
-desirable to directly encode a final memory efficient stackmap format for
-use by the runtime.  This is particularly relevant for ahead of time
-compilers which wish to directly link object files without the need for
-post processing of each individual object file.  While not implemented
-today for statepoints, there is precedent for a GCStrategy to be able to
-select a customer GCMetataPrinter for this purpose.  Patches to enable
-this functionality upstream are welcome.
-
 Bugs and Enhancements
 =====================
 

diff  --git a/llvm/include/llvm/IR/GCStrategy.h b/llvm/include/llvm/IR/GCStrategy.h
index 4fa8e3a8dcf4f..41024469044ff 100644
--- a/llvm/include/llvm/IR/GCStrategy.h
+++ b/llvm/include/llvm/IR/GCStrategy.h
@@ -38,9 +38,7 @@
 // When used with gc.statepoint, information about safepoint and roots can be
 // found in the binary StackMap section after code generation.  Safepoint
 // placement is currently the responsibility of the frontend, though late
-// insertion support is planned.  gc.statepoint does not currently support
-// custom stack map formats; such can be generated by parsing the standard
-// stack map section if desired.
+// insertion support is planned.
 //
 // The read and write barrier support can be used with either implementation.
 //
@@ -101,6 +99,11 @@ class GCStrategy {
   }
   ///@}
 
+  /// If set, appropriate metadata tables must be emitted by the back-end
+  /// (assembler, JIT, or otherwise). The default stackmap information can be
+  /// found in the StackMap section as described in the documentation.
+  bool usesMetadata() const { return UsesMetadata; }
+
   /** @name GCRoot Specific Properties
    * These properties and overrides only apply to collector strategies using
    * GCRoot.
@@ -110,12 +113,6 @@ class GCStrategy {
   /// True if safe points need to be inferred on call sites
   bool needsSafePoints() const { return NeededSafePoints; }
 
-  /// If set, appropriate metadata tables must be emitted by the back-end
-  /// (assembler, JIT, or otherwise). For statepoint, this method is
-  /// currently unsupported.  The stackmap information can be found in the
-  /// StackMap section as described in the documentation.
-  bool usesMetadata() const { return UsesMetadata; }
-
   ///@}
 };
 
@@ -126,7 +123,7 @@ class GCStrategy {
 /// static GCRegistry::Add<CustomGC> X("custom-name",
 ///        "my custom supper fancy gc strategy");
 ///
-/// Note that to use a custom GCMetadataPrinter w/gc.roots, you must also
+/// Note that to use a custom GCMetadataPrinter, you must also
 /// register your GCMetadataPrinter subclass with the
 /// GCMetadataPrinterRegistery as well.
 using GCRegistry = Registry<GCStrategy>;


        


More information about the llvm-commits mailing list