| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |\ \ \ \ \
| | | |_|_|/
| | |/| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
into maint
* john/erts/fix-hd-tl-loader-transformations/GH-7024/OTP-18519:
jit: Fix hd/1 and tl/1 BIF specialization
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | | |
While we're at it, remove related loader transformations that
only kicks in for unoptimized code.
|
| | | | |
| | | | |
| | | | |
| | | | | |
This reverts commit 1cf126f91eb533783409da95b117207d8c13d9aa.
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* john/compiler/inline-maps-get-3/OTP-18502:
sys_core_fold: Fix rewriting complex dynamic keys on maps:get/3
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| / / / /
| |/ / / /
| | | | | |
* maint:
beam_validator: Skip unnecessary type updates
|
| |\ \ \ \
| | | |_|/
| | |/| |
| | | | |
| | | | | |
* john/compiler/fix-inert-update-type/GH-6969/OTP-18516:
beam_validator: Skip unnecessary type updates
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
sys_core_fold: Inline maps:get/3
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When 0bac830c937c7c39b6aae37a73bd135841dde969 was created, the element
forms to be considered were taken from patch_literal_term/3. As the
tuple_elements-form is only created after the tracking phase, it will
never be encountered in get_results/5. Likewise the Element variable
is never a list, as it is generated by patch_appends_ret/3
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In the private append pass we track values which could be bitstrings
or a term containing a bitstring to find the operation where the
bitstring is constructed. For the purpose of this description, we call
such a value a potential bitstring.
As tracking potential bitstrings is done without correlating type
checks and flow-control, we can sometimes encounter values which are
not potential bitstrings. In 0bac830c937c7c39b6aae37a73bd135841dde969
the tracking logic was refined to abort as soon as we detected that a
returned literal could not be on an execution path returning a
potential bitstring. This commit extends the tracking logic to abort
tracking when a potential bitstring is constructed by an operation
which cannot produce a bitstring or a term containing a bitstring.
Closes #7011
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Tracking values to patch into writable binaries in the private append
pass doesn't make any attempt to use type information to exclude
execution paths not relevant when tracking an appendable binary. In
order to avoid later failed attempts to rewrite non-bitstring literals
into bs_init_writable-created values during the rewrite phase, we
change the tracking phase to preemptively abort tracking as soon as we
detect that the element we are tracking can't apply to the literal.
Closes #6999
|
|\ \ \ \ \ \
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | | |
* maint:
Fix lost exception from map update
|
| |\ \ \ \ \
| | |_|_|/ /
| |/| | | /
| | | |_|/
| | |/| | |
bjorng/bjorn/compiler/fix-lost-map-exception/GH-6960/OTP-18497
Fix lost exception from map update
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fix an unsafe optimization that would remove a map update operation
that is supposed fail. For example:
foo() ->
#{}#{key := value},
ok.
Instead of raising an exception, `foo/0` would return `ok`.
Closes #6960
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Eliminate assertion failure in beam_ssa_codegen
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If the code in `?EXCEPTION_BLOCK` is modified in any way, the
`beam_ssa_codegen:assert_exception_block/1` function will cause an
internal compiler error. Ensure that the literal unfolding
optimization in `beam_ssa_opt` will not modify the code in
`?EXCEPTION_BLOCK`.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
compiler: Use map comprehensions instead of maps:filter/2
|
| | | | | | |
|
| |/ / / / |
|
|\ \ \ \ \
| |/ / / /
|/| / / /
| |/ / /
| | | |
| | | |
| | | | |
* maint:
Updated OTP version
Prepare release
Update copyright year
|
| | | | |
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | | |
beam_validator: Fix inference on singleton types in registers
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Type inference with singleton types in registers was weaker than
inference on their corresponding literals.
|
|\ \ \ \
| | | | |
| | | | | |
compiler: Cache use/def sets in alias analysis pass
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Reduce the cost of the alias analysis pass by hoisting the calculation
of use and def sets out of the liveness fixpoint iteration using a
cache. On the modules compiled by `scripts/diffable` the time spent in
the alias analysis pass is reduced by 16%.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Consider this code:
-module(t).
-export([foo/0, bar/4]).
foo() ->
bar(ok, 0 div 0, node(), [-1]).
bar(_, _, _, _) -> ok.
It fails to compile when some optimizations are turned off:
$ erlc +no_copt +no_ssa_opt t.erl
t:1: function foo/0+7:
Internal consistency check failed - please report this bug.
Instruction: {test_heap,2,2}
Error: {{x,0},not_live}:
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
beam_call_types: Fix inconsistency
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The `beam_validator` pass would reject the following code:
f(X) ->
element(42,
case X of
{_,_} -> X;
_ -> ok
end).
The reason is an inconsistency between the return values of the
functions `will_succeed/3` and `types/3` in the `beam_call_types`
module. When `types/3` returns `none` (indicating that the call
always fails), `will_succeed/3` MUST return `no`. Otherwise,
`beam_validator` will reject the code.
In this case, when asked whether the call to `element/2` would
succeed, `will_succeed/3` answered `maybe`, while `types/3`
returned `none`.
To avoid similar bugs in the future, this commit not only fixes the
inconsistency, but also refactors `will_succeed/3` to always let the
new helper function `fails_on_conflict/3` handle the `maybe` case,
ensuring that whenever `types/3` returns `none`, then `will_succeed/3`
returns `no`.
Closes #6927
Co-authored-by: John Högberg <john@erlang.org>
|
|\ \ \ \
| | | | |
| | | | | |
compiler: Avoid unsafe rewrite to bs_create_bin private_append
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Nick Vatamaniuc reported that the following Erlang snippet:
```
B1 = << <<"x">> || true >>,
B2 = <<B1/binary, "z">>,
```
created identical `B1` and `B2` binaries. The error occurs because the
private-append pass was missing the condition that for a transform
from `bs_create_bin append, ...` to `bs_create_bin private_append,
...` to be safe, the first fragment must die with the `bs_create_bin`
instruction, it is not enough that the fragment is unique and
appendable.
The error is avoided by having the alias analysis, which has access to
liveness information, annotate `bs_create_bin` instructions with a
boolean annotation indicating whether the first fragment dies with the
instruction. The later private-append pass can then consult the
annotation to determine if the transform is safe. The use of an
annotation is more efficient than trying to reconstruct the
information in the alias analysis kill map during the private-append
pass.
Fixes #6925
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When compiling generated code from forms where the line numbers in the
annotations did not correspond to the actual order of the clauses, the
compiler could rearrange clauses even when it was not safe. For
example:
match_route([<<"prefix">>, <<"action">>]) -> first; %Line 4
match_route([<<"prefix">>, _Ignore]) -> second. %Line 2
The compiler would rearrange that to:
match_route([<<"prefix">>, _Ignore]) -> second; %Line 2
match_route([<<"prefix">>, <<"action">>]) -> first. %Line 4
which would make the second clause (former first clause) unreachable.
This bug was introduced in cadd19e84478ed (#6538).
Closes #6923
|
| | |
| | |
| | |
| | | |
Remove unused variables and debug code, no functional change.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Avoid repeatedly traversing functions which are not directly
influenced by changes in the alias information while iterating to find
a fix point during alias analysis.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
During alias analysis the main data flow of alias information is from
caller to callee when the aliasing status of function arguments are
transferred. A smaller flow goes from the callee to the caller with
the information about the returned value.
As up to date alias status is needed at call sites (derived from the
status of the caller's own arguments) and the status recorded at all
callsites is what allows the analysis of the callee to provide a
status for the returned result in the caller, convergence of the alias
analysis can be greatly sped up by traversing the call graph breadth
first.
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | | |
* maint:
Updated OTP version
Prepare release
Update copyright year
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* maint-24:
Updated OTP version
Prepare release
Update copyright year
|
| | | | |
|
| | | | |
|
| | |\ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
into maint-24
* bjorn/compiler/fix-mutable-variables/24/GH-6873/OTP-18470:
Eliminate "mutable variables"
|
|\ \ \ \ \
| | | | | |
| | | | | | |
compiler: Improve code coverage in alias analysis
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add a test case which exercises the portions of the alias analysis
which deals with a non-converging fixpoint iteration.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
compiler: Fix mishandling of make_fun in alias analysis
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When a value is copied into the environment of a fun, alias analysis
should assume that it has been aliased as there is no obvious way to
track and ensure that the value is only used once, even if the
argument dies at the location of the make_fun.
Closes #6890
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
beam_call_types: Infer range of various arithmetic operations
|