[Statepoints] Use Indirect operands for spill slots
authorPhilip Reames <listmail@philipreames.com>
Wed, 23 Dec 2015 23:44:28 +0000 (23:44 +0000)
committerPhilip Reames <listmail@philipreames.com>
Wed, 23 Dec 2015 23:44:28 +0000 (23:44 +0000)
commitda801219ba8d6d2a8663d4dd3c14e8e3fca35ba5
tree5e2d739c3f8d0824157b71a90bf271a29fedba8d
parent8eb4aa593671eeabb76e673e965dc21621c911b1
[Statepoints] Use Indirect operands for spill slots

Teach the statepoint lowering code to emit Indirect stackmap entries for spill inserted by StatepointLowering (i.e. SelectionDAG), but Direct stackmap entries for in-IR allocas which represent manual stack slots. This is what the docs call for (http://llvm.org/docs/StackMaps.html#stack-map-format), but we've been emitting both as Direct. This was pointed out recently on the mailing list as a bug. It also blocks http://reviews.llvm.org/D15632 which extends the lowering to handle vector-of-pointers since only Indirect references can encode a variable sized slot.

To implement this, I introduced a new flag on the StackObject class used to maintian information about stack slots. I original considered (and prototyped in http://reviews.llvm.org/D15632), the idea of using the existing isSpillSlot flag, but end up deciding that was a bit too risky and that the cost of adding a new flag was low. Having the new flag will also allow us - in the future - to emit better comments in verbose assembly which indicate where a particular stack spill around a call comes from. (deopt, gc, regalloc).

Differential Revision: http://reviews.llvm.org/D15759

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256352 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineFrameInfo.h
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
lib/CodeGen/TargetLoweringBase.cpp
test/CodeGen/X86/statepoint-stackmap-format.ll