Skip to content
Snippets Groups Projects
Commit fcc3ae6e authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Marge Bot
Browse files

Clarify INLINE unfolding optimization docs.

Fixes #24660
parent 9279619f
No related branches found
No related tags found
No related merge requests found
......@@ -393,12 +393,15 @@ has a number of other effects:
pragmas is to expose functions in ``f``\'s RHS that have rewrite
rules, and it's no good if those functions have been optimised away.
So *GHC guarantees to inline precisely the code that you wrote*, no
more and no less. It does this by capturing a copy of the definition
So *GHC guarantees to behave precisely as if it inlined the code that you wrote*.
It does this by capturing a copy of the definition
of the function to use for inlining (we call this the "inline-RHS"),
which it leaves untouched, while optimising the ordinarily RHS as
usual. For externally-visible functions the inline-RHS (not the
optimised RHS) is recorded in the interface file.
which it only optimizes in ways which don't break this promise.
For example if inlining is explicitly delayed through phase control GHC will
apply optimizations which happen before the ``INLINE`` pragma becomes
active to the inline-RHS while optimising the ordinarily RHS as usual.
For externally-visible functions
the inline-RHS (not the optimised RHS) is recorded in the interface file.
- An ``INLINE`` function is not worker/wrappered by strictness analysis.
It's going to be inlined wholesale instead.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment