aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-04-19 07:29:54 +0200
committerBjörn Gustavsson <[email protected]>2010-04-19 07:39:38 +0200
commite965d90b5fe84fcb519ab8a8d41f7c0acb4c4c68 (patch)
treedcc9df7e56536d8f2b5ede7c77a56b8c2e696e12 /lib/compiler/src
parentf39289291f9fcbb7b813584edb7d465e480be212 (diff)
downloadotp-e965d90b5fe84fcb519ab8a8d41f7c0acb4c4c68.tar.gz
otp-e965d90b5fe84fcb519ab8a8d41f7c0acb4c4c68.tar.bz2
otp-e965d90b5fe84fcb519ab8a8d41f7c0acb4c4c68.zip
beam_type: Improve coalescing of fmove/2 and move/2 instructions
The following instruction sequence: fmove {fr,Fr} {x,TempXreg} move {x,TempXreg} {y,Dest} is rewritten to: fmove {fr,Fr} {y,Dest} (Provided that {x,TempXreg} is killed by the instructions following the sequence.) Generalize the optimization to also handle: fmove {fr,Fr} {x,TempXreg} move {x,TempXreg} {_,Dest} That is, the destination register can be either an X or Y register.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/beam_type.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index 66c8816409..3729ccb0da 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -183,7 +183,7 @@ simplify_float_1([], Ts, Rs, Acc0) ->
{Is,Ts}.
opt_fmoves([{set,[{x,_}=R],[{fr,_}]=Src,fmove}=I1,
- {set,[{y,_}]=Dst,[{x,_}=R],move}=I2|Is], Acc) ->
+ {set,[_]=Dst,[{x,_}=R],move}=I2|Is], Acc) ->
case beam_utils:is_killed_block(R, Is) of
false -> opt_fmoves(Is, [I2,I1|Acc]);
true -> opt_fmoves(Is, [{set,Dst,Src,fmove}|Acc])