[PATCH] D142169: [RS4GC] Add a GCStrategy option to enable RS4GC
Denis Antrushin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 20 11:38:58 PST 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG267768c9dd26: [RS4GC] Add a GCStrategy option to enable RS4GC (authored by znix, committed by dantrushin).
Changed prior to commit:
https://reviews.llvm.org/D142169?vs=490692&id=490925#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142169/new/
https://reviews.llvm.org/D142169
Files:
llvm/include/llvm/IR/GCStrategy.h
llvm/lib/IR/BuiltinGCs.cpp
Index: llvm/lib/IR/BuiltinGCs.cpp
===================================================================
--- llvm/lib/IR/BuiltinGCs.cpp
+++ llvm/lib/IR/BuiltinGCs.cpp
@@ -66,6 +66,7 @@
public:
StatepointGC() {
UseStatepoints = true;
+ UseRS4GC = true;
// These options are all gc.root specific, we specify them so that the
// gc.root lowering code doesn't run.
NeededSafePoints = false;
@@ -98,6 +99,7 @@
public:
CoreCLRGC() {
UseStatepoints = true;
+ UseRS4GC = true;
// These options are all gc.root specific, we specify them so that the
// gc.root lowering code doesn't run.
NeededSafePoints = false;
Index: llvm/include/llvm/IR/GCStrategy.h
===================================================================
--- llvm/include/llvm/IR/GCStrategy.h
+++ llvm/include/llvm/IR/GCStrategy.h
@@ -68,8 +68,13 @@
protected:
bool UseStatepoints = false; /// Uses gc.statepoints as opposed to gc.roots,
- /// if set, none of the other options can be
- /// anything but their default values.
+ /// if set, NeededSafePoints and UsesMetadata
+ /// should be left at their default values.
+
+ bool UseRS4GC = false; /// If UseStatepoints is set, this determines whether
+ /// the RewriteStatepointsForGC pass should rewrite
+ /// this function's calls.
+ /// This should only be set if UseStatepoints is set.
bool NeededSafePoints = false; ///< if set, calls are inferred to be safepoints
bool UsesMetadata = false; ///< If set, backend must emit metadata tables.
@@ -96,6 +101,15 @@
virtual std::optional<bool> isGCManagedPointer(const Type *Ty) const {
return std::nullopt;
}
+
+ /// Returns true if the RewriteStatepointsForGC pass should run on functions
+ /// using this GC.
+ bool useRS4GC() const {
+ assert(useStatepoints() &&
+ "GC strategy has useRS4GC but not useStatepoints set");
+ return UseRS4GC;
+ }
+
///@}
/// If set, appropriate metadata tables must be emitted by the back-end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142169.490925.patch
Type: text/x-patch
Size: 2189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230120/ded6e450/attachment.bin>
More information about the llvm-commits
mailing list