blob: 28546c78a029cfd4923b7dea4f898549299069ad [file] [log] [blame]
Philip Reamesf6123222014-12-02 19:37:00 +00001=====================================
2Garbage Collection Safepoints in LLVM
3=====================================
4
5.. contents::
6 :local:
7 :depth: 2
8
9Status
10=======
11
Philip Reames0d98ada2017-04-19 23:16:13 +000012This document describes a set of extensions to LLVM to support garbage
13collection. By now, these mechanisms are well proven with commercial java
14implementation with a fully relocating collector having shipped using them.
15There are a couple places where bugs might still linger; these are called out
16below.
Philip Reamesf6123222014-12-02 19:37:00 +000017
Philip Reames0d98ada2017-04-19 23:16:13 +000018They are still listed as "experimental" to indicate that no forward or backward
19compatibility guarantees are offered across versions. If your use case is such
20that you need some form of forward compatibility guarantee, please raise the
21issue on the llvm-dev mailing list.
22
23LLVM still supports an alternate mechanism for conservative garbage collection
24support using the ``gcroot`` intrinsic. The ``gcroot`` mechanism is mostly of
25historical interest at this point with one exception - it's implementation of
26shadow stacks has been used successfully by a number of language frontends and
27is still supported.
Philip Reamesf6123222014-12-02 19:37:00 +000028
29Overview
30========
31
Philip Reamesdfc238b2015-01-02 19:46:49 +000032To collect dead objects, garbage collectors must be able to identify
33any references to objects contained within executing code, and,
34depending on the collector, potentially update them. The collector
35does not need this information at all points in code - that would make
36the problem much harder - but only at well-defined points in the
37execution known as 'safepoints' For most collectors, it is sufficient
38to track at least one copy of each unique pointer value. However, for
39a collector which wishes to relocate objects directly reachable from
40running code, a higher standard is required.
Philip Reamesf6123222014-12-02 19:37:00 +000041
Philip Reamesdfc238b2015-01-02 19:46:49 +000042One additional challenge is that the compiler may compute intermediate
43results ("derived pointers") which point outside of the allocation or
44even into the middle of another allocation. The eventual use of this
45intermediate value must yield an address within the bounds of the
46allocation, but such "exterior derived pointers" may be visible to the
47collector. Given this, a garbage collector can not safely rely on the
48runtime value of an address to indicate the object it is associated
49with. If the garbage collector wishes to move any object, the
50compiler must provide a mapping, for each pointer, to an indication of
51its allocation.
Philip Reamesf6123222014-12-02 19:37:00 +000052
Philip Reamesdfc238b2015-01-02 19:46:49 +000053To simplify the interaction between a collector and the compiled code,
54most garbage collectors are organized in terms of three abstractions:
55load barriers, store barriers, and safepoints.
Philip Reamesf6123222014-12-02 19:37:00 +000056
Philip Reamesdfc238b2015-01-02 19:46:49 +000057#. A load barrier is a bit of code executed immediately after the
58 machine load instruction, but before any use of the value loaded.
59 Depending on the collector, such a barrier may be needed for all
60 loads, merely loads of a particular type (in the original source
61 language), or none at all.
Philip Reamesf6123222014-12-02 19:37:00 +000062
Bruce Mitchenere9ffb452015-09-12 01:17:08 +000063#. Analogously, a store barrier is a code fragment that runs
Philip Reamesdfc238b2015-01-02 19:46:49 +000064 immediately before the machine store instruction, but after the
65 computation of the value stored. The most common use of a store
66 barrier is to update a 'card table' in a generational garbage
67 collector.
Philip Reamesf6123222014-12-02 19:37:00 +000068
Philip Reamesdfc238b2015-01-02 19:46:49 +000069#. A safepoint is a location at which pointers visible to the compiled
70 code (i.e. currently in registers or on the stack) are allowed to
71 change. After the safepoint completes, the actual pointer value
72 may differ, but the 'object' (as seen by the source language)
73 pointed to will not.
Philip Reamesf6123222014-12-02 19:37:00 +000074
Philip Reamesdfc238b2015-01-02 19:46:49 +000075 Note that the term 'safepoint' is somewhat overloaded. It refers to
76 both the location at which the machine state is parsable and the
77 coordination protocol involved in bring application threads to a
78 point at which the collector can safely use that information. The
79 term "statepoint" as used in this document refers exclusively to the
80 former.
Philip Reamesf6123222014-12-02 19:37:00 +000081
Philip Reamesdfc238b2015-01-02 19:46:49 +000082This document focuses on the last item - compiler support for
83safepoints in generated code. We will assume that an outside
84mechanism has decided where to place safepoints. From our
85perspective, all safepoints will be function calls. To support
86relocation of objects directly reachable from values in compiled code,
87the collector must be able to:
88
89#. identify every copy of a pointer (including copies introduced by
90 the compiler itself) at the safepoint,
Philip Reamesf6123222014-12-02 19:37:00 +000091#. identify which object each pointer relates to, and
92#. potentially update each of those copies.
93
Philip Reamesdfc238b2015-01-02 19:46:49 +000094This document describes the mechanism by which an LLVM based compiler
95can provide this information to a language runtime/collector, and
Philip Reames0d98ada2017-04-19 23:16:13 +000096ensure that all pointers can be read and updated if desired.
97
98At a high level, LLVM has been extended to support compiling to an abstract
99machine which extends the actual target with a non-integral pointer type
100suitable for representing a garbage collected reference to an object. In
101particular, such non-integral pointer type have no defined mapping to an
102integer representation. This semantic quirk allows the runtime to pick a
103integer mapping for each point in the program allowing relocations of objects
104without visible effects.
105
106Warning: Non-Integral Pointer Types are a newly added concept in LLVM IR.
107It's possible that we've missed disabling some of the optimizations which
108assume an integral value for pointers. If you find such a case, please
109file a bug or share a patch.
110
111Warning: There is one currently known semantic hole in the definition of
112non-integral pointers which has not been addressed upstream. To work around
113this, you need to disable speculation of loads unless the memory type
114(non-integral pointer vs anything else) is known to unchanged. That is, it is
115not safe to speculate a load if doing causes a non-integral pointer value to
116be loaded as any other type or vice versa. In practice, this restriction is
117well isolated to isSafeToSpeculate in ValueTracking.cpp.
118
119This high level abstract machine model is used for most of the LLVM optimizer.
120Before starting code generation, we switch representations to an explicit form.
121In theory, a frontend could directly generate this low level explicit form, but
122doing so is likely to inhibit optimization.
123
124The heart of the explicit approach is to construct (or rewrite) the IR in a
125manner where the possible updates performed by the garbage collector are
Philip Reamesdfc238b2015-01-02 19:46:49 +0000126explicitly visible in the IR. Doing so requires that we:
Philip Reamesf6123222014-12-02 19:37:00 +0000127
Philip Reamesdfc238b2015-01-02 19:46:49 +0000128#. create a new SSA value for each potentially relocated pointer, and
129 ensure that no uses of the original (non relocated) value is
130 reachable after the safepoint,
131#. specify the relocation in a way which is opaque to the compiler to
132 ensure that the optimizer can not introduce new uses of an
133 unrelocated value after a statepoint. This prevents the optimizer
134 from performing unsound optimizations.
135#. recording a mapping of live pointers (and the allocation they're
136 associated with) for each statepoint.
Philip Reamesf6123222014-12-02 19:37:00 +0000137
Philip Reamesdfc238b2015-01-02 19:46:49 +0000138At the most abstract level, inserting a safepoint can be thought of as
139replacing a call instruction with a call to a multiple return value
140function which both calls the original target of the call, returns
141it's result, and returns updated values for any live pointers to
142garbage collected objects.
Philip Reamesf6123222014-12-02 19:37:00 +0000143
Philip Reamesdfc238b2015-01-02 19:46:49 +0000144 Note that the task of identifying all live pointers to garbage
145 collected values, transforming the IR to expose a pointer giving the
146 base object for every such live pointer, and inserting all the
147 intrinsics correctly is explicitly out of scope for this document.
Philip Reamesc88d7322015-02-25 01:23:59 +0000148 The recommended approach is to use the :ref:`utility passes
149 <statepoint-utilities>` described below.
Philip Reamesf6123222014-12-02 19:37:00 +0000150
Philip Reamesdfc238b2015-01-02 19:46:49 +0000151This abstract function call is concretely represented by a sequence of
Philip Reames5017ab52015-02-26 01:18:21 +0000152intrinsic calls known collectively as a "statepoint relocation sequence".
Philip Reamesf6123222014-12-02 19:37:00 +0000153
154Let's consider a simple call in LLVM IR:
Philip Reamesf6123222014-12-02 19:37:00 +0000155
Philip Reames5017ab52015-02-26 01:18:21 +0000156.. code-block:: llvm
Philip Reamesf6123222014-12-02 19:37:00 +0000157
Philip Reames5017ab52015-02-26 01:18:21 +0000158 define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj)
159 gc "statepoint-example" {
160 call void ()* @foo()
161 ret i8 addrspace(1)* %obj
162 }
Philip Reamesf6123222014-12-02 19:37:00 +0000163
Philip Reames5017ab52015-02-26 01:18:21 +0000164Depending on our language we may need to allow a safepoint during the execution
165of ``foo``. If so, we need to let the collector update local values in the
166current frame. If we don't, we'll be accessing a potential invalid reference
167once we eventually return from the call.
168
169In this example, we need to relocate the SSA value ``%obj``. Since we can't
170actually change the value in the SSA value ``%obj``, we need to introduce a new
171SSA value ``%obj.relocated`` which represents the potentially changed value of
172``%obj`` after the safepoint and update any following uses appropriately. The
173resulting relocation sequence is:
174
Renato Golin124f2592016-07-20 12:16:38 +0000175.. code-block:: text
Philip Reames5017ab52015-02-26 01:18:21 +0000176
177 define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj)
178 gc "statepoint-example" {
Chen Lid71999e2015-12-26 07:54:32 +0000179 %0 = 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)
180 %obj.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %0, i32 7, i32 7)
Philip Reames5017ab52015-02-26 01:18:21 +0000181 ret i8 addrspace(1)* %obj.relocated
182 }
Philip Reamesf6123222014-12-02 19:37:00 +0000183
Philip Reamesdfc238b2015-01-02 19:46:49 +0000184Ideally, this sequence would have been represented as a M argument, N
185return value function (where M is the number of values being
186relocated + the original call arguments and N is the original return
187value + each relocated value), but LLVM does not easily support such a
188representation.
189
190Instead, the statepoint intrinsic marks the actual site of the
191safepoint or statepoint. The statepoint returns a token value (which
192exists only at compile time). To get back the original return value
Philip Reames5017ab52015-02-26 01:18:21 +0000193of the call, we use the ``gc.result`` intrinsic. To get the relocation
194of each pointer in turn, we use the ``gc.relocate`` intrinsic with the
195appropriate index. Note that both the ``gc.relocate`` and ``gc.result`` are
196tied to the statepoint. The combination forms a "statepoint relocation
Bruce Mitchenere9ffb452015-09-12 01:17:08 +0000197sequence" and represents the entirety of a parseable call or 'statepoint'.
Philip Reamesf6123222014-12-02 19:37:00 +0000198
Philip Reames5017ab52015-02-26 01:18:21 +0000199When lowered, this example would generate the following x86 assembly:
200
201.. code-block:: gas
202
203 .globl test1
204 .align 16, 0x90
205 pushq %rax
206 callq foo
207 .Ltmp1:
208 movq (%rsp), %rax # This load is redundant (oops!)
209 popq %rdx
210 retq
Philip Reamesf6123222014-12-02 19:37:00 +0000211
Philip Reamesdfc238b2015-01-02 19:46:49 +0000212Each of the potentially relocated values has been spilled to the
213stack, and a record of that location has been recorded to the
Philip Reames5017ab52015-02-26 01:18:21 +0000214:ref:`Stack Map section <stackmap-section>`. If the garbage collector
Philip Reamesdfc238b2015-01-02 19:46:49 +0000215needs to update any of these pointers during the call, it knows
216exactly what to change.
Philip Reamesf6123222014-12-02 19:37:00 +0000217
Philip Reames5017ab52015-02-26 01:18:21 +0000218The relevant parts of the StackMap section for our example are:
219
220.. code-block:: gas
221
222 # This describes the call site
223 # Stack Maps: callsite 2882400000
224 .quad 2882400000
225 .long .Ltmp1-test1
226 .short 0
227 # .. 8 entries skipped ..
228 # This entry describes the spill slot which is directly addressable
229 # off RSP with offset 0. Given the value was spilled with a pushq,
230 # that makes sense.
231 # Stack Maps: Loc 8: Direct RSP [encoding: .byte 2, .byte 8, .short 7, .int 0]
232 .byte 2
233 .byte 8
234 .short 7
235 .long 0
236
237This example was taken from the tests for the :ref:`RewriteStatepointsForGC` utility pass. As such, it's full StackMap can be easily examined with the following command.
238
239.. code-block:: bash
240
241 opt -rewrite-statepoints-for-gc test/Transforms/RewriteStatepointsForGC/basics.ll -S | llc -debug-only=stackmaps
242
Philip Reamesc9e54442015-08-26 17:25:36 +0000243Base & Derived Pointers
244^^^^^^^^^^^^^^^^^^^^^^^
245
Philip Reamesca22b862015-08-26 23:13:35 +0000246A "base pointer" is one which points to the starting address of an allocation
247(object). A "derived pointer" is one which is offset from a base pointer by
248some amount. When relocating objects, a garbage collector needs to be able
249to relocate each derived pointer associated with an allocation to the same
250offset from the new address.
Philip Reamesc9e54442015-08-26 17:25:36 +0000251
Philip Reamesca22b862015-08-26 23:13:35 +0000252"Interior derived pointers" remain within the bounds of the allocation
253they're associated with. As a result, the base object can be found at
254runtime provided the bounds of allocations are known to the runtime system.
255
256"Exterior derived pointers" are outside the bounds of the associated object;
257they may even fall within *another* allocations address range. As a result,
258there is no way for a garbage collector to determine which allocation they
259are associated with at runtime and compiler support is needed.
260
261The ``gc.relocate`` intrinsic supports an explicit operand for describing the
262allocation associated with a derived pointer. This operand is frequently
263referred to as the base operand, but does not strictly speaking have to be
264a base pointer, but it does need to lie within the bounds of the associated
265allocation. Some collectors may require that the operand be an actual base
266pointer rather than merely an internal derived pointer. Note that during
267lowering both the base and derived pointer operands are required to be live
268over the associated call safepoint even if the base is otherwise unused
269afterwards.
270
271If we extend our previous example to include a pointless derived pointer,
272we get:
273
Renato Golin124f2592016-07-20 12:16:38 +0000274.. code-block:: text
Philip Reamesca22b862015-08-26 23:13:35 +0000275
276 define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj)
277 gc "statepoint-example" {
278 %gep = getelementptr i8, i8 addrspace(1)* %obj, i64 20000
Chen Lid71999e2015-12-26 07:54:32 +0000279 %token = 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, i8 addrspace(1)* %gep)
280 %obj.relocated = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %token, i32 7, i32 7)
281 %gep.relocated = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %token, i32 7, i32 8)
Philip Reamesca22b862015-08-26 23:13:35 +0000282 %p = getelementptr i8, i8 addrspace(1)* %gep, i64 -20000
283 ret i8 addrspace(1)* %p
284 }
285
286Note that in this example %p and %obj.relocate are the same address and we
287could replace one with the other, potentially removing the derived pointer
Sanjoy Dasa34ce952016-01-20 19:50:25 +0000288from the live set at the safepoint entirely.
289
290.. _gc_transition_args:
Philip Reames5017ab52015-02-26 01:18:21 +0000291
Pat Gavlincc0431d2015-05-08 18:07:42 +0000292GC Transitions
293^^^^^^^^^^^^^^^^^^
Philip Reames5017ab52015-02-26 01:18:21 +0000294
Pat Gavlincc0431d2015-05-08 18:07:42 +0000295As a practical consideration, many garbage-collected systems allow code that is
296collector-aware ("managed code") to call code that is not collector-aware
297("unmanaged code"). It is common that such calls must also be safepoints, since
298it is desirable to allow the collector to run during the execution of
Sylvestre Ledru84666a12016-02-14 20:16:22 +0000299unmanaged code. Furthermore, it is common that coordinating the transition from
Pat Gavlincc0431d2015-05-08 18:07:42 +0000300managed to unmanaged code requires extra code generation at the call site to
301inform the collector of the transition. In order to support these needs, a
302statepoint may be marked as a GC transition, and data that is necessary to
303perform the transition (if any) may be provided as additional arguments to the
304statepoint.
305
306 Note that although in many cases statepoints may be inferred to be GC
307 transitions based on the function symbols involved (e.g. a call from a
308 function with GC strategy "foo" to a function with GC strategy "bar"),
309 indirect calls that are also GC transitions must also be supported. This
Bruce Mitchenere9ffb452015-09-12 01:17:08 +0000310 requirement is the driving force behind the decision to require that GC
Pat Gavlincc0431d2015-05-08 18:07:42 +0000311 transitions are explicitly marked.
312
313Let's revisit the sample given above, this time treating the call to ``@foo``
314as a GC transition. Depending on our target, the transition code may need to
315access some extra state in order to inform the collector of the transition.
316Let's assume a hypothetical GC--somewhat unimaginatively named "hypothetical-gc"
317--that requires that a TLS variable must be written to before and after a call
318to unmanaged code. The resulting relocation sequence is:
319
Renato Golin124f2592016-07-20 12:16:38 +0000320.. code-block:: text
Pat Gavlincc0431d2015-05-08 18:07:42 +0000321
322 @flag = thread_local global i32 0, align 4
323
324 define i8 addrspace(1)* @test1(i8 addrspace(1) *%obj)
325 gc "hypothetical-gc" {
326
Chen Lid71999e2015-12-26 07:54:32 +0000327 %0 = call token (i64, i32, void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 1, i32* @Flag, i32 0, i8 addrspace(1)* %obj)
328 %obj.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %0, i32 7, i32 7)
Pat Gavlincc0431d2015-05-08 18:07:42 +0000329 ret i8 addrspace(1)* %obj.relocated
330 }
331
332During lowering, this will result in a instruction selection DAG that looks
333something like:
334
Pat Gavlin7afaed22015-05-08 18:37:49 +0000335::
Pat Gavlincc0431d2015-05-08 18:07:42 +0000336
337 CALLSEQ_START
338 ...
339 GC_TRANSITION_START (lowered i32 *@Flag), SRCVALUE i32* Flag
340 STATEPOINT
341 GC_TRANSITION_END (lowered i32 *@Flag), SRCVALUE i32 *Flag
342 ...
343 CALLSEQ_END
344
345In order to generate the necessary transition code, the backend for each target
346supported by "hypothetical-gc" must be modified to lower ``GC_TRANSITION_START``
347and ``GC_TRANSITION_END`` nodes appropriately when the "hypothetical-gc"
348strategy is in use for a particular function. Assuming that such lowering has
349been added for X86, the generated assembly would be:
350
351.. code-block:: gas
352
353 .globl test1
354 .align 16, 0x90
355 pushq %rax
356 movl $1, %fs:Flag@TPOFF
357 callq foo
358 movl $0, %fs:Flag@TPOFF
359 .Ltmp1:
360 movq (%rsp), %rax # This load is redundant (oops!)
361 popq %rdx
362 retq
363
364Note that the design as presented above is not fully implemented: in particular,
365strategy-specific lowering is not present, and all GC transitions are emitted as
366as single no-op before and after the call instruction. These no-ops are often
367removed by the backend during dead machine instruction elimination.
Philip Reames5017ab52015-02-26 01:18:21 +0000368
369
Philip Reamesf6123222014-12-02 19:37:00 +0000370Intrinsics
371===========
372
Philip Reamesc0127282015-02-24 23:57:26 +0000373'llvm.experimental.gc.statepoint' Intrinsic
374^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Philip Reamesf6123222014-12-02 19:37:00 +0000375
376Syntax:
377"""""""
378
379::
380
Chen Lid71999e2015-12-26 07:54:32 +0000381 declare token
Sanjoy Dasa1d39ba2015-05-12 23:52:24 +0000382 @llvm.experimental.gc.statepoint(i64 <id>, i32 <num patch bytes>,
383 func_type <target>,
Sanjoy Dasdc4932f2015-05-13 20:19:51 +0000384 i64 <#call args>, i64 <flags>,
Philip Reamesc0127282015-02-24 23:57:26 +0000385 ... (call parameters),
Pat Gavlincc0431d2015-05-08 18:07:42 +0000386 i64 <# transition args>, ... (transition parameters),
Philip Reamesf6123222014-12-02 19:37:00 +0000387 i64 <# deopt args>, ... (deopt parameters),
388 ... (gc parameters))
389
390Overview:
391"""""""""
392
Philip Reamesdfc238b2015-01-02 19:46:49 +0000393The statepoint intrinsic represents a call which is parse-able by the
394runtime.
Philip Reamesf6123222014-12-02 19:37:00 +0000395
396Operands:
397"""""""""
398
Sanjoy Dasa1d39ba2015-05-12 23:52:24 +0000399The 'id' operand is a constant integer that is reported as the ID
400field in the generated stackmap. LLVM does not interpret this
401parameter in any way and its meaning is up to the statepoint user to
402decide. Note that LLVM is free to duplicate code containing
403statepoint calls, and this may transform IR that had a unique 'id' per
404lexical call to statepoint to IR that does not.
405
406If 'num patch bytes' is non-zero then the call instruction
407corresponding to the statepoint is not emitted and LLVM emits 'num
408patch bytes' bytes of nops in its place. LLVM will emit code to
409prepare the function arguments and retrieve the function return value
410in accordance to the calling convention; the former before the nop
411sequence and the latter after the nop sequence. It is expected that
412the user will patch over the 'num patch bytes' bytes of nops with a
413calling sequence specific to their runtime before executing the
414generated machine code. There are no guarantees with respect to the
415alignment of the nop sequence. Unlike :doc:`StackMaps` statepoints do
Sanjoy Dascfe41f02015-07-28 23:50:30 +0000416not have a concept of shadow bytes. Note that semantically the
417statepoint still represents a call or invoke to 'target', and the nop
418sequence after patching is expected to represent an operation
419equivalent to a call or invoke to 'target'.
Sanjoy Dasa1d39ba2015-05-12 23:52:24 +0000420
Philip Reamesdfc238b2015-01-02 19:46:49 +0000421The 'target' operand is the function actually being called. The
422target can be specified as either a symbolic LLVM function, or as an
423arbitrary Value of appropriate function type. Note that the function
424type must match the signature of the callee and the types of the 'call
Sanjoy Dascfe41f02015-07-28 23:50:30 +0000425parameters' arguments.
Philip Reamesf6123222014-12-02 19:37:00 +0000426
Philip Reamesdfc238b2015-01-02 19:46:49 +0000427The '#call args' operand is the number of arguments to the actual
428call. It must exactly match the number of arguments passed in the
429'call parameters' variable length section.
Philip Reamesf6123222014-12-02 19:37:00 +0000430
Pat Gavlincc0431d2015-05-08 18:07:42 +0000431The 'flags' operand is used to specify extra information about the
432statepoint. This is currently only used to mark certain statepoints
433as GC transitions. This operand is a 64-bit integer with the following
434layout, where bit 0 is the least significant bit:
435
436 +-------+---------------------------------------------------+
437 | Bit # | Usage |
438 +=======+===================================================+
439 | 0 | Set if the statepoint is a GC transition, cleared |
440 | | otherwise. |
441 +-------+---------------------------------------------------+
442 | 1-63 | Reserved for future use; must be cleared. |
443 +-------+---------------------------------------------------+
Philip Reamesf6123222014-12-02 19:37:00 +0000444
Philip Reamesdfc238b2015-01-02 19:46:49 +0000445The 'call parameters' arguments are simply the arguments which need to
446be passed to the call target. They will be lowered according to the
447specified calling convention and otherwise handled like a normal call
448instruction. The number of arguments must exactly match what is
449specified in '# call args'. The types must match the signature of
450'target'.
Philip Reamesf6123222014-12-02 19:37:00 +0000451
Pat Gavlincc0431d2015-05-08 18:07:42 +0000452The 'transition parameters' arguments contain an arbitrary list of
453Values which need to be passed to GC transition code. They will be
454lowered and passed as operands to the appropriate GC_TRANSITION nodes
455in the selection DAG. It is assumed that these arguments must be
456available before and after (but not necessarily during) the execution
457of the callee. The '# transition args' field indicates how many operands
458are to be interpreted as 'transition parameters'.
459
Philip Reamesdfc238b2015-01-02 19:46:49 +0000460The 'deopt parameters' arguments contain an arbitrary list of Values
461which is meaningful to the runtime. The runtime may read any of these
462values, but is assumed not to modify them. If the garbage collector
463might need to modify one of these values, it must also be listed in
464the 'gc pointer' argument list. The '# deopt args' field indicates
465how many operands are to be interpreted as 'deopt parameters'.
Philip Reamesf6123222014-12-02 19:37:00 +0000466
Philip Reamesdfc238b2015-01-02 19:46:49 +0000467The 'gc parameters' arguments contain every pointer to a garbage
468collector object which potentially needs to be updated by the garbage
469collector. Note that the argument list must explicitly contain a base
470pointer for every derived pointer listed. The order of arguments is
471unimportant. Unlike the other variable length parameter sets, this
472list is not length prefixed.
Philip Reamesf6123222014-12-02 19:37:00 +0000473
474Semantics:
475""""""""""
476
Philip Reamesdfc238b2015-01-02 19:46:49 +0000477A statepoint is assumed to read and write all memory. As a result,
478memory operations can not be reordered past a statepoint. It is
479illegal to mark a statepoint as being either 'readonly' or 'readnone'.
Philip Reamesf6123222014-12-02 19:37:00 +0000480
Philip Reamesdfc238b2015-01-02 19:46:49 +0000481Note that legal IR can not perform any memory operation on a 'gc
482pointer' argument of the statepoint in a location statically reachable
483from the statepoint. Instead, the explicitly relocated value (from a
Philip Reamesc609a592015-02-25 00:22:07 +0000484``gc.relocate``) must be used.
Philip Reamesf6123222014-12-02 19:37:00 +0000485
Philip Reamesc0127282015-02-24 23:57:26 +0000486'llvm.experimental.gc.result' Intrinsic
487^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Philip Reamesf6123222014-12-02 19:37:00 +0000488
489Syntax:
490"""""""
491
492::
493
494 declare type*
Chen Lid71999e2015-12-26 07:54:32 +0000495 @llvm.experimental.gc.result(token %statepoint_token)
Philip Reamesf6123222014-12-02 19:37:00 +0000496
497Overview:
498"""""""""
499
Philip Reamesc609a592015-02-25 00:22:07 +0000500``gc.result`` extracts the result of the original call instruction
501which was replaced by the ``gc.statepoint``. The ``gc.result``
Philip Reamesdfc238b2015-01-02 19:46:49 +0000502intrinsic is actually a family of three intrinsics due to an
503implementation limitation. Other than the type of the return value,
504the semantics are the same.
Philip Reamesf6123222014-12-02 19:37:00 +0000505
506Operands:
507"""""""""
508
Philip Reamesc609a592015-02-25 00:22:07 +0000509The first and only argument is the ``gc.statepoint`` which starts
510the safepoint sequence of which this ``gc.result`` is a part.
Chen Lid71999e2015-12-26 07:54:32 +0000511Despite the typing of this as a generic token, *only* the value defined
Philip Reamesc609a592015-02-25 00:22:07 +0000512by a ``gc.statepoint`` is legal here.
Philip Reamesf6123222014-12-02 19:37:00 +0000513
514Semantics:
515""""""""""
516
Philip Reamesc609a592015-02-25 00:22:07 +0000517The ``gc.result`` represents the return value of the call target of
518the ``statepoint``. The type of the ``gc.result`` must exactly match
Philip Reamesdfc238b2015-01-02 19:46:49 +0000519the type of the target. If the call target returns void, there will
Philip Reamesc609a592015-02-25 00:22:07 +0000520be no ``gc.result``.
Philip Reamesf6123222014-12-02 19:37:00 +0000521
Philip Reamesc609a592015-02-25 00:22:07 +0000522A ``gc.result`` is modeled as a 'readnone' pure function. It has no
Philip Reamesdfc238b2015-01-02 19:46:49 +0000523side effects since it is just a projection of the return value of the
Philip Reamesc609a592015-02-25 00:22:07 +0000524previous call represented by the ``gc.statepoint``.
Philip Reamesf6123222014-12-02 19:37:00 +0000525
Philip Reamesc0127282015-02-24 23:57:26 +0000526'llvm.experimental.gc.relocate' Intrinsic
527^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Philip Reamesf6123222014-12-02 19:37:00 +0000528
529Syntax:
530"""""""
531
532::
533
Philip Reamesc0127282015-02-24 23:57:26 +0000534 declare <pointer type>
Chen Lid71999e2015-12-26 07:54:32 +0000535 @llvm.experimental.gc.relocate(token %statepoint_token,
Philip Reamesc0127282015-02-24 23:57:26 +0000536 i32 %base_offset,
537 i32 %pointer_offset)
Philip Reamesf6123222014-12-02 19:37:00 +0000538
539Overview:
540"""""""""
541
Philip Reamesc609a592015-02-25 00:22:07 +0000542A ``gc.relocate`` returns the potentially relocated value of a pointer
Philip Reamesdfc238b2015-01-02 19:46:49 +0000543at the safepoint.
Philip Reamesf6123222014-12-02 19:37:00 +0000544
545Operands:
546"""""""""
547
Philip Reamesc609a592015-02-25 00:22:07 +0000548The first argument is the ``gc.statepoint`` which starts the
549safepoint sequence of which this ``gc.relocation`` is a part.
Chen Lid71999e2015-12-26 07:54:32 +0000550Despite the typing of this as a generic token, *only* the value defined
Philip Reamesc609a592015-02-25 00:22:07 +0000551by a ``gc.statepoint`` is legal here.
Philip Reamesf6123222014-12-02 19:37:00 +0000552
Philip Reamesdfc238b2015-01-02 19:46:49 +0000553The second argument is an index into the statepoints list of arguments
Philip Reamesca22b862015-08-26 23:13:35 +0000554which specifies the allocation for the pointer being relocated.
Philip Reamesdfc238b2015-01-02 19:46:49 +0000555This index must land within the 'gc parameter' section of the
Philip Reamesca22b862015-08-26 23:13:35 +0000556statepoint's argument list. The associated value must be within the
557object with which the pointer being relocated is associated. The optimizer
558is free to change *which* interior derived pointer is reported, provided that
559it does not replace an actual base pointer with another interior derived
560pointer. Collectors are allowed to rely on the base pointer operand
561remaining an actual base pointer if so constructed.
Philip Reamesf6123222014-12-02 19:37:00 +0000562
Philip Reamesdfc238b2015-01-02 19:46:49 +0000563The third argument is an index into the statepoint's list of arguments
564which specify the (potentially) derived pointer being relocated. It
565is legal for this index to be the same as the second argument
566if-and-only-if a base pointer is being relocated. This index must land
567within the 'gc parameter' section of the statepoint's argument list.
Philip Reamesf6123222014-12-02 19:37:00 +0000568
569Semantics:
570""""""""""
Philip Reamesf6123222014-12-02 19:37:00 +0000571
Philip Reamesc609a592015-02-25 00:22:07 +0000572The return value of ``gc.relocate`` is the potentially relocated value
Philip Reamesdfc238b2015-01-02 19:46:49 +0000573of the pointer specified by it's arguments. It is unspecified how the
574value of the returned pointer relates to the argument to the
Philip Reamesc609a592015-02-25 00:22:07 +0000575``gc.statepoint`` other than that a) it points to the same source
Philip Reamesdfc238b2015-01-02 19:46:49 +0000576language object with the same offset, and b) the 'based-on'
577relationship of the newly relocated pointers is a projection of the
578unrelocated pointers. In particular, the integer value of the pointer
579returned is unspecified.
580
Philip Reamesc609a592015-02-25 00:22:07 +0000581A ``gc.relocate`` is modeled as a ``readnone`` pure function. It has no
Philip Reamesdfc238b2015-01-02 19:46:49 +0000582side effects since it is just a way to extract information about work
Philip Reamesc609a592015-02-25 00:22:07 +0000583done during the actual call modeled by the ``gc.statepoint``.
Philip Reamesf6123222014-12-02 19:37:00 +0000584
Philip Reamese6625502015-02-25 23:22:43 +0000585.. _statepoint-stackmap-format:
Philip Reamesf6123222014-12-02 19:37:00 +0000586
Philip Reamesce5ff372014-12-04 00:45:23 +0000587Stack Map Format
Philip Reamesf6123222014-12-02 19:37:00 +0000588================
589
Philip Reamesdfc238b2015-01-02 19:46:49 +0000590Locations for each pointer value which may need read and/or updated by
591the runtime or collector are provided via the :ref:`Stack Map format
592<stackmap-format>` specified in the PatchPoint documentation.
Philip Reamesf6123222014-12-02 19:37:00 +0000593
594Each statepoint generates the following Locations:
595
Pat Gavlinc7dc6d6ee2015-05-12 19:50:19 +0000596* Constant which describes the calling convention of the call target. This
597 constant is a valid :ref:`calling convention identifier <callingconv>` for
598 the version of LLVM used to generate the stackmap. No additional compatibility
599 guarantees are made for this constant over what LLVM provides elsewhere w.r.t.
600 these identifiers.
601* Constant which describes the flags passed to the statepoint intrinsic
Philip Reamesdfc238b2015-01-02 19:46:49 +0000602* Constant which describes number of following deopt *Locations* (not
603 operands)
604* Variable number of Locations, one for each deopt parameter listed in
Philip Reames95e363d2016-01-14 23:58:18 +0000605 the IR statepoint (same number as described by previous Constant). At
606 the moment, only deopt parameters with a bitwidth of 64 bits or less
607 are supported. Values of a type larger than 64 bits can be specified
608 and reported only if a) the value is constant at the call site, and b)
609 the constant can be represented with less than 64 bits (assuming zero
610 extension to the original bitwidth).
Philip Reames35bafee2016-01-15 00:13:39 +0000611* Variable number of relocation records, each of which consists of
612 exactly two Locations. Relocation records are described in detail
613 below.
614
615Each relocation record provides sufficient information for a collector to
616relocate one or more derived pointers. Each record consists of a pair of
617Locations. The second element in the record represents the pointer (or
618pointers) which need updated. The first element in the record provides a
619pointer to the base of the object with which the pointer(s) being relocated is
620associated. This information is required for handling generalized derived
621pointers since a pointer may be outside the bounds of the original allocation,
622but still needs to be relocated with the allocation. Additionally:
623
624* It is guaranteed that the base pointer must also appear explicitly as a
625 relocation pair if used after the statepoint.
626* There may be fewer relocation records then gc parameters in the IR
Philip Reamesdfc238b2015-01-02 19:46:49 +0000627 statepoint. Each *unique* pair will occur at least once; duplicates
Philip Reames35bafee2016-01-15 00:13:39 +0000628 are possible.
629* The Locations within each record may either be of pointer size or a
630 multiple of pointer size. In the later case, the record must be
631 interpreted as describing a sequence of pointers and their corresponding
632 base pointers. If the Location is of size N x sizeof(pointer), then
633 there will be N records of one pointer each contained within the Location.
634 Both Locations in a pair can be assumed to be of the same size.
Philip Reamesf6123222014-12-02 19:37:00 +0000635
Philip Reamesdfc238b2015-01-02 19:46:49 +0000636Note that the Locations used in each section may describe the same
637physical location. e.g. A stack slot may appear as a deopt location,
638a gc base pointer, and a gc derived pointer.
Philip Reamesf6123222014-12-02 19:37:00 +0000639
Philip Reamesdfc238b2015-01-02 19:46:49 +0000640The LiveOut section of the StkMapRecord will be empty for a statepoint
641record.
Philip Reamesf6123222014-12-02 19:37:00 +0000642
643Safepoint Semantics & Verification
644==================================
645
Philip Reamesdfc238b2015-01-02 19:46:49 +0000646The fundamental correctness property for the compiled code's
647correctness w.r.t. the garbage collector is a dynamic one. It must be
648the case that there is no dynamic trace such that a operation
649involving a potentially relocated pointer is observably-after a
650safepoint which could relocate it. 'observably-after' is this usage
651means that an outside observer could observe this sequence of events
652in a way which precludes the operation being performed before the
653safepoint.
Philip Reamesf6123222014-12-02 19:37:00 +0000654
Philip Reamesdfc238b2015-01-02 19:46:49 +0000655To understand why this 'observable-after' property is required,
656consider a null comparison performed on the original copy of a
657relocated pointer. Assuming that control flow follows the safepoint,
658there is no way to observe externally whether the null comparison is
659performed before or after the safepoint. (Remember, the original
660Value is unmodified by the safepoint.) The compiler is free to make
661either scheduling choice.
Philip Reamesf6123222014-12-02 19:37:00 +0000662
Philip Reamesdfc238b2015-01-02 19:46:49 +0000663The actual correctness property implemented is slightly stronger than
664this. We require that there be no *static path* on which a
665potentially relocated pointer is 'observably-after' it may have been
666relocated. This is slightly stronger than is strictly necessary (and
667thus may disallow some otherwise valid programs), but greatly
668simplifies reasoning about correctness of the compiled code.
Philip Reamesf6123222014-12-02 19:37:00 +0000669
Philip Reamesdfc238b2015-01-02 19:46:49 +0000670By construction, this property will be upheld by the optimizer if
671correctly established in the source IR. This is a key invariant of
672the design.
Philip Reamesf6123222014-12-02 19:37:00 +0000673
Philip Reamesdfc238b2015-01-02 19:46:49 +0000674The existing IR Verifier pass has been extended to check most of the
675local restrictions on the intrinsics mentioned in their respective
676documentation. The current implementation in LLVM does not check the
677key relocation invariant, but this is ongoing work on developing such
Tanya Lattner0d28f802015-08-05 03:51:17 +0000678a verifier. Please ask on llvm-dev if you're interested in
Philip Reamesdfc238b2015-01-02 19:46:49 +0000679experimenting with the current version.
Philip Reamesf6123222014-12-02 19:37:00 +0000680
Philip Reamesc88d7322015-02-25 01:23:59 +0000681.. _statepoint-utilities:
682
683Utility Passes for Safepoint Insertion
684======================================
685
686.. _RewriteStatepointsForGC:
687
688RewriteStatepointsForGC
689^^^^^^^^^^^^^^^^^^^^^^^^
690
Philip Reames0d98ada2017-04-19 23:16:13 +0000691The pass RewriteStatepointsForGC transforms a function's IR to lower from the
692abstract machine model described above to the explicit statepoint model of
693relocations. To do this, it replaces all calls or invokes of functions which
694might contain a safepoint poll with a ``gc.statepoint`` and associated full
695relocation sequence, including all required ``gc.relocates``.
696
697Note that by default, this pass only runs for the "statepoint-example" or
698"core-clr" gc strategies. You will need to add your custom strategy to this
699whitelist or use one of the predefined ones.
Philip Reamesc88d7322015-02-25 01:23:59 +0000700
701As an example, given this code:
702
Renato Golin124f2592016-07-20 12:16:38 +0000703.. code-block:: text
Philip Reamesc88d7322015-02-25 01:23:59 +0000704
705 define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj)
706 gc "statepoint-example" {
Philip Reames0d98ada2017-04-19 23:16:13 +0000707 call void @foo()
Philip Reamesc88d7322015-02-25 01:23:59 +0000708 ret i8 addrspace(1)* %obj
709 }
710
711The pass would produce this IR:
712
Renato Golin124f2592016-07-20 12:16:38 +0000713.. code-block:: text
Philip Reamesc88d7322015-02-25 01:23:59 +0000714
715 define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj)
716 gc "statepoint-example" {
Chen Lid71999e2015-12-26 07:54:32 +0000717 %0 = call token (i64, i32, void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0, i8 addrspace(1)* %obj)
718 %obj.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %0, i32 12, i32 12)
Philip Reamesc88d7322015-02-25 01:23:59 +0000719 ret i8 addrspace(1)* %obj.relocated
720 }
721
722In the above examples, the addrspace(1) marker on the pointers is the mechanism
723that the ``statepoint-example`` GC strategy uses to distinguish references from
Philip Reames0d98ada2017-04-19 23:16:13 +0000724non references. The pass assumes that all addrspace(1) pointers are non-integral
725pointer types. Address space 1 is not globally reserved for this purpose.
Philip Reamesc88d7322015-02-25 01:23:59 +0000726
727This pass can be used an utility function by a language frontend that doesn't
728want to manually reason about liveness, base pointers, or relocation when
729constructing IR. As currently implemented, RewriteStatepointsForGC must be
Philip Reamesca22b862015-08-26 23:13:35 +0000730run after SSA construction (i.e. mem2ref).
Philip Reamesc88d7322015-02-25 01:23:59 +0000731
Philip Reamesca22b862015-08-26 23:13:35 +0000732RewriteStatepointsForGC will ensure that appropriate base pointers are listed
733for every relocation created. It will do so by duplicating code as needed to
734propagate the base pointer associated with each pointer being relocated to
735the appropriate safepoints. The implementation assumes that the following
736IR constructs produce base pointers: loads from the heap, addresses of global
737variables, function arguments, function return values. Constant pointers (such
738as null) are also assumed to be base pointers. In practice, this constraint
739can be relaxed to producing interior derived pointers provided the target
740collector can find the associated allocation from an arbitrary interior
741derived pointer.
Philip Reamesc88d7322015-02-25 01:23:59 +0000742
Philip Reames0d98ada2017-04-19 23:16:13 +0000743By default RewriteStatepointsForGC passes in ``0xABCDEF00`` as the statepoint
744ID and ``0`` as the number of patchable bytes to the newly constructed
745``gc.statepoint``. These values can be configured on a per-callsite
746basis using the attributes ``"statepoint-id"`` and
747``"statepoint-num-patch-bytes"``. If a call site is marked with a
748``"statepoint-id"`` function attribute and its value is a positive
749integer (represented as a string), then that value is used as the ID
750of the newly constructed ``gc.statepoint``. If a call site is marked
751with a ``"statepoint-num-patch-bytes"`` function attribute and its
752value is a positive integer, then that value is used as the 'num patch
753bytes' parameter of the newly constructed ``gc.statepoint``. The
754``"statepoint-id"`` and ``"statepoint-num-patch-bytes"`` attributes
755are not propagated to the ``gc.statepoint`` call or invoke if they
756could be successfully parsed.
757
758In practice, RewriteStatepointsForGC should be run much later in the pass
Philip Reamesc88d7322015-02-25 01:23:59 +0000759pipeline, after most optimization is already done. This helps to improve
760the quality of the generated code when compiled with garbage collection support.
Philip Reamesc88d7322015-02-25 01:23:59 +0000761
762.. _PlaceSafepoints:
763
764PlaceSafepoints
765^^^^^^^^^^^^^^^^
766
Philip Reames0d98ada2017-04-19 23:16:13 +0000767The pass PlaceSafepoints inserts safepoint polls sufficient to ensure running
768code checks for a safepoint request on a timely manner. This pass is expected
769to be run before RewriteStatepointsForGC and thus does not produce full
770relocation sequences.
Philip Reamesc88d7322015-02-25 01:23:59 +0000771
Philip Reames5017ab52015-02-26 01:18:21 +0000772As an example, given input IR of the following:
773
774.. code-block:: llvm
775
776 define void @test() gc "statepoint-example" {
777 call void @foo()
778 ret void
779 }
780
781 declare void @do_safepoint()
782 define void @gc.safepoint_poll() {
783 call void @do_safepoint()
784 ret void
785 }
786
787
788This pass would produce the following IR:
789
Renato Golin124f2592016-07-20 12:16:38 +0000790.. code-block:: text
Philip Reames5017ab52015-02-26 01:18:21 +0000791
792 define void @test() gc "statepoint-example" {
Philip Reames0d98ada2017-04-19 23:16:13 +0000793 call void @do_safepoint()
794 call void @foo()
Philip Reames5017ab52015-02-26 01:18:21 +0000795 ret void
796 }
797
Philip Reames0d98ada2017-04-19 23:16:13 +0000798In this case, we've added an (unconditional) entry safepoint poll. Note that
799despite appearances, the entry poll is not necessarily redundant. We'd have to
800know that ``foo`` and ``test`` were not mutually recursive for the poll to be
801redundant. In practice, you'd probably want to your poll definition to contain
802a conditional branch of some form.
Philip Reames5017ab52015-02-26 01:18:21 +0000803
Philip Reamesc88d7322015-02-25 01:23:59 +0000804At the moment, PlaceSafepoints can insert safepoint polls at method entry and
805loop backedges locations. Extending this to work with return polls would be
806straight forward if desired.
807
808PlaceSafepoints includes a number of optimizations to avoid placing safepoint
809polls at particular sites unless needed to ensure timely execution of a poll
810under normal conditions. PlaceSafepoints does not attempt to ensure timely
811execution of a poll under worst case conditions such as heavy system paging.
812
813The implementation of a safepoint poll action is specified by looking up a
814function of the name ``gc.safepoint_poll`` in the containing Module. The body
815of this function is inserted at each poll site desired. While calls or invokes
816inside this method are transformed to a ``gc.statepoints``, recursive poll
817insertion is not performed.
818
Philip Reames0d98ada2017-04-19 23:16:13 +0000819This pass is useful for any language frontend which only has to support
820garbage collection semantics at safepoints. If you need other abstract
821frame information at safepoints (e.g. for deoptimization or introspection),
822you can insert safepoint polls in the frontend. If you have the later case,
823please ask on llvm-dev for suggestions. There's been a good amount of work
824done on making such a scheme work well in practice which is not yet documented
825here.
Philip Reamesc88d7322015-02-25 01:23:59 +0000826
827
Philip Reamesb7736312015-07-16 21:10:46 +0000828Supported Architectures
829=======================
830
831Support for statepoint generation requires some code for each backend.
832Today, only X86_64 is supported.
833
Philip Reames2e7383c2016-03-03 23:24:44 +0000834Problem Areas and Active Work
835=============================
836
Sanjoy Dasfefc4d52016-03-04 18:14:09 +0000837#. Support for languages which allow unmanaged pointers to garbage collected
Philip Reames2e7383c2016-03-03 23:24:44 +0000838 objects (i.e. pass a pointer to an object to a C routine) via pinning.
839
840#. Support for garbage collected objects allocated on the stack. Specifically,
Sanjoy Dasfefc4d52016-03-04 18:14:09 +0000841 allocas are always assumed to be in address space 0 and we need a
842 cast/promotion operator to let rewriting identify them.
Philip Reames2e7383c2016-03-03 23:24:44 +0000843
Sanjoy Dasfefc4d52016-03-04 18:14:09 +0000844#. The current statepoint lowering is known to be somewhat poor. In the very
845 long term, we'd like to integrate statepoints with the register allocator;
846 in the near term this is unlikely to happen. We've found the quality of
847 lowering to be relatively unimportant as hot-statepoints are almost always
848 inliner bugs.
Philip Reames2e7383c2016-03-03 23:24:44 +0000849
Sanjoy Dasfefc4d52016-03-04 18:14:09 +0000850#. Concerns have been raised that the statepoint representation results in a
851 large amount of IR being produced for some examples and that this
Philip Reames2e7383c2016-03-03 23:24:44 +0000852 contributes to higher than expected memory usage and compile times. There's
Sanjoy Dasfefc4d52016-03-04 18:14:09 +0000853 no immediate plans to make changes due to this, but alternate models may be
Philip Reames2e7383c2016-03-03 23:24:44 +0000854 explored in the future.
855
Sanjoy Dasfefc4d52016-03-04 18:14:09 +0000856#. Relocations along exceptional paths are currently broken in ToT. In
857 particular, there is current no way to represent a rethrow on a path which
858 also has relocations. See `this llvm-dev discussion
859 <https://groups.google.com/forum/#!topic/llvm-dev/AE417XjgxvI>`_ for more
860 detail.
Philip Reames2e7383c2016-03-03 23:24:44 +0000861
Philip Reames83331522014-12-04 18:33:28 +0000862Bugs and Enhancements
863=====================
Philip Reamesdfc238b2015-01-02 19:46:49 +0000864
865Currently known bugs and enhancements under consideration can be
866tracked by performing a `bugzilla search
Ismail Donmezc7ff8142017-02-17 08:26:11 +0000867<https://bugs.llvm.org/buglist.cgi?cmdtype=runnamed&namedcmd=Statepoint%20Bugs&list_id=64342>`_
Philip Reamesdfc238b2015-01-02 19:46:49 +0000868for [Statepoint] in the summary field. When filing new bugs, please
869use this tag so that interested parties see the newly filed bug. As
Tanya Lattner0d28f802015-08-05 03:51:17 +0000870with most LLVM features, design discussions take place on `llvm-dev
871<http://lists.llvm.org/mailman/listinfo/llvm-dev>`_, and patches
Philip Reamesdfc238b2015-01-02 19:46:49 +0000872should be sent to `llvm-commits
Tanya Lattner0d28f802015-08-05 03:51:17 +0000873<http://lists.llvm.org/mailman/listinfo/llvm-commits>`_ for review.
Philip Reames83331522014-12-04 18:33:28 +0000874