This is an archive of the discontinued LLVM Phabricator instance.

[Statepoint Lowering] Fix the crash with gc.relocate lowering when it is in a separate block
ClosedPublic

Authored by skatkov on Mar 10 2021, 12:20 AM.

Details

Summary

If it was decided to relocate derived pointer using the spill its value is
not exported in general case.
When gc.relocate is located in an another block than a statepoint we cannot
get SD for derived value but for spill case it is not required at all.
However implementation of gc.relocate lowering unconditionally request SD value
causing the assert triggering.

The CL fixes this by handling spill case earlier than SD is really required.

Diff Detail

Event Timeline

skatkov created this revision.Mar 10 2021, 12:20 AM
skatkov requested review of this revision.Mar 10 2021, 12:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2021, 12:20 AM
dantrushin accepted this revision.Mar 10 2021, 1:55 AM

LGTM

llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
1257

Could you check that SD.isUndef case will have NoRelocate record type too? If so, assert can be moved a bit higher.

This revision is now accepted and ready to land.Mar 10 2021, 1:55 AM
This revision was landed with ongoing or failed builds.Mar 10 2021, 4:51 AM
This revision was automatically updated to reflect the committed changes.