diff options
author | Sverker Eriksson <[email protected]> | 2017-03-22 21:39:48 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-03-22 21:39:48 +0100 |
commit | c5e09d9315044bb9ac27702f6a9d3c6f290a3b8e (patch) | |
tree | a9549285fa68b47d24ac8610d0daa0e2d64681d0 /lib/hipe/arm/hipe_arm_ra_postconditions.erl | |
parent | b4ac8b2b32f094217d0533ee139273923c3a8af7 (diff) | |
parent | 9e618caac607379e1154e24bc9bd09709cce5d41 (diff) | |
download | otp-c5e09d9315044bb9ac27702f6a9d3c6f290a3b8e.tar.gz otp-c5e09d9315044bb9ac27702f6a9d3c6f290a3b8e.tar.bz2 otp-c5e09d9315044bb9ac27702f6a9d3c6f290a3b8e.zip |
Merge margnus1/hipe-range-split-rebase/PR-1380/OTP-14293
HiPE: Range splitting register allocation
Diffstat (limited to 'lib/hipe/arm/hipe_arm_ra_postconditions.erl')
-rw-r--r-- | lib/hipe/arm/hipe_arm_ra_postconditions.erl | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/hipe/arm/hipe_arm_ra_postconditions.erl b/lib/hipe/arm/hipe_arm_ra_postconditions.erl index 8d1ee1cb94..23c305511f 100644 --- a/lib/hipe/arm/hipe_arm_ra_postconditions.erl +++ b/lib/hipe/arm/hipe_arm_ra_postconditions.erl @@ -56,6 +56,7 @@ do_insn(I, TempMap, Strategy) -> #pseudo_call{} -> do_pseudo_call(I, TempMap, Strategy); #pseudo_li{} -> do_pseudo_li(I, TempMap, Strategy); #pseudo_move{} -> do_pseudo_move(I, TempMap, Strategy); + #pseudo_spill_move{} -> do_pseudo_spill_move(I, TempMap, Strategy); #pseudo_switch{} -> do_pseudo_switch(I, TempMap, Strategy); #pseudo_tailcall{} -> do_pseudo_tailcall(I, TempMap, Strategy); #smull{} -> do_smull(I, TempMap, Strategy); @@ -108,18 +109,25 @@ do_pseudo_li(I=#pseudo_li{dst=Dst}, TempMap, Strategy) -> do_pseudo_move(I=#pseudo_move{dst=Dst,src=Src}, TempMap, Strategy) -> %% Either Dst or Src (but not both) may be a pseudo temp. - %% pseudo_move and pseudo_tailcall are special cases: in - %% all other instructions, all temps must be non-pseudos - %% after register allocation. - case temp_is_spilled(Dst, TempMap) of - true -> % Src must not be a pseudo - {FixSrc,NewSrc,DidSpill} = fix_src1(Src, TempMap, Strategy), - NewI = I#pseudo_move{src=NewSrc}, - {FixSrc ++ [NewI], DidSpill}; + %% pseudo_move, pseudo_spill_move, and pseudo_tailcall + %% are special cases: in all other instructions, all + %% temps must be non-pseudos after register allocation. + case temp_is_spilled(Dst, TempMap) + andalso temp_is_spilled(Dst, TempMap) + of + true -> % Turn into pseudo_spill_move + Temp = clone(Src, temp1(Strategy)), + NewI = #pseudo_spill_move{dst=Dst, temp=Temp, src=Src}, + {[NewI], true}; _ -> {[I], false} end. +do_pseudo_spill_move(I = #pseudo_spill_move{temp=Temp}, TempMap, _Strategy) -> + %% Temp is above the low water mark and must not have been spilled + false = temp_is_spilled(Temp, TempMap), + {[I], false}. % nothing to do + do_pseudo_switch(I=#pseudo_switch{jtab=JTab,index=Index}, TempMap, Strategy) -> {FixJTab,NewJTab,DidSpill1} = fix_src1(JTab, TempMap, Strategy), {FixIndex,NewIndex,DidSpill2} = fix_src2(Index, TempMap, Strategy), |