[Statepoint Lowering] Fix the crash with gc.relocate in a separate block
authorSerguei Katkov <serguei.katkov@azul.com>
Wed, 10 Mar 2021 07:14:03 +0000 (14:14 +0700)
committerSerguei Katkov <serguei.katkov@azul.com>
Wed, 10 Mar 2021 12:51:04 +0000 (19:51 +0700)
commit2fccd1b00a7667228a0b5f167b2936b69b717372
treea1ee5093fff1454f309c57704d5b68622657dc54
parent7d0cafba962c56d79b2f1c2caab695551d3be6df
[Statepoint Lowering] Fix the crash with gc.relocate in a separate block

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.

Reviewers: reames, dantrushin
Reviewed By: dantrushin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D98324
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
llvm/test/CodeGen/X86/statepoint-spill-lowering.ll [new file with mode: 0644]