This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Get back what DCE was able to do in 4.2 with V_MUST_DEFs
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Sep 2007 20:25:55 +0200
- Subject: Re: [PATCH][RFC] Get back what DCE was able to do in 4.2 with V_MUST_DEFs
- References: <Pine.LNX.4.64.0709271901220.4331@r100.fhfr.qr>
Hello,
> *************** remove_dead_stmt (block_stmt_iterator *i
> *** 648,654 ****
> remove_edge (EDGE_SUCC (bb, 1));
> }
> }
> !
> bsi_remove (i, true);
> release_defs (t);
> }
> --- 698,735 ----
> remove_edge (EDGE_SUCC (bb, 1));
> }
> }
> !
> ! /* Update uses of VDEFs in t. */
> ! FOR_EACH_SSA_VDEF_OPERAND (def_p, usevect, t, iter)
> ! {
> ! imm_use_iterator iter2;
> ! use_operand_p use_p;
> ! tree stmt, use;
> !
> ! gcc_assert (VUSE_VECT_NUM_ELEM (*usevect) == 1);
> !
> ! use = VUSE_ELEMENT_VAR (*usevect, 0);
> !
> ! /* If we are messing with a use defined in a loop PHI, make us
> ! propagate the default def instead. */
> ! FOR_EACH_IMM_USE_FAST (use_p, iter2, DEF_FROM_PTR (def_p))
> ! if (TREE_CODE (USE_STMT (use_p)) == PHI_NODE
> ! && PHI_RESULT_TREE (USE_STMT (use_p)) == use)
> ! {
> ! use = gimple_default_def (cfun, SSA_NAME_VAR (use));
> ! break;
> ! }
what is the purpose of this hack (why do you need to use the default
def)? And why is it even correct (it seems that this should create
overlaping life ranges for virtual operand SSA names)? I think it
needs to be also explained in the comment.
> ! FOR_EACH_IMM_USE_STMT (stmt, iter2, DEF_FROM_PTR (def_p))
> ! FOR_EACH_IMM_USE_ON_STMT (use_p, iter2)
> ! SET_USE (use_p, use);
This should use replace_uses_by (otherwise you are missing at least
updating SSA_NAME_OCCURS_IN_ABNORMAL_PHI).
Zdenek