This is an archive of the discontinued LLVM Phabricator instance.

[StatepointLowering] Properly handle local and non-local relocates of the same value.
ClosedPublic

Authored by dantrushin on May 13 2022, 4:20 AM.

Details

Summary
 FunctionLoweringInfo::StatepointRelocationMaps map is used to pass GC pointer
 lowering information from statepoint to gc.relocate  which may appear in the
 different block.
 D124444 introduced different lowering for local and non-local relocates.
 Local relocates use statepoint SDValue and non-local relocates use value
exported to VReg.
 But I overlooked the fact that StatepointRelocationMap is indexed not by
 GCRelocate instruction, but by derived pointer. This works incorrectly when
 we have two relocates (one local and another non-local) of the same value,
 because they need different relocation records.
 
 This patch fixes the problem by recording relocation information per relocate
 instruction, not per derived pointer. This way, each gc.relocate can be lowered
 differently.

Diff Detail

Event Timeline

dantrushin created this revision.May 13 2022, 4:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 4:20 AM
dantrushin requested review of this revision.May 13 2022, 4:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 4:20 AM
skatkov accepted this revision.May 14 2022, 10:50 AM

Good catch.

This revision is now accepted and ready to land.May 14 2022, 10:50 AM
This revision was landed with ongoing or failed builds.May 16 2022, 3:05 AM
This revision was automatically updated to reflect the committed changes.