diff options
author | Sverker Eriksson <sverker@erlang.org> | 2016-11-22 12:02:07 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2016-11-22 12:02:07 +0100 |
commit | 3d7b55f946162b5a129241dbe67397784a1ba1a5 (patch) | |
tree | 8a3809296bdfcdd16ebbf78975ea18034b22d62c /lib/hipe/ssa/hipe_ssa.inc | |
parent | 9491f6727f12e37241863bd5becbd1f336ff7659 (diff) | |
parent | fda3c9575d77bed0250f76f17e92d18836e15d0c (diff) | |
download | otp-3d7b55f946162b5a129241dbe67397784a1ba1a5.tar.gz otp-3d7b55f946162b5a129241dbe67397784a1ba1a5.tar.bz2 otp-3d7b55f946162b5a129241dbe67397784a1ba1a5.zip |
Merge branch 'margnus1/hipe/refactor-rtl/PR-1243'
* margnus1/hipe/refactor-rtl/PR-1243:
hipe_x86: Fix encoding of test instr w/ neg imm
hipe_tagscheme: Simplify test_two_fixnums with imm
hipe_icode: Always const-propagate if&call args
hipe_tagscheme: x86 lea+test for mask_and_compare
hipe_tagscheme: Improve fixnum_addsub with imm
hipe: Make realloc_binary fast case true branch
hipe_x86_postpass: Negate conditions in goto elim
hipe_tagscheme: Improve fixnum add on x86
hipe_rtl_to_x86: Use LEA only for immediate adds
hipe_x86: LeaToAdd peephole rule
hipe_sparc: move coalescing
hipe_ppc: better rlwinm pp
hipe_ppc: move coalescing
hipe_rtl: drop alub dest when unused
hipe_rtl: unify branch and alub
hipe_x86: Fix&activate ElimCmp0 peephole rule
hipe_{x86,amd64}: Finish test instr implementation
Diffstat (limited to 'lib/hipe/ssa/hipe_ssa.inc')
-rw-r--r-- | lib/hipe/ssa/hipe_ssa.inc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/hipe/ssa/hipe_ssa.inc b/lib/hipe/ssa/hipe_ssa.inc index 83ab320306..b511bb6f25 100644 --- a/lib/hipe/ssa/hipe_ssa.inc +++ b/lib/hipe/ssa/hipe_ssa.inc @@ -1,4 +1,4 @@ -%% -*- erlang-indent-level: 2 -*- +%% -*- mode: erlang; erlang-indent-level: 2 -*- %% %% %CopyrightBegin% %% @@ -943,9 +943,9 @@ do_code([Instr|Instrs], LiveOut, Changed, Acc) -> false -> do_code(Instrs, LiveIn, Changed, [Instr|Acc]); true -> - case ?CODE:is_safe(Instr) of + case ?CODE:is_call(Instr) of true -> - case ?CODE:is_call(Instr) of + case ?CODE:is_safe(Instr) of true -> case ?CODE:call_continuation(Instr) of [] -> @@ -955,11 +955,6 @@ do_code([Instr|Instrs], LiveOut, Changed, Acc) -> do_code(Instrs, LiveOut, true, [NewInstr|Acc]) end; false -> - do_code(Instrs, LiveOut, true, Acc) - end; - false -> %% not a safe instruction - cannot be removed - case ?CODE:is_call(Instr) of - true -> case ?CODE:call_dstlist(Instr) of [] -> %% result was not used anyway; no change do_code(Instrs, LiveIn, Changed, [Instr|Acc]); @@ -968,9 +963,14 @@ do_code([Instr|Instrs], LiveOut, Changed, Acc) -> do_code(Instrs, LiveIn, true, [NewInstr|Acc]); [_|_] -> %% calls with multiple dests are left untouched do_code(Instrs, LiveIn, Changed, [Instr|Acc]) - end; - false -> - do_code(Instrs, LiveIn, Changed, [Instr|Acc]) + end + end; + false -> + case ?CODE:reduce_unused(Instr) of + false -> % not a safe instruction - cannot be removed + do_code(Instrs, LiveIn, Changed, [Instr|Acc]); + Replacement -> + do_code(lists:reverse(Replacement, Instrs), LiveOut, true, Acc) end end end; |