From 5153e6840b09706dd87397ad116c8876b3df6793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 8 Jan 2019 15:47:46 +0100 Subject: 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. --- lib/compiler/src/beam_ssa_pre_codegen.erl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/compiler/src') 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; -- cgit v1.2.3