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);

thanks,

+    }
+  free (bbs);

Reply via email to