Skip to content

Commit db8ae2f

Browse files
committed
[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
1 parent 87de451 commit db8ae2f

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

llvm/docs/Statepoints.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -795,18 +795,6 @@ also has relocations. See `this llvm-dev discussion
795795
<https://groups.google.com/forum/#!topic/llvm-dev/AE417XjgxvI>`_ for more
796796
detail.
797797

798-
Support for alternate stackmap formats
799-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
800-
801-
For some use cases, it is
802-
desirable to directly encode a final memory efficient stackmap format for
803-
use by the runtime. This is particularly relevant for ahead of time
804-
compilers which wish to directly link object files without the need for
805-
post processing of each individual object file. While not implemented
806-
today for statepoints, there is precedent for a GCStrategy to be able to
807-
select a customer GCMetataPrinter for this purpose. Patches to enable
808-
this functionality upstream are welcome.
809-
810798
Bugs and Enhancements
811799
=====================
812800

llvm/include/llvm/IR/GCStrategy.h

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
// When used with gc.statepoint, information about safepoint and roots can be
3939
// found in the binary StackMap section after code generation. Safepoint
4040
// placement is currently the responsibility of the frontend, though late
41-
// insertion support is planned. gc.statepoint does not currently support
42-
// custom stack map formats; such can be generated by parsing the standard
43-
// stack map section if desired.
41+
// insertion support is planned.
4442
//
4543
// The read and write barrier support can be used with either implementation.
4644
//
@@ -101,6 +99,11 @@ class GCStrategy {
10199
}
102100
///@}
103101

102+
/// If set, appropriate metadata tables must be emitted by the back-end
103+
/// (assembler, JIT, or otherwise). The default stackmap information can be
104+
/// found in the StackMap section as described in the documentation.
105+
bool usesMetadata() const { return UsesMetadata; }
106+
104107
/** @name GCRoot Specific Properties
105108
* These properties and overrides only apply to collector strategies using
106109
* GCRoot.
@@ -110,12 +113,6 @@ class GCStrategy {
110113
/// True if safe points need to be inferred on call sites
111114
bool needsSafePoints() const { return NeededSafePoints; }
112115

113-
/// If set, appropriate metadata tables must be emitted by the back-end
114-
/// (assembler, JIT, or otherwise). For statepoint, this method is
115-
/// currently unsupported. The stackmap information can be found in the
116-
/// StackMap section as described in the documentation.
117-
bool usesMetadata() const { return UsesMetadata; }
118-
119116
///@}
120117
};
121118

@@ -126,7 +123,7 @@ class GCStrategy {
126123
/// static GCRegistry::Add<CustomGC> X("custom-name",
127124
/// "my custom supper fancy gc strategy");
128125
///
129-
/// Note that to use a custom GCMetadataPrinter w/gc.roots, you must also
126+
/// Note that to use a custom GCMetadataPrinter, you must also
130127
/// register your GCMetadataPrinter subclass with the
131128
/// GCMetadataPrinterRegistery as well.
132129
using GCRegistry = Registry<GCStrategy>;

0 commit comments

Comments
 (0)