<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/compiler/test/Makefile, branch maint-22</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>Add test modules that disable all SSA optimizations</title>
<updated>2019-02-15T09:37:41+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2019-02-15T06:11:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=bce7826854cf0d5dda9f11d8ea9f8920dd0ba7f3'/>
<id>bce7826854cf0d5dda9f11d8ea9f8920dd0ba7f3</id>
<content type='text'>
This makes sure that the SSA optimizations are not essential and
may help to cover more code in beam_ssa_pre_codegen and
beam_ssa_codegen.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes sure that the SSA optimizations are not essential and
may help to cover more code in beam_ssa_pre_codegen and
beam_ssa_codegen.
</pre>
</div>
</content>
</entry>
<entry>
<title>beam_ssa_opt: Add a scaffold for module-level optimizations</title>
<updated>2019-01-24T07:25:28+00:00</updated>
<author>
<name>John Högberg</name>
<email>john@erlang.org</email>
</author>
<published>2019-01-10T16:06:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=1c73a313e72909d054f55e321c1929d2be55ff11'/>
<id>1c73a313e72909d054f55e321c1929d2be55ff11</id>
<content type='text'>
This serves as a base for the upcoming module-level type
optimization, but may come in handy for other passes like
beam_ssa_funs and beam_ssa_bsm that have their own ad-hoc
implementations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This serves as a base for the upcoming module-level type
optimization, but may come in handy for other passes like
beam_ssa_funs and beam_ssa_bsm that have their own ad-hoc
implementations.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix code generation of binary instructions with the r21 option</title>
<updated>2018-09-28T12:33:52+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-09-26T12:11:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=b6f06edde9645bf96a4bc7ebb1e0965fc8b177d6'/>
<id>b6f06edde9645bf96a4bc7ebb1e0965fc8b177d6</id>
<content type='text'>
OTP 22 extends the binary instructions to support a Y register
destination. When giving an option to compile for an earlier
release, make sure that binary instructions don't use a Y register
destination, by rewriting the binary instructions to use an X
register destination and adding a `move` instruction to move
the value to the Y register.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OTP 22 extends the binary instructions to support a Y register
destination. When giving an option to compile for an earlier
release, make sure that binary instructions don't use a Y register
destination, by rewriting the binary instructions to use an X
register destination and adding a `move` instruction to move
the value to the Y register.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve coverage of 21 compatibility</title>
<updated>2018-09-28T09:40:12+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-09-18T12:06:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=f9dcf726661c89c39b2c09932ba0bd5fe8339ae4'/>
<id>f9dcf726661c89c39b2c09932ba0bd5fe8339ae4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce a new SSA-based intermediate format</title>
<updated>2018-08-24T07:57:06+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2018-02-01T07:33:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6bee2ac7d11668888d93ec4f93730bcae3e5fa79'/>
<id>6bee2ac7d11668888d93ec4f93730bcae3e5fa79</id>
<content type='text'>
v3_codegen is replaced by three new passes:

* beam_kernel_to_ssa which translates the Kernel Erlang format
  to a new SSA-based intermediate format.

* beam_ssa_pre_codegen which prepares the SSA-based format
  for code generation, including register allocation. Registers
  are allocated using the linear scan algorithm.

* beam_ssa_codegen which generates BEAM assembly code from the
  SSA-based format.

It easier and more effective to optimize the SSA-based format before X
and Y registers have been assigned.  The current optimization passes
constantly have to make sure no "holes" in the X register assignments
are created (that is, that no X register becomes undefined that an
allocation instruction depends on).

This commit also introduces the following optimizations:

* Replacing of tuple matching of records with the is_tagged_tuple
instruction. (Replacing beam_record.)

* Sinking of get_tuple_element instructions to just before the first
use of the extracted values. As well as potentially avoiding
extracting tuple elements when they are not actually used on all
executions paths, this optimization could also reduce the number
values that will need to be stored in Y registers. (Similar to
beam_reorder, but more effective.)

* Live optimizations, removing the definition of a variable that is
not subsequently used (provided that the operation has no side
effects), as well strength reduction of binary matching by replacing
the extraction of value from a binary with a skip instruction. (Used
to be done by beam_block, beam_utils, and v3_codegen.)

