diff options
author | Magnus Lång <[email protected]> | 2016-06-16 15:29:39 +0200 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-08-30 17:21:20 +0200 |
commit | 265b7f707273ad4dc73dd9d44007d417fc828774 (patch) | |
tree | a840b29f70e31f7118dcf8339db1a760e87e0535 /lib/hipe/ppc/hipe_ppc_ra_finalise.erl | |
parent | d9b091472f9afb216fe9f0c763053baf89390a6c (diff) | |
download | otp-265b7f707273ad4dc73dd9d44007d417fc828774.tar.gz otp-265b7f707273ad4dc73dd9d44007d417fc828774.tar.bz2 otp-265b7f707273ad4dc73dd9d44007d417fc828774.zip |
hipe_ppc: Minimise CFG<->linear conversions
Now, there will only ever be a single Linear->CFG conversion, just after
lowering from RTL, and only ever a single CFG->Linear conversion, just
before the finalise pass. Both of these now happen in hipe_ppc_main.
Diffstat (limited to 'lib/hipe/ppc/hipe_ppc_ra_finalise.erl')
-rw-r--r-- | lib/hipe/ppc/hipe_ppc_ra_finalise.erl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/hipe/ppc/hipe_ppc_ra_finalise.erl b/lib/hipe/ppc/hipe_ppc_ra_finalise.erl index ea163221c2..78f123116e 100644 --- a/lib/hipe/ppc/hipe_ppc_ra_finalise.erl +++ b/lib/hipe/ppc/hipe_ppc_ra_finalise.erl @@ -23,13 +23,14 @@ -export([finalise/3]). -include("hipe_ppc.hrl"). -finalise(Defun, TempMap, FPMap0) -> - Code = hipe_ppc:defun_code(Defun), - {_, SpillLimit} = hipe_ppc:defun_var_range(Defun), +finalise(CFG, TempMap, FPMap0) -> + {_, SpillLimit} = hipe_gensym:var_range(ppc), Map = mk_ra_map(TempMap, SpillLimit), FPMap1 = mk_ra_map_fp(FPMap0, SpillLimit), - NewCode = ra_code(Code, Map, FPMap1, []), - Defun#defun{code=NewCode}. + hipe_ppc_cfg:map_bbs(fun(_Lbl, BB) -> ra_bb(BB, Map, FPMap1) end, CFG). + +ra_bb(BB, Map, FpMap) -> + hipe_bb:code_update(BB, ra_code(hipe_bb:code(BB), Map, FpMap, [])). ra_code([I|Insns], Map, FPMap, Accum) -> ra_code(Insns, Map, FPMap, [ra_insn(I, Map, FPMap) | Accum]); |