aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa_pre_codegen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-01-08 15:47:46 +0100
committerBjörn Gustavsson <[email protected]>2019-01-11 15:05:11 +0100
commit5153e6840b09706dd87397ad116c8876b3df6793 (patch)
treea54180c537a998c70d7c2d2f6e4a13150d1c722d /lib/compiler/src/beam_ssa_pre_codegen.erl
parent114ed6f86c8ab9b6a3dbaebe596934bc49e45b7a (diff)
downloadotp-5153e6840b09706dd87397ad116c8876b3df6793.tar.gz
otp-5153e6840b09706dd87397ad116c8876b3df6793.tar.bz2
otp-5153e6840b09706dd87397ad116c8876b3df6793.zip
beam_ssa_pre_codegen: Don't use z registers for 'xor' and 'is_record'
There is no easy way to convert xor or is_record/2 to test operations.
Diffstat (limited to 'lib/compiler/src/beam_ssa_pre_codegen.erl')
-rw-r--r--lib/compiler/src/beam_ssa_pre_codegen.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl
index b940c0fdc2..fa1b7bb71e 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -2008,6 +2008,14 @@ reserve_zreg([#b_set{op={bif,tuple_size},dst=Dst},
reserve_zreg([#b_set{op={bif,tuple_size},dst=Dst}],
#b_switch{}, ShortLived, A) ->
reserve_zreg_1(Dst, ShortLived, A);
+reserve_zreg([#b_set{op={bif,'xor'}}], _Last, _ShortLived, A) ->
+ %% There is no short, easy way to rewrite 'xor' to a series of
+ %% test instructions.
+ A;
+reserve_zreg([#b_set{op={bif,is_record}}], _Last, _ShortLived, A) ->
+ %% There is no short, easy way to rewrite is_record/2 to a series of
+ %% test instructions.
+ A;
reserve_zreg([#b_set{op=Op,dst=Dst}|Is], Last, ShortLived, A0) ->
IsZReg = case Op of
bs_match_string -> true;