*
* A fast and simple Escape analysis.
*/
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#include "iroptimize.h"
+
#include "irgraph_t.h"
#include "irnode_t.h"
#include "type_t.h"
#include "analyze_irg_args.h"
#include "irgmod.h"
#include "ircons.h"
-#include "escape_ana.h"
#include "debug.h"
/**
*/
static void transform_allocs(ir_graph *irg, walk_env_t *env)
{
- ir_node *alloc, *next, *mem, *sel, *size;
+ ir_node *alloc, *next, *mem, *sel, *size, *blk;
ir_type *ftp, *atp, *tp;
ir_entity *ent;
char name[128];
DBG((dbgHandle, LEVEL_1, "%+F allocation of %+F unused, deleted.\n", irg, alloc));
mem = get_Alloc_mem(alloc);
+ blk = get_nodes_block(alloc);
turn_into_tuple(alloc, pn_Alloc_max);
set_Tuple_pred(alloc, pn_Alloc_M, mem);
+ set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(irg, blk));
set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg));
++env->nr_deads;
turn_into_tuple(alloc, pn_Alloc_max);
set_Tuple_pred(alloc, pn_Alloc_M, mem);
+ set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(irg, blk));
set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg));
set_Tuple_pred(alloc, pn_Alloc_res, sel);
*/
static void transform_alloc_calls(ir_graph *irg, walk_env_t *env)
{
- ir_node *call, *next, *mem, *size;
- ir_type *ftp, *atp, *tp;
+ ir_node *call, *next, *mem, *blk;
+ ir_type *ftp;
/* kill all dead allocs */
for (call = env->dead_allocs; call; call = next) {
DBG((dbgHandle, LEVEL_1, "%+F allocation of %+F unused, deleted.\n", irg, call));
mem = get_Call_mem(call);
+ blk = get_nodes_block(call);
turn_into_tuple(call, pn_Call_max);
set_Tuple_pred(call, pn_Call_M_regular, mem);
+ set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(irg, blk));
set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg));
set_Tuple_pred(call, pn_Call_T_result, new_r_Bad(irg));
set_Tuple_pred(call, pn_Call_M_except, mem);