This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR82726/PR70754][2/2]New fix by finding correct root reference in combined chains
On Sat, Nov 11, 2017 at 11:19 AM, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On Fri, Nov 10, 2017 at 02:14:25PM +0000, Bin.Cheng wrote:
>> Hmm, the patch...
>
> + /* Setup UID for all statements in dominance order. */
> + basic_block *bbs = get_loop_body (loop);
> + for (i = 0; i < loop->num_nodes; i++)
> + {
> + unsigned uid = 0;
> + basic_block bb = bbs[i];
> +
> + for (gimple_stmt_iterator bsi = gsi_start_phis (bb); !gsi_end_p (bsi);
> + gsi_next (&bsi))
> + {
> + gimple *stmt = gsi_stmt (bsi);
> + if (!virtual_operand_p (gimple_phi_result (as_a<gphi *> (stmt))))
> + gimple_set_uid (stmt, uid);
> + }
> +
> + for (gimple_stmt_iterator bsi = gsi_start_bb (bb); !gsi_end_p (bsi);
> + gsi_next (&bsi))
> + {
> + gimple *stmt = gsi_stmt (bsi);
> + if (gimple_code (stmt) != GIMPLE_LABEL && !is_gimple_debug (stmt))
> + gimple_set_uid (stmt, ++uid);
> + }
>
> for (gimple_stmt_iterator bsi = gsi_start_nondebug_after_labels_bb (bb);
> !gsi_end_p (bsi);
> gsi_next_nondebug (&bsi))
> gimple_set_uid (gsi_stmt (bsi), ++uid);
Or even better instead of the whole loop
renumber_gimple_stmt_uids_in_blocks (bbs, loop->num_nodes);
Ok with that change.
Thanks,
Richard.
> thanks,
>
> + }
> + free (bbs);
>