diff --git a/ir/opt/loop_simplify.c b/ir/opt/loop_simplify.c index 85b1d98..0017eae 100644 --- a/ir/opt/loop_simplify.c +++ b/ir/opt/loop_simplify.c @@ -7,7 +7,6 @@ void vx_opt_loop_simplify(vx_IrView view, vx_IrOp *op = (vx_IrOp *) vx_IrView_take(view); vx_IrBlock *cond = vx_IrOp_param(op, VX_IR_NAME_COND)->block; - opt(cond); // ! const vx_IrVar condVar = cond->outs[0]; // if it will always we 0, we optimize it out @@ -17,8 +16,6 @@ void vx_opt_loop_simplify(vx_IrView view, goto next; } - opt(vx_IrOp_param(op, VX_IR_NAME_LOOP_DO)->block); - // if it will never be 0 (not might be 0), it is always true => infinite loop if (!vx_Irblock_mightbe_var(cond, condVar, (vx_IrValue) { .type = VX_IR_VAL_IMM_INT, .imm_int = 0 })) { vx_IrOp new; diff --git a/ir/opt/reduce_if.c b/ir/opt/reduce_if.c index 58ea994..c845e1e 100644 --- a/ir/opt/reduce_if.c +++ b/ir/opt/reduce_if.c @@ -9,13 +9,11 @@ void vx_opt_reduce_if(vx_IrView view, vx_IrOp *op = (vx_IrOp *) vx_IrView_take(view); vx_IrBlock *cond = vx_IrOp_param(op, VX_IR_NAME_COND)->block; - opt(cond); // ! const vx_IrVar condVar = cond->outs[0]; vx_IrValue *pthen = vx_IrOp_param(op, VX_IR_NAME_COND_THEN); if (pthen) { vx_IrBlock *then = pthen->block; - opt(then); // if it will never be 0 (not might be 0), it is always true => only execute then block if (!vx_Irblock_mightbe_var(cond, condVar, (vx_IrValue) { .type = VX_IR_VAL_IMM_INT, .imm_int = 0 })) { @@ -33,7 +31,6 @@ void vx_opt_reduce_if(vx_IrView view, vx_IrValue *pelse = vx_IrOp_param(op, VX_IR_NAME_COND_ELSE); if (pelse) { vx_IrBlock *els = pelse->block; - opt(els); // if it will always we 0, only the else block will ever be executed if (vx_Irblock_alwaysis_var(cond, condVar, (vx_IrValue) { .type = VX_IR_VAL_IMM_INT, .imm_int = 0 })) {