aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/x86/hipe_x86_spill_restore.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-03-17 21:37:26 +0100
committerMagnus Lång <[email protected]>2016-08-30 17:17:45 +0200
commitdc4e9384c6f2f733ab0d12727ab53238bda3fbca (patch)
tree55c4d84effc98ae0bffbd9b7bc185d2d0a602ba6 /lib/hipe/x86/hipe_x86_spill_restore.erl
parent4b8c17b0901dfa356792c36f01d78de827cb6645 (diff)
downloadotp-dc4e9384c6f2f733ab0d12727ab53238bda3fbca.tar.gz
otp-dc4e9384c6f2f733ab0d12727ab53238bda3fbca.tar.bz2
otp-dc4e9384c6f2f733ab0d12727ab53238bda3fbca.zip
hipe_x86: Minimise CFG<->linear conversions
Most x86 passes were either linearise(pass(to_cfg(Code))) or trivially rewritable to process a CFG. This saves a great deal of time and memory churn when compiling large programs. 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_x86_main.
Diffstat (limited to 'lib/hipe/x86/hipe_x86_spill_restore.erl')
-rw-r--r--lib/hipe/x86/hipe_x86_spill_restore.erl12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/hipe/x86/hipe_x86_spill_restore.erl b/lib/hipe/x86/hipe_x86_spill_restore.erl
index f17b91f33b..32b1eb7b40 100644
--- a/lib/hipe/x86/hipe_x86_spill_restore.erl
+++ b/lib/hipe/x86/hipe_x86_spill_restore.erl
@@ -25,13 +25,11 @@
-ifdef(HIPE_AMD64).
-define(HIPE_X86_SPILL_RESTORE, hipe_amd64_spill_restore).
-define(HIPE_X86_LIVENESS, hipe_amd64_liveness).
--define(HIPE_X86_SPECIFIC, hipe_amd64_specific).
-define(HIPE_X86_REGISTERS, hipe_amd64_registers).
-define(X86STR, "amd64").
-else.
-define(HIPE_X86_SPILL_RESTORE, hipe_x86_spill_restore).
-define(HIPE_X86_LIVENESS, hipe_x86_liveness).
--define(HIPE_X86_SPECIFIC, hipe_x86_specific).
-define(HIPE_X86_REGISTERS, hipe_x86_registers).
-define(X86STR, "x86").
-endif.
@@ -51,15 +49,13 @@
-include("../flow/cfg.hrl"). % Added for the definition of #cfg{}
%% Main function
-spill_restore(Defun, Options) ->
- CFG = ?option_time(firstPass(Defun), ?X86STR" First Pass", Options),
- CFGFinal = ?option_time(secondPass(CFG), ?X86STR" Second Pass", Options),
- hipe_x86_cfg:linearise(CFGFinal).
+spill_restore(CFG0, Options) ->
+ CFG1 = ?option_time(firstPass(CFG0), ?X86STR" First Pass", Options),
+ ?option_time(secondPass(CFG1), ?X86STR" Second Pass", Options).
%% Performs the first pass of the algorithm.
%% By working bottom up, introduce the pseudo_spills.
-firstPass(Defun) ->
- CFG0 = ?HIPE_X86_SPECIFIC:defun_to_cfg(Defun),
+firstPass(CFG0) ->
%% get the labels bottom up
Labels = hipe_x86_cfg:postorder(CFG0),
Liveness = ?HIPE_X86_LIVENESS:analyse(CFG0),