This is an archive of the discontinued LLVM Phabricator instance.

[DOC] Remove too strong restriction for ‘llvm.experimental.gc.statepoint’ Intrinsic
ClosedPublic

Authored by skatkov on Mar 31 2020, 1:53 AM.

Details

Summary

The requirement for deopt parameter to be in gc parameter if it can
be modified by GC is very strong and difficult to follow.

The key example of why this can't work:
%p1 = bitcast i8* %p to i8*
statepoint [gc = (%p1)], [deopt = (%p1)]

The optimizer is allowed to replace either use (or both) of %p1 with %p. If it updates only one of the two (entirely legal), the two sets do not overlap.

So this change removes the strong wording and just mention that some implementation specific GC value can be modified.

Diff Detail

Event Timeline

skatkov created this revision.Mar 31 2020, 1:53 AM
reames accepted this revision.Apr 1 2020, 7:14 PM

LGTM w/required change.

llvm/docs/Statepoints.rst
525

Just drop this sentence:
"The runtime may read any of these ​values, but is assumed not to modify them until the garbage collector might need to modify one of these values. "

It's tempting to try to describe the interaction around stack slots shared between deopt and GC values here, but I couldn't find wording which wasn't simply confusing in a different way. For the moment, let's just leave that aspect undocumented.

This revision is now accepted and ready to land.Apr 1 2020, 7:14 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2020, 9:14 PM