* Removal of redundant bs_restore2 instructions. (Formerly done
by beam_bs.)

* Type-based optimizations across branches. More effective than
the old beam_type pass that only did type-based optimizations in
basic blocks.

* Optimization of floating point instructions. (Formerly done
by beam_type.)

* Optimization of receive statements to introduce recv_mark and
recv_set instructions. More effective with far fewer restrictions
on what instructions are allowed between creating the reference
and entering the receive statement.

* Common subexpression elimination. (Formerly done by beam_block.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
v3_codegen is replaced by three new passes:

* beam_kernel_to_ssa which translates the Kernel Erlang format
  to a new SSA-based intermediate format.

* beam_ssa_pre_codegen which prepares the SSA-based format
  for code generation, including register allocation. Registers
  are allocated using the linear scan algorithm.

* beam_ssa_codegen which generates BEAM assembly code from the
  SSA-based format.

It easier and more effective to optimize the SSA-based format before X
and Y registers have been assigned.  The current optimization passes
constantly have to make sure no "holes" in the X register assignments
are created (that is, that no X register becomes undefined that an
allocation instruction depends on).

This commit also introduces the following optimizations:

* Replacing of tuple matching of records with the is_tagged_tuple
instruction. (Replacing beam_record.)

* Sinking of get_tuple_element instructions to just before the first
use of the extracted values. As well as potentially avoiding
extracting tuple elements when they are not actually used on all
executions paths, this optimization could also reduce the number
values that will need to be stored in Y registers. (Similar to
beam_reorder, but more effective.)

* Live optimizations, removing the definition of a variable that is
not subsequently used (provided that the operation has no side
effects), as well strength reduction of binary matching by replacing
the extraction of value from a binary with a skip instruction. (Used
to be done by beam_block, beam_utils, and v3_codegen.)

* Removal of redundant bs_restore2 instructions. (Formerly done
by beam_bs.)

* Type-based optimizations across branches. More effective than
the old beam_type pass that only did type-based optimizations in
basic blocks.

* Optimization of floating point instructions. (Formerly done
by beam_type.)

* Optimization of receive statements to introduce recv_mark and
recv_set instructions. More effective with far fewer restrictions
on what instructions are allowed between creating the reference
and entering the receive statement.

* Common subexpression elimination. (Formerly done by beam_block.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce a new core pass called sys_core_alias</title>
<updated>2017-07-06T15:07:24+00:00</updated>
<author>
<name>José Valim</name>
<email>jose.valim@plataformatec.com.br</email>
</author>
<published>2016-06-01T16:48:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=d4a27e98cb1c11340b296004d784b15f80d015e9'/>
<id>d4a27e98cb1c11340b296004d784b15f80d015e9</id>
<content type='text'>
The goal of this pass is to find values that are built from
patterns and generate aliases for those values to remove
pressure from the GC. For example, this code:

   example({ok, Val}) -&gt;
       {ok, Val}.

shall become:

   example({ok, Val} = Tuple) -&gt;
       Tuple.

Currently this pass aliases tuple and cons nodes made of literals,
variables and other cons. The tuple/cons may appear anywhere in the
pattern and it will be aliased if used later on.

Notice a tuple/cons made only of literals is not aliased as it may
be part of the literal pool.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The goal of this pass is to find values that are built from
patterns and generate aliases for those values to remove
pressure from the GC. For example, this code:

   example({ok, Val}) -&gt;
       {ok, Val}.

shall become:

   example({ok, Val} = Tuple) -&gt;
       Tuple.

Currently this pass aliases tuple and cons nodes made of literals,
variables and other cons. The tuple/cons may appear anywhere in the
pattern and it will be aliased if used later on.

Notice a tuple/cons made only of literals is not aliased as it may
be part of the literal pool.
</pre>
</div>
</content>
</entry>
<entry>
<title>compiler tests: Eliminate creation of untracked files</title>
<updated>2017-03-21T06:28:48+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2017-03-21T06:28:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=f5d23b7b7146f4375dfefe00b208fdfc360d6bcc'/>
<id>f5d23b7b7146f4375dfefe00b208fdfc360d6bcc</id>
<content type='text'>
Two dummy .erl files are created while releasing the tests for
the compiler.  Remove the files after they have been copied to
the release directory to avoid that they show up as untracked
files in the output of "git status".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two dummy .erl files are created while releasing the tests for
the compiler.  Remove the files after they have been copied to
the release directory to avoid that they show up as untracked
files in the output of "git status".
</pre>
</div>
</content>
</entry>
<entry>
<title>Add test using LFE-generated Core Erlang modules</title>
<updated>2016-11-18T10:58:34+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-10-07T10:46:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=506f0982825f032b404425e777010459e974596f'/>
<id>506f0982825f032b404425e777010459e974596f</id>
<content type='text'>
Ensure that correct (not necessarily optimal) code is generated for
Core Erlang code not originating from v3_core.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure that correct (not necessarily optimal) code is generated for
Core Erlang code not originating from v3_core.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove beam_bool</title>
<updated>2016-11-18T10:58:34+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-10-04T09:00:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=132d61e6f075f8e85da268e88953980c2f348987'/>
<id>132d61e6f075f8e85da268e88953980c2f348987</id>
<content type='text'>
The guard optimizations in v3_kernel has removed the need for
beam_bool.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The guard optimizations in v3_kernel has removed the need for
beam_bool.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix overridden BIFs</title>
<updated>2016-09-02T12:24:36+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-08-15T13:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=0baa07cdf2754748bbc2d969bf83f08c0976fb78'/>
<id>0baa07cdf2754748bbc2d969bf83f08c0976fb78</id>
<content type='text'>
The filters in a list comprehension can be guard expressions or
an ordinary expressions.

If a guard expression is used as a filter, an exception will basically
mean the same as 'false':

  t() -&gt;
    L = [{some_tag,42},an_atom],
    [X || X &lt;- L, element(1, X) =:= some_tag]
    %% Returns [{some_tag,42}]

On the other hand, if an ordinary expression is used as a filter, there
will be an exception:

  my_element(N, T) -&gt; element(N, T).

  t() -&gt;
    L = [{some_tag,42},an_atom],
    [X || X &lt;- L, my_element(1, X) =:= some_tag]
    %% Causes a 'badarg' exception when element(1, an_atom) is evaluated

It has been allowed for several releases to override a BIF with
a local function. Thus, if we define a function called element/2,
it will be called instead of the BIF element/2 within the module.
We must use the "erlang:" prefix to call the BIF.

Therefore, the following code is expected to work the same way as in
our second example above:

-compile({no_auto_import,[element/2]}).

element(N, T) -&gt;
    erlang:element(N, T).

t() -&gt;
    L = [{some_tag,42},an_atom],
    [X || X &lt;- L, element(1, X) =:= some_tag].
    %% Causes a 'badarg' exception when element(1, an_atom) is evaluated

But the compiler refuses to compile the code with the following
diagnostic:

  call to local/imported function element/2 is illegal in guard
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The filters in a list comprehension can be guard expressions or
an ordinary expressions.

If a guard expression is used as a filter, an exception will basically
mean the same as 'false':

  t() -&gt;
    L = [{some_tag,42},an_atom],
    [X || X &lt;- L, element(1, X) =:= some_tag]
    %% Returns [{some_tag,42}]

On the other hand, if an ordinary expression is used as a filter, there
will be an exception:

  my_element(N, T) -&gt; element(N, T).

  t() -&gt;
    L = [{some_tag,42},an_atom],
    [X || X &lt;- L, my_element(1, X) =:= some_tag]
    %% Causes a 'badarg' exception when element(1, an_atom) is evaluated

It has been allowed for several releases to override a BIF with
a local function. Thus, if we define a function called element/2,
it will be called instead of the BIF element/2 within the module.
We must use the "erlang:" prefix to call the BIF.

Therefore, the following code is expected to work the same way as in
our second example above:

-compile({no_auto_import,[element/2]}).

element(N, T) -&gt;
    erlang:element(N, T).

t() -&gt;
    L = [{some_tag,42},an_atom],
    [X || X &lt;- L, element(1, X) =:= some_tag].
    %% Causes a 'badarg' exception when element(1, an_atom) is evaluated

But the compiler refuses to compile the code with the following
diagnostic:

  call to local/imported function element/2 is illegal in guard
</pre>
</div>
</content>
</entry>
</feed>
