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;
58 verifier_name : bytes;
61 fn new_basic_block : basic_block
66 pred_list : empty(int),
67 pred_position : empty(int),
68 post_list : empty(int),
91 //reading_instrs : instr_set;
92 writing_instrs : instr_set;
102 is_option_type : bool;
103 always_flat_option : bool;
105 verifier_name : bytes;
106 verifier_valid : bytes;
109 fn new_variable : variable
115 must_be_flat : false,
116 must_be_data : false,
125 is_option_type : false,
126 always_flat_option : false,
139 record local_type_flat_record [
140 non_flat_record : int;
141 flat_types : list(int);
144 record local_type_flat_array [
146 number_of_elements : int;
151 flat_rec : local_type_flat_record;
152 flat_array : local_type_flat_array;
155 type conflict_map := list(var_set);
158 local_types : list(local_type);
159 instrs : list(instruction);
160 blocks : list(basic_block);
161 variables : list(variable);
162 label_to_block : list(int);
167 return_ins : instruction;