[Statepoints] Operand folding in presense of tied registers.
authorDenis Antrushin <dantrushin@gmail.com>
Wed, 10 Jun 2020 13:01:19 +0000 (20:01 +0700)
committerDenis Antrushin <dantrushin@gmail.com>
Wed, 5 Aug 2020 13:18:28 +0000 (20:18 +0700)
commitd21ce408218150e23b5cc4af45c088c0926d7e18
tree71681e3a2845a607de15df5af8faf9f04d270671
parent4dcbb9cef71afa549afe8f6b4d335b1c996f8079
[Statepoints] Operand folding in presense of tied registers.

Implement proper folding of statepoint meta operands (deopt and GC)
when statepoint uses tied registers.
For deopt operands it is just about properly preserving tiedness
in new instruction.
For tied GC operands folding is a little bit more tricky.
We can fold tied GC operands only from InlineSpiller, because it knows
how to properly reload tied def after it was turned into memory operand.
Other users (e.g. peephole) cannot properly fold such operands as they
do not know how (or when) to reload them from memory.
We do this by un-tieing operand we want to fold in InlineSpiller
and allowing to fold only untied operands in foldPatchpoint.
llvm/lib/CodeGen/InlineSpiller.cpp
llvm/lib/CodeGen/TargetInstrInfo.cpp
llvm/test/CodeGen/X86/statepoint-vreg-folding.mir [new file with mode: 0644]