mirror of
https://github.com/anoma/juvix.git
synced 2024-09-11 16:26:33 +03:00
Inline immediate values (#2842)
* Closes #2745 * Adds inlining of immediate values, i.e., values that don't require computation or memory allocation. * Non-immediate zero-argument functions / values should not be inlined, because when not inlined they can be computed only once.
This commit is contained in:
parent
a5cd3c9aa9
commit
af758cc8ad
@ -55,7 +55,13 @@ convertNode inlineDepth recSyms md = dmapL go
|
||||
Just InlineFullyApplied | argsNum == 0 -> def
|
||||
Just (InlinePartiallyApplied 0) -> def
|
||||
Just InlineAlways -> def
|
||||
_ -> node
|
||||
Just InlineNever -> node
|
||||
_
|
||||
| not (HashSet.member _identSymbol recSyms)
|
||||
&& isImmediate md def ->
|
||||
def
|
||||
| otherwise ->
|
||||
node
|
||||
where
|
||||
ii = lookupIdentifierInfo md _identSymbol
|
||||
pi = ii ^. identifierPragmas . pragmasInline
|
||||
|
Loading…
Reference in New Issue
Block a user