aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-05-14 10:11:31 +0200
committerBjörn Gustavsson <[email protected]>2019-05-22 10:47:22 +0200
commit18dc9a8099d1ad8f52b9db7bd251bcbfd632ce5e (patch)
treecb7d2a6d3620c53cc098a2cb863bd3adf9427d0c /lib/compiler/test
parentfe2b1323a3866ed0a9712e9d12e1f8f84793ec47 (diff)
downloadotp-18dc9a8099d1ad8f52b9db7bd251bcbfd632ce5e.tar.gz
otp-18dc9a8099d1ad8f52b9db7bd251bcbfd632ce5e.tar.bz2
otp-18dc9a8099d1ad8f52b9db7bd251bcbfd632ce5e.zip
Make the swap instruction known to the compiler
BEAM has had a `swap` instruction for several releases, but it was not known to the compiler. The loader would translate a sequence of three `move` instructions to the `swap` instructions, but only when it was possible to determine that it would be safe. By making `swap` known to the compiler, it can be applied in more situations since it is easier for the compiler than for the loader to ensure that the usage is safe, and the loader shenanigans can be eliminated.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/compile_SUITE.erl7
-rw-r--r--lib/compiler/test/test_lib.erl1
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index 53627b9d81..a33593c507 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -1411,8 +1411,13 @@ bc_options(Config) ->
{158, small_maps, [r20]},
{158, small_maps, [r21]},
+ {164, small_maps, [r22]},
+ {164, big, [r22]},
{164, small_maps, []},
- {164, big, []}
+ {164, big, []},
+
+ {168, small, [r22]},
+ {168, small, []}
],
Test = fun({Expected,Mod,Options}) ->
diff --git a/lib/compiler/test/test_lib.erl b/lib/compiler/test/test_lib.erl
index 3348c6e9ea..98210a351c 100644
--- a/lib/compiler/test/test_lib.erl
+++ b/lib/compiler/test/test_lib.erl
@@ -82,6 +82,7 @@ opt_opts(Mod) ->
(no_ssa_float) -> true;
(no_ssa_opt) -> true;
(no_stack_trimming) -> true;
+ (no_swap) -> true;
(no_type_opt) -> true;
(_) -> false
end, Opts).