<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/compiler/src/Makefile, branch KennethL-patch-1</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>Update copyright year</title>
<updated>2017-06-14T13:36:21+00:00</updated>
<author>
<name>Hans Nilsson</name>
<email>hans@erlang.org</email>
</author>
<published>2017-06-14T13:36:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=43718d3b81d7f3d08e25047e22d579801bbe5044'/>
<id>43718d3b81d7f3d08e25047e22d579801bbe5044</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix unsafe bit syntax matching optimization</title>
<updated>2017-06-07T14:32:35+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2017-06-07T12:27:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=09112806c15a81be86730503af36e304ac11d1ed'/>
<id>09112806c15a81be86730503af36e304ac11d1ed</id>
<content type='text'>
As part of sys_core_fold, variables involved in bit syntax
matching would be annotated when it would be safe for a later
pass to do the delayed sub-binary creation optimization.

An implicit assumption regarding the annotation was that the
code must not be further optimized. That assumption was broken
in 05130e48555891, which introduced a fixpoint iteration
(applying the optimizations until there were no more changes).
That means that a variable could be annotated as safe for
reusing the match context in one iteration, but a later iteration
could rewrite the code in a way that would make the optimization
unsafe.

One way to fix this would be to clear all reuse_for_context
annotations before each iteration. But that would be wasteful.

Instead I chose to fix the problem by moving out the annotation
code to a separate pass (sys_core_bsm) that is run later after
all major optimizations of Core Erlang has been done.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As part of sys_core_fold, variables involved in bit syntax
matching would be annotated when it would be safe for a later
pass to do the delayed sub-binary creation optimization.

An implicit assumption regarding the annotation was that the
code must not be further optimized. That assumption was broken
in 05130e48555891, which introduced a fixpoint iteration
(applying the optimizations until there were no more changes).
That means that a variable could be annotated as safe for
reusing the match context in one iteration, but a later iteration
could rewrite the code in a way that would make the optimization
unsafe.

One way to fix this would be to clear all reuse_for_context
annotations before each iteration. But that would be wasteful.

Instead I chose to fix the problem by moving out the annotation
code to a separate pass (sys_core_bsm) that is run later after
all major optimizations of Core Erlang has been done.
</pre>
</div>
</content>
</entry>
<entry>
<title>compiler: Add is_tagged_tuple instruction</title>
<updated>2017-03-24T09:53:14+00:00</updated>
<author>
<name>Björn-Egil Dahlberg</name>
<email>egil@erlang.org</email>
</author>
<published>2014-08-29T16:27:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=14d709b0e07e899161a40bb43fc43fd6916f59ab'/>
<id>14d709b0e07e899161a40bb43fc43fd6916f59ab</id>
<content type='text'>
Rewrite the instruction stream on tagged tuple tests.
Tagged tuples means a tuple of any arity with an atom as its first element.
Typically records, ok-tuples and error-tuples.

from:
    ...
    {test,is_tuple,Fail,[Src]}.
    {test,test_arity,Fail,[Src,Sz]}.
    ...
    {get_tuple_element,Src,0,Dst}.
    ...
    {test,is_eq_exact,Fail,[Dst,Atom]}.
    ...
to:
    ...
    {test,is_tagged_tuple,Fail,[Src,Sz,Atom]}.
    ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rewrite the instruction stream on tagged tuple tests.
Tagged tuples means a tuple of any arity with an atom as its first element.
Typically records, ok-tuples and error-tuples.

from:
    ...
    {test,is_tuple,Fail,[Src]}.
    {test,test_arity,Fail,[Src,Sz]}.
    ...
    {get_tuple_element,Src,0,Dst}.
    ...
    {test,is_eq_exact,Fail,[Dst,Atom]}.
    ...
to:
    ...
    {test,is_tagged_tuple,Fail,[Src,Sz,Atom]}.
    ...
</pre>
</div>
</content>
</entry>
<entry>
<title>Makefile: Warn for missings spec</title>
<updated>2017-01-12T11:10:12+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-12-15T08:26:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=4efd9935a5618fa6622e33eadb3d6add49ab1089'/>
<id>4efd9935a5618fa6622e33eadb3d6add49ab1089</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>Remove sys_pre_expand</title>
<updated>2016-09-01T13:16:03+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2016-08-30T06:01:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6ba91ac62a8cffd9ea274ce8b9023abbcb8d9b67'/>
<id>6ba91ac62a8cffd9ea274ce8b9023abbcb8d9b67</id>
<content type='text'>
The previous commits have made sys_pre_expand superfluous. Since
sys_pre_expand is undocumented and unsupported it can be removed in
a major release without prior deprecation.

Also remove code in erl_parse that handles abstract code that has
passed through sys_pre_expand.

We considered deprecating sys_pre_expand just in case, but decided
against it for the following reasons:

- Anyone brave and knowledgeable enough to use sys_pre_expand should
be able to cope with sys_pre_expand being removed.

- If we kept it, but didn't test it anywhere in OTP, it could
potentially stop working. So we would probably have to add some test
cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The previous commits have made sys_pre_expand superfluous. Since
sys_pre_expand is undocumented and unsupported it can be removed in
a major release without prior deprecation.

Also remove code in erl_parse that handles abstract code that has
passed through sys_pre_expand.

We considered deprecating sys_pre_expand just in case, but decided
against it for the following reasons:

- Anyone brave and knowledgeable enough to use sys_pre_expand should
be able to cope with sys_pre_expand being removed.

