diff options
author | Björn Gustavsson <[email protected]> | 2012-04-01 09:28:34 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-07-06 13:37:55 +0200 |
commit | 6d6fce257cf666113e982c0887121739dff5bf1d (patch) | |
tree | b4aae4f7dd73aefb4c50faba2d2bb5de87ae75ef /erts/emulator/utils | |
parent | fad052472def54fff1268b21313b15bd666437c3 (diff) | |
download | otp-6d6fce257cf666113e982c0887121739dff5bf1d.tar.gz otp-6d6fce257cf666113e982c0887121739dff5bf1d.tar.bz2 otp-6d6fce257cf666113e982c0887121739dff5bf1d.zip |
Eliminate prefetch for conditional instructions
Not pre-fetching in conditional instructions (instructions that use
-fail_action) seems to improve performance slightly.
The reason for that is that conditional instructions may jump to the
failure label, wasting the pre-fetched instruction. Another reason
is that that many conditional instructions do a function call, and
the register pressure is therefore high. Avoiding the pre-fetch
may reduce the register pressure and pontentially result in more
efficient code.
Diffstat (limited to 'erts/emulator/utils')
-rwxr-xr-x | erts/emulator/utils/beam_makeops | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 44977ecffc..06515c6346 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -917,6 +917,7 @@ sub basic_generator { my($var_decls) = ''; my($gen_dest_arg) = 'StoreSimpleDest'; my($i); + my($no_prefetch) = 0; # The following argument types should be included as macro arguments. my(%incl_arg) = ('c' => 1, @@ -1015,6 +1016,7 @@ sub basic_generator { # $flags =~ /-fail_action/ and do { + $no_prefetch = 1; if (!defined $fail_type) { my($i); for ($i = 0; $i < @f_types; $i++) { @@ -1061,6 +1063,12 @@ sub basic_generator { "I += $size + 1;", "goto $goto;", "}"); + } elsif ($no_prefetch) { + $code = join("\n", + "{ $var_decls", + $macro_code, + "Next($size);", + "}", ""); } else { $code = join("\n", "{ $var_decls", |