aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-06-16 16:50:46 +0200
committerMagnus Lång <[email protected]>2016-08-30 17:21:20 +0200
commita19e3f0e1e82b793d58f9ef0db907ba637793fb6 (patch)
treec71d9bb46da12e8ce9182969caa0e8d65bb0eacb /lib/hipe/sparc/hipe_sparc_ra_finalise.erl
parent265b7f707273ad4dc73dd9d44007d417fc828774 (diff)
downloadotp-a19e3f0e1e82b793d58f9ef0db907ba637793fb6.tar.gz
otp-a19e3f0e1e82b793d58f9ef0db907ba637793fb6.tar.bz2
otp-a19e3f0e1e82b793d58f9ef0db907ba637793fb6.zip
hipe_sparc: 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_sparc_main.
Diffstat (limited to 'lib/hipe/sparc/hipe_sparc_ra_finalise.erl')
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_finalise.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/hipe/sparc/hipe_sparc_ra_finalise.erl b/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
index dc1e69c101..5d6056071c 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
@@ -23,13 +23,14 @@
-export([finalise/3]).
-include("hipe_sparc.hrl").
-finalise(Defun, TempMap, FPMap0) ->
- Code = hipe_sparc:defun_code(Defun),
- {_, SpillLimit} = hipe_sparc:defun_var_range(Defun),
+finalise(CFG, TempMap, FPMap0) ->
+ {_, SpillLimit} = hipe_gensym:var_range(sparc),
Map = mk_ra_map(TempMap, SpillLimit),
FPMap1 = mk_ra_map_fp(FPMap0, SpillLimit),
- NewCode = ra_code(Code, Map, FPMap1, []),
- Defun#defun{code=NewCode}.
+ hipe_sparc_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]);