summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-11-18 06:23:38 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-11-18 06:23:38 +0000
commit2d16145acfb67c7498cf43a7a3fd04b543a2a767 (patch)
tree74b80d99ba3f29404784d23a813a537859a88549 /llvm/docs
parent9c8904fb3819ecb3cde7882e8b66ad03db4bab1d (diff)
downloadbcm5719-llvm-2d16145acfb67c7498cf43a7a3fd04b543a2a767.tar.gz
bcm5719-llvm-2d16145acfb67c7498cf43a7a3fd04b543a2a767.zip
Teach the inliner to track deoptimization state
Summary: This change teaches LLVM's inliner to track and suitably adjust deoptimization state (tracked via deoptimization operand bundles) as it inlines through call sites. The operation is described in more detail in the LangRef changes. Reviewers: reames, majnemer, chandlerc, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14552 llvm-svn: 253438
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/LangRef.rst40
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index b1a92dc0ebd..cafc208ba8d 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -1509,6 +1509,46 @@ operand bundles do not capture their operands except during
deoptimization, in which case control will not be returned to the
compiled frame.
+The inliner knows how to inline through calls that have deoptimization
+operand bundles. Just like inlining through a normal call site
+involves composing the normal and exceptional continuations, inlining
+through a call site with a deoptimization operand bundle needs to
+appropriately compose the "safe" deoptimization continuation. The
+inliner does this by prepending the parent's deoptimization
+continuation to every deoptimization continuation in the inlined body.
+E.g. inlining ``@f`` into ``@g`` in the following example
+
+.. code-block:: llvm
+
+ define void @f() {
+ call void @x() ;; no deopt state
+ call void @y() [ "deopt"(i32 10) ]
+ call void @y() [ "deopt"(i32 10), "unknown"(i8* null) ]
+ ret void
+ }
+
+ define void @g() {
+ call void @f() [ "deopt"(i32 20) ]
+ ret void
+ }
+
+will result in
+
+.. code-block:: llvm
+
+ define void @g() {
+ call void @x() ;; still no deopt state
+ call void @y() [ "deopt"(i32 20, i32 10) ]
+ call void @y() [ "deopt"(i32 20, i32 10), "unknown"(i8* null) ]
+ ret void
+ }
+
+It is the frontend's responsibility to structure or encode the
+deoptimization state in a way that syntactically prepending the
+caller's deoptimization state to the callee's deoptimization state is
+semantically equivalent to composing the caller's deoptimization
+continuation after the callee's deoptimization continuation.
+
.. _moduleasm:
Module-Level Inline Assembly
OpenPOWER on IntegriCloud