2 * Copyright (C) 2024, 2025 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 private unit compiler.optimize.defs;
23 const check : bool := false;
25 type node_set := int128;
26 type var_set := int128;
27 type instr_set := int128;
28 type param_set := int;
32 params : list(pcode_t);
34 write_set : param_set;
37 conflict_1 : param_set;
38 conflict_2 : param_set;
46 pred_list : list(int);
47 pred_position : list(int);
48 post_list : list(int);
52 is_idom_of : node_set;
54 uninitialized : var_set;
56 live_bottom : var_set;
61 added_claims : list(bytes);
64 fn new_basic_block : basic_block
69 pred_list : empty(int),
70 pred_position : empty(int),
71 post_list : empty(int),
84 pre_cut_nodes : false,
85 added_claims : empty(bytes),
97 //reading_instrs : instr_set;
98 writing_instrs : instr_set;
100 defining_block : int;
101 defining_instr : int;
108 is_option_type : bool;
109 always_flat_option : bool;
111 verifier_name : list(bytes);
115 fn new_variable : variable
121 must_be_flat : false,
122 must_be_data : false,
131 is_option_type : false,
132 always_flat_option : false,
133 verifier_name : infinite(""),
145 record local_type_flat_record [
146 non_flat_record : int;
147 flat_types : list(int);
150 record local_type_flat_array [
152 number_of_elements : int;
157 flat_rec : local_type_flat_record;
158 flat_array : local_type_flat_array;
161 type conflict_map := list(var_set);
164 local_types : list(local_type);
165 instrs : list(instruction);
166 blocks : list(basic_block);
167 variables : list(variable);
168 label_to_block : list(int);
173 return_ins : instruction;