HomePhabricator

[Statepoint] Always spill base pointer.

Authored by dantrushin on Aug 27 2020, 5:51 AM.

Description

[Statepoint] Always spill base pointer.

There is a subtle problem with new statepoint lowering scheme
when base and pointers are the same (see PR46917 for more context):

%1 = STATEPOINT ... %0, %0(tied-def 0)...

if, for some reason, register allocator desides to put two instances
of %0 into two different objects (registers or spill slots), we may
end up with

$reg3 = STATEPOINT ... $reg2, $reg1(tied-def 0)...

and nothing will prevent later passes to sink uses of $reg2 below
statepoint, which is incorrect.

As a short term solution, always put base pointers on stack during
lowering.
A longer term solution may be to rework MIR statepoint format to
avoid GC pointer duplication in statepoint argument list.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D86712

Details

Committed
dantrushinAug 28 2020, 9:22 AM
Reviewer
reames
Differential Revision
D86712: [Statepoint] Always spill base pointer.
Parents
rG46e0ced762ce: [OpenMP] Fixed wrong test command in the test private_mapping.c
Branches
Unknown
Tags
Unknown