diff options
author | Magnus Lång <[email protected]> | 2016-09-01 17:21:25 +0200 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-09-05 19:16:26 +0200 |
commit | 1039c0196a7e643c63ce71b2c6daa2b78b3aa832 (patch) | |
tree | 7540338826d46f9850278b3af8ad84e2f4c76119 /lib/hipe/arm/hipe_arm_ra_ls.erl | |
parent | b4695b8088b8fc6f3844e33246849ed8bb8b18cf (diff) | |
download | otp-1039c0196a7e643c63ce71b2c6daa2b78b3aa832.tar.gz otp-1039c0196a7e643c63ce71b2c6daa2b78b3aa832.tar.bz2 otp-1039c0196a7e643c63ce71b2c6daa2b78b3aa832.zip |
hipe: Reuse liveness between regalloc iterations
This is sound because the liveness data structure only stores liveness
info at basic block boundaries, and the rewrites that happen in
TargetSpecific:check_and_rewrite/2 preserves all existing definitions
and uses, and all new liveness intervals, belonging to newly introduced
temporaries, are always local to a basic block, and thus do not show up
in the liveout or livein sets for the basic block.
Diffstat (limited to 'lib/hipe/arm/hipe_arm_ra_ls.erl')
-rw-r--r-- | lib/hipe/arm/hipe_arm_ra_ls.erl | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/hipe/arm/hipe_arm_ra_ls.erl b/lib/hipe/arm/hipe_arm_ra_ls.erl index f9193ca9e0..4d517d6697 100644 --- a/lib/hipe/arm/hipe_arm_ra_ls.erl +++ b/lib/hipe/arm/hipe_arm_ra_ls.erl @@ -21,16 +21,16 @@ %%% Linear Scan register allocator for ARM -module(hipe_arm_ra_ls). --export([ra/3]). +-export([ra/4]). -ra(CFG, SpillIndex, Options) -> +ra(CFG, Liveness, SpillIndex, Options) -> SpillLimit = hipe_arm_specific:number_of_temporaries(CFG), - alloc(CFG, SpillIndex, SpillLimit, Options). + alloc(CFG, Liveness, SpillIndex, SpillLimit, Options). -alloc(CFG, SpillIndex, SpillLimit, Options) -> - {Coloring, _NewSpillIndex, Liveness} = +alloc(CFG, Liveness, SpillIndex, SpillLimit, Options) -> + {Coloring, _NewSpillIndex} = regalloc( - CFG, + CFG, Liveness, hipe_arm_registers:allocatable_gpr()-- [hipe_arm_registers:temp3(), hipe_arm_registers:temp2(), @@ -47,8 +47,9 @@ alloc(CFG, SpillIndex, SpillLimit, Options) -> hipe_arm_specific, TempMap), Coloring2 = hipe_spillmin:mapmerge(hipe_temp_map:to_substlist(TempMap), SpillMap), - {NewCFG, Coloring2}. + {NewCFG, Liveness, Coloring2}. -regalloc(CFG, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, Target) -> - hipe_ls_regalloc:regalloc( - CFG, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, Target). +regalloc(CFG, Liveness, PhysRegs, Entrypoints, SpillIndex, DontSpill, Options, + Target) -> + hipe_ls_regalloc:regalloc(CFG, Liveness, PhysRegs, Entrypoints, SpillIndex, + DontSpill, Options, Target). |