Hello,

My pass is now generating a correct CFG structure (statements are in the
right place and edges between bbs are ok), however in the end due TODO,
it fails.

Here's the pass definition:
,----
| struct tree_opt_pass pass_clusterswt =
| {
|    "clusterswt",                         /* name */
|    gate_clusterswt,                      /* gate */
|    tree_clusterswt,                      /* execute */
|    NULL,                                 /* sub */
|    NULL,                                 /* next */
|    0,                                    /* static_pass_number */
|    TV_TREE_CLUSTERSWT,                   /* tv_id */
|    PROP_ssa,                             /* properties_required */
|    0,                                    /* properties_provided */
|    0,                                    /* properties_destroyed */
|    0,                                    /* todo_flags_start */
|    TODO_dump_func
|    | TODO_verify_all
|    | TODO_rebuild_frequencies
|    | TODO_update_ssa_any
|    | TODO_cleanup_cfg,                   /* todo_flags_finish */
|    0                                     /* letter */
| };
`----

After my pass I ran: 
dump_function_to_file(current_function_decl, stderr, TDF_DETAILS);

So I get in stderr:
,----
| g (nD.1176)
| {
| <bb 2>:
| Invalid sum of outgoing probabilities 0.0%
|   goto <bb 6>;
| 
| Invalid sum of incoming frequencies 0, should be 4600
| <L0>:;
|   f (&"1"[0]);
|   goto <bb 5>;
| 
| Invalid sum of incoming frequencies 0, should be 5400
| <L1>:;
|   f (&"default"[0]);
| 
| <bb 5>:
|   return;
| 
| <bb 6>:
| Invalid sum of outgoing probabilities 0.0%
|   if (n_1(D) == 1)
|     goto <bb 3> (<L0>);
|   else
|     goto <bb 4> (<L1>);
| 
| }
| 
| 
| test1.c: In function 'g':
| test1.c:7: error: dominator of 3 should be 6, not 2
| test1.c:7: error: dominator of 4 should be 6, not 2
| test1.c:7: error: dominator of 5 should be 6, not 2
| test1.c:7: error: dominator of 6 status unknown
| test1.c:7: internal compiler error: Segmentation fault
`----

The frequencies should be updated by the TODO so I am not worried.
How can I automatically update dominators? Or do I have to do it for
each new basic_block I create with recompute_dominator?

Cheers,

--
PMatos

Reply via email to