[m-rev.] for review: parallel liveness and code generation
Peter Wang
wangp at students.cs.mu.oz.au
Fri Sep 1 16:54:04 AEST 2006
On 2006-08-16, Peter Wang <wangp at students.csse.unimelb.edu.au> wrote:
> Estimated hours taken: 20
> Branches: main
>
> Add options to perform code generation and liveness detection for the low-level
> backend using parallel threads. These are enabled with `--parallel-code-gen'
> and `--parallel-liveness' options respectively, for compilers built in grades
> supporting multiple engines, and running with multiple engines enabled.
> Currently we only attempt to use two threads.
Fixed a bug so now it bootchecks (interdiff follows). Since the options
are disabled by default and parallel conjunctions are now converted to
sequential conjunctions in most grades, I'll commit this soon and deal
with any comments later.
Peter
diff -u compiler/global_data.m compiler/global_data.m
--- compiler/global_data.m 9 Aug 2006 05:22:41 -0000
+++ compiler/global_data.m 31 Aug 2006 14:34:07 -0000
@@ -920,6 +920,10 @@
Instr = if_val(Rval, CodeAddr),
Rval = remap_rval(Remap, Rval0)
;
+ Instr0 = pragma_c(A, Comps0, B, C, D, E, F, G, H),
+ Instr = pragma_c(A, Comps, B, C, D, E, F, G, H),
+ Comps = list.map(remap_pragma_c_component(Remap), Comps0)
+ ;
( Instr0 = comment(_)
; Instr0 = livevals(_)
; Instr0 = llcall(_, _, _, _, _, _)
@@ -930,7 +934,7 @@
; Instr0 = arbitrary_c_code(_, _)
; Instr0 = save_maxfr(_)
; Instr0 = restore_maxfr(_)
- ; Instr0 = incr_hp(_, _, _, _, _)
+ ; Instr0 = incr_hp(_, _, _, _, _, _)
; Instr0 = mark_hp(_)
; Instr0 = restore_hp(_)
; Instr0 = free_heap(_)
@@ -943,7 +947,6 @@
; Instr0 = incr_sp(_, _)
; Instr0 = decr_sp(_)
; Instr0 = decr_sp_and_return(_)
- ; Instr0 = pragma_c(_, _, _, _, _, _, _, _, _)
; Instr0 = init_sync_term(_, _)
; Instr0 = fork(_, _, _)
; Instr0 = join_and_terminate(_)
@@ -952,6 +955,41 @@
Instr = Instr0
).
+:- func remap_pragma_c_component(static_cell_remap_info, pragma_c_component)
+ = pragma_c_component.
+
+remap_pragma_c_component(Remap, Comp0) = Comp :-
+ (
+ Comp0 = pragma_c_inputs(Inputs0),
+ Comp = pragma_c_inputs(Inputs),
+ Inputs = list.map(remap_pragma_c_input(Remap), Inputs0)
+ ;
+ Comp0 = pragma_c_outputs(Outputs0),
+ Comp = pragma_c_outputs(Outputs),
+ Outputs = list.map(remap_pragma_c_output(Remap), Outputs0)
+ ;
+ ( Comp0 = pragma_c_raw_code(_, _, _)
+ ; Comp0 = pragma_c_user_code(_, _)
+ ; Comp0 = pragma_c_fail_to(_)
+ ; Comp0 = pragma_c_noop
+ ),
+ Comp = Comp0
+ ).
+
+:- func remap_pragma_c_input(static_cell_remap_info, pragma_c_input)
+ = pragma_c_input.
+
+remap_pragma_c_input(Remap, pragma_c_input(A, B, C, D, Rval0, E, F))
+ = pragma_c_input(A, B, C, D, Rval, E, F) :-
+ Rval = remap_rval(Remap, Rval0).
+
+:- func remap_pragma_c_output(static_cell_remap_info, pragma_c_output)
+ = pragma_c_output.
+
+remap_pragma_c_output(Remap, pragma_c_output(Lval0, A, B, C, D, E, F))
+ = pragma_c_output(Lval, A, B, C, D, E, F) :-
+ Lval = remap_lval(Remap, Lval0).
+
:- func remap_lval(static_cell_remap_info, lval) = lval.
remap_lval(Remap, Lval0) = Lval :-
@@ -1021,8 +1059,8 @@
remap_rval_const(Remap, Const0) = Const :-
(
- Const0 = data_addr_const(Addr0, MaybeOffset),
- Const = data_addr_const(Addr, MaybeOffset),
+ Const0 = llconst_data_addr(Addr0, MaybeOffset),
+ Const = llconst_data_addr(Addr, MaybeOffset),
(
Addr0 = data_addr(ModuleName, DataName0),
Addr = data_addr(ModuleName, DataName),
@@ -1035,13 +1073,13 @@
Addr = Addr0
)
;
- ( Const0 = true
- ; Const0 = false
- ; Const0 = int_const(_)
- ; Const0 = float_const(_)
- ; Const0 = string_const(_)
- ; Const0 = multi_string_const(_, _)
- ; Const0 = code_addr_const(_)
+ ( Const0 = llconst_true
+ ; Const0 = llconst_false
+ ; Const0 = llconst_int(_)
+ ; Const0 = llconst_float(_)
+ ; Const0 = llconst_string(_)
+ ; Const0 = llconst_multi_string(_, _)
+ ; Const0 = llconst_code_addr(_)
),
Const = Const0
).
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list