-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8621 from frej/frej/use-types-for-destructive-update
Use type information to improve destructive update pass
- Loading branch information
Showing
9 changed files
with
261 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
lib/compiler/test/beam_ssa_check_SUITE_data/tuple_inplace_abort2.erl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
%% %CopyrightBegin% | ||
%% | ||
%% Copyright Ericsson AB 2024. All Rights Reserved. | ||
%% | ||
%% Licensed under the Apache License, Version 2.0 (the "License"); | ||
%% you may not use this file except in compliance with the License. | ||
%% You may obtain a copy of the License at | ||
%% | ||
%% http://www.apache.org/licenses/LICENSE-2.0 | ||
%% | ||
%% Unless required by applicable law or agreed to in writing, software | ||
%% distributed under the License is distributed on an "AS IS" BASIS, | ||
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
%% See the License for the specific language governing permissions and | ||
%% limitations under the License. | ||
%% | ||
%% %CopyrightEnd% | ||
%% | ||
%% Check that the compiler doesn't enter an infinite loop while trying | ||
%% to run the destructive update pass. | ||
%% | ||
-module(tuple_inplace_abort2). | ||
|
||
-export([f0/0,f1/0,f2/0]). | ||
|
||
-record(rec, {a, b = ext:ernal()}). | ||
|
||
f0() -> | ||
g([#rec{}]). | ||
|
||
f1() -> | ||
g({#rec{}}). | ||
|
||
f2() -> | ||
g([[{#rec{}}]]). | ||
|
||
g([A]) -> | ||
g(A); | ||
g({A}) -> | ||
g(A); | ||
g(#rec{} = A) -> | ||
%ssa% (_) when post_ssa_opt -> | ||
%ssa% _ = update_record(reuse, 3, ...). | ||
A#rec{ a = a }. |
49 changes: 49 additions & 0 deletions
49
lib/compiler/test/beam_ssa_check_SUITE_data/tuple_inplace_abort3.erl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
%% %CopyrightBegin% | ||
%% | ||
%% Copyright Ericsson AB 2024. All Rights Reserved. | ||
%% | ||
%% Licensed under the Apache License, Version 2.0 (the "License"); | ||
%% you may not use this file except in compliance with the License. | ||
%% You may obtain a copy of the License at | ||
%% | ||
%% http://www.apache.org/licenses/LICENSE-2.0 | ||
%% | ||
%% Unless required by applicable law or agreed to in writing, software | ||
%% distributed under the License is distributed on an "AS IS" BASIS, | ||
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
%% See the License for the specific language governing permissions and | ||
%% limitations under the License. | ||
%% | ||
%% %CopyrightEnd% | ||
%% | ||
%% Check that the compiler doesn't enter an infinite loop while trying | ||
%% to run the destructive update pass. | ||
%% | ||
-module(tuple_inplace_abort3). | ||
|
||
-export([f0/0,f1/0,f2/0,f3/0]). | ||
|
||
-record(rec, {a, b = ext:ernal()}). | ||
|
||
f0() -> | ||
g([#rec{}]). | ||
|
||
f1() -> | ||
g({#rec{}}). | ||
|
||
f2() -> | ||
g([[{#rec{}}]]). | ||
|
||
f3() -> | ||
g([[[#rec{}]]]). | ||
|
||
g({A}) -> | ||
g(A); | ||
g([[A]]) -> | ||
g(A); | ||
g([A]) -> | ||
g(A); | ||
g(#rec{} = A) -> | ||
%ssa% (_) when post_ssa_opt -> | ||
%ssa% _ = update_record(reuse, 3, ...). | ||
A#rec{ a = a }. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters