Skip to content

Commit

Permalink
[docs][statepoints] add a section spelling out simplifications for no…
Browse files Browse the repository at this point in the history
…n-relocating GCs

llvm-svn: 346447
  • Loading branch information
preames committed Nov 8, 2018
1 parent 78b4645 commit e777f01
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions llvm/docs/Statepoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,28 @@ following command.
opt -rewrite-statepoints-for-gc test/Transforms/RewriteStatepointsForGC/basics.ll -S | llc -debug-only=stackmaps
Simplifications for Non-Relocating GCs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Some of the complexity in the previous example is unnecessary for a
non-relocating collector. While a non-relocating collector still needs the
information about which location contain live references, it doesn't need to
represent explicit relocations. As such, the previously described explicit
lowering can be simplified to remove all of the ``gc.relocate`` intrinsic
calls and leave uses in terms of the original reference value.

Here's the explicit lowering for the previous example for a non-relocating
collector:

.. code-block:: llvm
define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj)
gc "statepoint-example" {
call token (i64, i32, void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %obj)
ret i8 addrspace(1)* %obj
}
Base & Derived Pointers
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit e777f01

Please sign in to comment.