}
if (iv) {
- if (env->flags & osr_flag_ignore_x86_shift) {
+ if (code == iro_Mul && env->flags & osr_flag_ignore_x86_shift) {
if (is_Const(rc)) {
tarval *tv = get_Const_tarval(rc);
/* Performs Operator Strength Reduction for the passed graph. */
void opt_osr(ir_graph *irg, unsigned flags) {
- iv_env env;
+ iv_env env;
+ ir_graph *rem;
if (! get_opt_strength_red())
return;
+ rem = current_ir_graph;
+ current_ir_graph = irg;
+
FIRM_DBG_REGISTER(dbg, "firm.opt.osr");
-// firm_dbg_set_mask(dbg, SET_LEVEL_3);
DB((dbg, LEVEL_1, "Doing Operator Strength Reduction for %+F\n", irg));
del_set(env.quad_map);
DEL_ARR_F(env.stack);
obstack_free(&env.obst, NULL);
+
+ current_ir_graph = rem;
}