- If we kept it, but didn't test it anywhere in OTP, it could
potentially stop working. So we would probably have to add some test
cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>update copyright-year</title>
<updated>2016-03-15T14:19:56+00:00</updated>
<author>
<name>Henrik Nord</name>
<email>henrik@erlang.org</email>
</author>
<published>2016-03-15T14:19:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6664eed554974336909d3ffe03f20349cc4c38fd'/>
<id>6664eed554974336909d3ffe03f20349cc4c38fd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Move out bit syntax optimizations from beam_block</title>
<updated>2015-09-28T08:26:39+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2015-09-21T12:27:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=8372f56a06ef24cf4455a54e15d876ab6ca8c570'/>
<id>8372f56a06ef24cf4455a54e15d876ab6ca8c570</id>
<content type='text'>
In the future we might want to add more bit syntax optimizations,
but beam_block is already sufficiently complicated. Therefore, move
the bit syntax optimizations out of beam_block into a separate
compiler pass called beam_bs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the future we might want to add more bit syntax optimizations,
but beam_block is already sufficiently complicated. Therefore, move
the bit syntax optimizations out of beam_block into a separate
compiler pass called beam_bs.
</pre>
</div>
</content>
</entry>
<entry>
<title>Delay get_tuple_element instructions until they are needed</title>
<updated>2015-08-21T13:55:35+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2015-07-07T08:45:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=c288ab87fd6cafe22ce46be551baa2e815b495b0'/>
<id>c288ab87fd6cafe22ce46be551baa2e815b495b0</id>
<content type='text'>
When matching tuples, the pattern matching compiler would generate
code that would fetch all elements of the tuple that will ultimately
be used, *before* testing that (for example) the first element is the
correct record tag. For example:

  is_tuple Fail {x,0}
  test_arity Fail {x,0} 3
  get_tuple_element {x,0} 0 {x,1}
  get_tuple_element {x,0} 1 {x,2}
  get_tuple_element {x,0} 2 {x,3}
  is_eq_exact Fail {x,1} some_tag

If {x,2} and {x,3} are not used at label Fail, we can re-arrange the
code like this:

  is_tuple Fail {x,0}
  test_arity Fail {x,0} 3
  get_tuple_element {x,0} 0 {x,1}
  is_eq_exact Fail {x,1} some_tag
  get_tuple_element {x,0} 1 {x,2}
  get_tuple_element {x,0} 2 {x,3}

Doing that may be beneficial in two ways.

If the branch is taken, we have eliminated the execution of two
unnecessary instructions.

Even if the branch is never or rarely taken, there is the possibility
for more optimizations following the is_eq_exact instructions.
For example, imagine that the code looks like this:

  get_tuple_element {x,0} 1 {x,2}
  get_tuple_element {x,0} 2 {x,3}
  move {x,2} {y,0}
  move {x,3} {y,1}

Assuming that {x,2} and {x,3} have no further uses in the code
that follows, that can be rewritten to:

  get_tuple_element {x,0} 1 {y,0}
  get_tuple_element {x,0} 2 {y,1}

When should we perform this optimization?

At the very latest, it must be done before opt_blocks/1 in
beam_block which does the elimination of unnecessary moves.
Actually, we want do the optimization before the blocks have
been established, since moving instructions out of one block
into another is cumbersome.

Therefore, we will do the optimization in a new pass that is
run before beam_block. A new pass will make debugging easier,
and beam_block already has a fair number of sub passes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When matching tuples, the pattern matching compiler would generate
code that would fetch all elements of the tuple that will ultimately
be used, *before* testing that (for example) the first element is the
correct record tag. For example:

  is_tuple Fail {x,0}
  test_arity Fail {x,0} 3
  get_tuple_element {x,0} 0 {x,1}
  get_tuple_element {x,0} 1 {x,2}
  get_tuple_element {x,0} 2 {x,3}
  is_eq_exact Fail {x,1} some_tag

If {x,2} and {x,3} are not used at label Fail, we can re-arrange the
code like this:

  is_tuple Fail {x,0}
  test_arity Fail {x,0} 3
  get_tuple_element {x,0} 0 {x,1}
  is_eq_exact Fail {x,1} some_tag
  get_tuple_element {x,0} 1 {x,2}
  get_tuple_element {x,0} 2 {x,3}

Doing that may be beneficial in two ways.

If the branch is taken, we have eliminated the execution of two
unnecessary instructions.

Even if the branch is never or rarely taken, there is the possibility
for more optimizations following the is_eq_exact instructions.
For example, imagine that the code looks like this:

  get_tuple_element {x,0} 1 {x,2}
  get_tuple_element {x,0} 2 {x,3}
  move {x,2} {y,0}
  move {x,3} {y,1}

Assuming that {x,2} and {x,3} have no further uses in the code
that follows, that can be rewritten to:

  get_tuple_element {x,0} 1 {y,0}
  get_tuple_element {x,0} 2 {y,1}

When should we perform this optimization?

At the very latest, it must be done before opt_blocks/1 in
beam_block which does the elimination of unnecessary moves.
Actually, we want do the optimization before the blocks have
been established, since moving instructions out of one block
into another is cumbersome.

Therefore, we will do the optimization in a new pass that is
run before beam_block. A new pass will make debugging easier,
and beam_block already has a fair number of sub passes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change license text to APLv2</title>
<updated>2015-06-18T09:31:02+00:00</updated>
<author>
<name>Bruce Yinhe</name>
<email>bruce@erlang.org</email>
</author>
<published>2015-06-18T09:31:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=738c34d4bb8f1a3811acd00af8c6c12107f8315b'/>
<id>738c34d4bb8f1a3811acd00af8c6c12107f8315b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
