aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa_pre_codegen.erl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-02-06 10:31:08 +0100
committerGitHub <[email protected]>2019-02-06 10:31:08 +0100
commit9050bb9443006e94384875efd7036ad216e45530 (patch)
tree9c51db3a0e79af9b77b748f55b6da3f73d281d6d /lib/compiler/src/beam_ssa_pre_codegen.erl
parentc44caa428b65e85b034b01a7f6145e5fee60a863 (diff)
parent4f8026dabf5bd81f1dad085024e2b0623e5706f4 (diff)
downloadotp-9050bb9443006e94384875efd7036ad216e45530.tar.gz
otp-9050bb9443006e94384875efd7036ad216e45530.tar.bz2
otp-9050bb9443006e94384875efd7036ad216e45530.zip
Merge pull request #2132 from jhogberg/john/compiler/tuple-element-types
Keep track of tuple elements in type optimization pass
Diffstat (limited to 'lib/compiler/src/beam_ssa_pre_codegen.erl')
-rw-r--r--lib/compiler/src/beam_ssa_pre_codegen.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl
index 274f78052d..ad57a45ef2 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -1993,11 +1993,12 @@ reserve_zregs(Blocks, Intervals, Res) ->
end,
beam_ssa:fold_rpo(F, [0], Res, Blocks).
-reserve_zreg([#b_set{op=call,dst=Dst}],
- #b_br{bool=Dst}, _ShortLived, A) ->
- %% If type optimization has determined that the result of a call can be
- %% used directly in a branch, we must avoid reserving a z register or code
- %% generation will fail.
+reserve_zreg([#b_set{op=Op,dst=Dst}],
+ #b_br{bool=Dst}, _ShortLived, A) when Op =:= call;
+ Op =:= get_tuple_element ->
+ %% If type optimization has determined that the result of these
+ %% instructions can be used directly in a branch, we must avoid reserving a
+ %% z register or code generation will fail.
A;
reserve_zreg([#b_set{op={bif,tuple_size},dst=Dst},
#b_set{op={bif,'=:='},args=[Dst,Val]}], Last, ShortLived, A0) ->