#include "error.h"
#include "be.h"
#include "util.h"
+#include "firmstat_t.h"
/** Walker environment. */
typedef struct walker_env {
ir_free_resources(irg, IR_RESOURCE_IRN_LINK | IR_RESOURCE_PHI_LIST);
if (wenv.nr_of_intrinsics > 0) {
- /* Changes detected: we might have added/removed nodes. */
- set_irg_callee_info_state(irg, irg_callee_info_inconsistent);
-
- /* Exception control flow might have changed / new block might have added. */
- clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
-
- /* verify here */
- irg_verify(irg, VERIFY_NORMAL);
-
+ confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE);
nr_of_intrinsics += wenv.nr_of_intrinsics;
}
}
ir_node *irn;
(void) ctx;
- irn = new_rd_Builtin(dbg, block, get_irg_no_mem(current_ir_graph), 1, &op, ir_bk_bswap, tp);
+ ir_graph *const irg = get_Block_irg(block);
+ irn = new_rd_Builtin(dbg, block, get_irg_no_mem(irg), 1, &op, ir_bk_bswap, tp);
set_irn_pinned(irn, op_pin_state_floats);
irn = new_r_Proj(irn, get_irn_mode(op), pn_Builtin_max+1);
replace_call(irn, call, mem, NULL, NULL);
dbg = get_irn_dbg_info(call);
if (irn == NULL) {
- ir_mode *mode = get_irn_mode(left);
+ ir_mode *result_mode = get_irn_mode(left);
ir_node *div;
+ ir_mode *mode = result_mode;
+ ir_mode *float_arithmetic = be_get_backend_param()->mode_float_arithmetic;
+ if (float_arithmetic != NULL) {
+ left = new_r_Conv(block, left, float_arithmetic);
+ mode = float_arithmetic;
+ }
+
irn = new_r_Const(irg, get_mode_one(mode));
div = new_rd_Div(dbg, block, mem, irn, left, mode, op_pin_state_pinned);
mem = new_r_Proj(div, mode_M, pn_Div_M);
exc_jmp = new_r_Proj(div, mode_X, pn_Div_X_except);
ir_set_throws_exception(div, true);
}
+ if (result_mode != mode) {
+ irn = new_r_Conv(block, irn, result_mode);
+ }
}
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_POW);
replace_call(irn, call, mem, reg_jmp, exc_jmp);
ir_node *val = get_Call_param(call, 0);
(void) ctx;
- if (is_strictConv(val)) {
+ if (is_Conv(val)) {
ir_node *op = get_Conv_op(val);
if (is_Minus(op)) {
/* f(-x) = f(x) with strictConv */
op = get_Minus_op(op);
val = new_rd_Conv(dbg, block, op, mode);
- if (is_Conv(val)) {
- /* still a Conv ? */
- set_Conv_strict(val, 1);
- }
DBG_OPT_ALGSIM2(call, op, call, FS_OPT_RTS_SYMMETRIC);
set_Call_param(call, 0, val);
changed = 1;
return 0;
char_tp = get_pointer_points_to_type(char_tp);
+ ir_node *mem = get_Call_mem(call);
if (left == right) {
/* a strcmp(s, s) ==> 0 */
- ir_graph *irg = get_irn_irg(call);
- ir_node *mem = get_Call_mem(call);
- ir_mode *mode = get_type_mode(res_tp);
+ ir_graph *irg = get_irn_irg(call);
+ ir_mode *mode = get_type_mode(res_tp);
irn = new_r_Const(irg, get_mode_null(mode));
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_STRCMP);
} else if (ent_r != NULL) {
if (is_empty_string(ent_r)) {
/* s strcmp(s, "") ==> (*s) */
- ir_node *mem, *block;
+ ir_node *block;
dbg_info *dbg;
ir_mode *mode;
}
if (irn != NULL) {
- ir_node *mem = get_Call_mem(call);
DBG_OPT_ALGSIM0(call, irn, FS_OPT_RTS_STRCMP);
replace_call(irn, call, mem, reg, exc);
return 1;
int i, j, arity, first, n_param, n_res;
long n_proj;
ir_type *mtp;
- ir_node *mem, *bl, *call, *addr, *res_proj;
+ ir_node *mem, *call, *addr, *res_proj;
ir_node **in;
bool throws_exception;
ir_op *op;
- ir_graph *irg;
symconst_symbol sym;
ir_mode *mode = get_irn_mode(node);
mtp = get_entity_type(rt->ent);
n_param = get_method_n_params(mtp);
- irg = current_ir_graph;
+ ir_node *const bl = get_nodes_block(node);
+ ir_graph *const irg = get_Block_irg(bl);
mem = get_irn_n(node, 0);
if (get_irn_mode(mem) != mode_M) {
}
/* ok, when we are here, the number of predecessors match as well as the parameter modes */
- bl = get_nodes_block(node);
op = get_irn_op(node);
in = NULL;