[PATCH] D86712: [Statepoint] Always spill base pointer.
Denis Antrushin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 07:17:13 PDT 2020
dantrushin created this revision.
dantrushin added reviewers: reames, skatkov.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
dantrushin requested review of this revision.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86712
Files:
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
llvm/test/CodeGen/X86/statepoint-vreg-details.ll
llvm/test/CodeGen/X86/statepoint-vreg.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86712.288322.patch
Type: text/x-patch
Size: 26320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/4bb2b6ae/attachment.bin>
More information about the llvm-commits
mailing list