Skip to content

Commit e3a1270

Browse files
authored
fix inlogic explorer (#1266)
* fix inlogic explorer * change default of reg_alloc (absence case) * make eror syntactically obvious
1 parent 4777c4b commit e3a1270

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

compiler/backend/cv_compute/backend_asmScript.sml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,8 @@ Definition to_bvl_all_def:
573573
call_state := (g,aux)|> in
574574
let init_stubs = toAList (init_code c1.max_app) in
575575
let init_globs =
576-
[(num_stubs c1.max_app − 1,0,
576+
[(num_stubs c1.max_app − 2, 2, force_thunk_code);
577+
(num_stubs c1.max_app − 1, 0,
577578
init_globals c1.max_app (num_stubs c1.max_app + c1.start))] in
578579
let comp_progs = clos_to_bvl$compile_prog c1.max_app prog in
579580
let prog' = init_stubs ++ init_globs ++ comp_progs in
@@ -651,7 +652,7 @@ Definition to_word_all_def:
651652
((name_num,arg_count,
652653
remove_must_terminate
653654
(case word_alloc_inlogic asm_conf prog col_opt of
654-
| NONE => Skip
655+
| NONE => FFI "reg alloc fail" 0 0 0 0 (LN,LN)
655656
| SOME x => x)))) (ZIP (p,n_oracles)) in
656657
let ps = ps ++ [(strlit "after word_alloc (and remove_must_terminate)",Word p names)] in
657658
let c = c with inc_word_to_word_conf updated_by (λc. c with col_oracle := col) in

compiler/backend/reg_alloc/reg_allocScript.sml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ End
12201220

12211221
Definition sp_default_def:
12221222
sp_default t i =
1223-
(case lookup i t of NONE => if is_phy_var i then i DIV 2 else i | SOME x => x)
1223+
(case lookup i t of NONE => if is_phy_var i then i DIV 2 else 0 | SOME x => x)
12241224
End
12251225

12261226
Definition extend_graph_def:

compiler/backend/word_allocScript.sml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ End
14171417
(*Extract a colouring function from the generated sptree*)
14181418
Definition total_colour_def:
14191419
total_colour col x =
1420-
dtcase lookup x col of NONE => if is_phy_var x then x else 2*x | SOME x => 2*x
1420+
dtcase lookup x col of NONE => if is_phy_var x then x else 0 | SOME x => 2*x
14211421
End
14221422

14231423
Theorem total_colour_alt:

unverified/reg_alloc/reg_alloc.sml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ structure reg_alloc = struct
234234
case (lookup_1 v2 v3)
235235
of NONE => (if (is_phy_var v2)
236236
then (v2 div 2)
237-
else v2)
237+
else 0)
238238
| SOME(v1) => v1);
239239
fun extract_tag v2 =
240240
case v2

0 commit comments

Comments
 (0)