StackMap: Implement support for DirectMemRefOp.
authorAndrew Trick <atrick@apple.com>
Tue, 26 Nov 2013 02:03:25 +0000 (02:03 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 26 Nov 2013 02:03:25 +0000 (02:03 +0000)
commit501aeea3256514d26e9d88bdbf74508c7f46be98
treefac95663928861e8cd3a6eed2cc268ae215fb846
parent151ed664892bfd43560071034cb2fd8f74a11a61
StackMap: Implement support for DirectMemRefOp.

A Direct stack map location records the address of frame index. This
address is itself the value that the runtime requested. This differs
from IndirectMemRefOp locations, which refer to a stack locations from
which the requested values must be loaded. Direct locations can
directly communicate the address if an alloca, while IndirectMemRefOp
handle register spills.

For example:

entry:
  %a = alloca i64...
  llvm.experimental.stackmap(i32 <ID>, i32 <shadowBytes>, i64* %a)

Since both the alloca and stackmap intrinsic are in the entry block,
and the intrinsic takes the address of the alloca, the runtime can
assume that LLVM will not substitute alloca with any intervening
value. This must be verified by the runtime by checking that the stack
map's location is a Direct location type. The runtime can then
determine the alloca's relative location on the stack immediately after
compilation, or at any time thereafter. This differs from Register and
Indirect locations, because the runtime can only read the values in
those locations when execution reaches the instruction address of the
stack map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195712 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/Target.td
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/anyregcc.ll
test/CodeGen/X86/stackmap.ll