11// SPDX-License-Identifier: GPL-2.0-only
2- #include <linux/bpf_ir.h>
2+ #include "ir.h"
33
44static const s8 helper_func_arg_num [] = {
55 [1 ] = 2 , // map_lookup_elem
@@ -1503,18 +1503,9 @@ void bpf_ir_free_function(struct ir_function *fun)
15031503 bpf_ir_array_free (& fun -> sp -> users );
15041504 free_proto (fun -> sp );
15051505 }
1506- for (u8 i = 0 ; i < BPF_REG_10 ; ++ i ) {
1507- struct ir_insn * insn = fun -> cg_info .regs [i ];
1508- bpf_ir_array_free (& insn -> users );
1509- free_proto (insn );
1510- }
15111506 bpf_ir_array_free (& fun -> all_bbs );
15121507 bpf_ir_array_free (& fun -> reachable_bbs );
15131508 bpf_ir_array_free (& fun -> end_bbs );
1514- bpf_ir_array_free (& fun -> cg_info .seo );
1515-
1516- bpf_ir_array_free (& fun -> cg_info .all_var );
1517- bpf_ir_ptrset_free (& fun -> cg_info .all_var_v2 );
15181509}
15191510
15201511static void init_function (struct bpf_ir_env * env , struct ir_function * fun ,
@@ -1529,10 +1520,6 @@ static void init_function(struct bpf_ir_env *env, struct ir_function *fun,
15291520 INIT_ARRAY (& fun -> all_bbs , struct ir_basic_block * );
15301521 INIT_ARRAY (& fun -> reachable_bbs , struct ir_basic_block * );
15311522 INIT_ARRAY (& fun -> end_bbs , struct ir_basic_block * );
1532- INIT_ARRAY (& fun -> cg_info .all_var , struct ir_insn * );
1533- INIT_ARRAY (& fun -> cg_info .seo , struct ir_insn * );
1534- INIT_PTRSET_DEF (& fun -> cg_info .all_var_v2 );
1535- fun -> cg_info .stack_offset = 0 ;
15361523 for (size_t i = 0 ; i < MAX_BPF_REG ; ++ i ) {
15371524 struct array * currentDef = & tenv -> currentDef [i ];
15381525 bpf_ir_array_free (currentDef );
@@ -1548,17 +1535,6 @@ static void init_function(struct bpf_ir_env *env, struct ir_function *fun,
15481535 bpf_ir_array_push (env , & fun -> all_bbs , & bb -> ir_bb );
15491536 free_proto (bb );
15501537 }
1551- for (u8 i = 0 ; i < BPF_REG_10 ; ++ i ) {
1552- struct ir_insn * insn ;
1553- SAFE_MALLOC (fun -> cg_info .regs [i ], sizeof (struct ir_insn ));
1554- // Those should be read-only
1555- insn = fun -> cg_info .regs [i ];
1556- insn -> op = IR_INSN_REG ;
1557- insn -> parent_bb = NULL ;
1558- INIT_ARRAY (& insn -> users , struct ir_insn * );
1559- insn -> value_num = 0 ;
1560- insn -> reg_id = i ;
1561- }
15621538}
15631539
15641540static void gen_bb_succ (struct bpf_ir_env * env , struct ir_function * fun )
@@ -1974,10 +1950,8 @@ struct bpf_ir_opts bpf_ir_default_opts(void)
19741950 opts .print_mode = BPF_IR_PRINT_BPF ;
19751951 opts .builtin_pass_cfg_num = 0 ;
19761952 opts .custom_pass_num = 0 ;
1977- opts .disable_coalesce = false;
19781953 opts .force = false;
19791954 opts .verbose = 1 ;
1980- opts .cg_v2 = true;
19811955 opts .dotgraph = false;
19821956 opts .fake_run = false;
19831957 opts .max_iteration = 10 ;
0 commit comments