Commit 54cb4e20 by Tom de Vries Committed by Tom de Vries

Add missing edge probability in simd_clone_adjust

Currently we generate an if with probability set on only one of the two edges:
  <bb 5> [0.00%] [count: INV]:
  _5 = mask.3[iter.6_3];
  if (_5 == 0)
    goto <bb 6>; [INV] [count: INV]
  else
    goto <bb 2>; [100.00%] [count: INV]

Add the missing edge probability, and set the split to unlikely/likely:
  if (_5 == 0)
    goto <bb 6>; [19.99%] [count: INV]
  else
    goto <bb 2>; [80.01%] [count: INV]

2017-08-04  Tom de Vries  <tom@codesourcery.com>

	* omp-simd-clone.c (simd_clone_adjust): Add missing edge probability.

From-SVN: r250865
parent 07cf1466
2017-08-04 Tom de Vries <tom@codesourcery.com>
* omp-simd-clone.c (simd_clone_adjust): Add missing edge probability.
2017-08-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 2017-08-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
......
...@@ -1240,8 +1240,11 @@ simd_clone_adjust (struct cgraph_node *node) ...@@ -1240,8 +1240,11 @@ simd_clone_adjust (struct cgraph_node *node)
g = gimple_build_cond (EQ_EXPR, mask, build_zero_cst (TREE_TYPE (mask)), g = gimple_build_cond (EQ_EXPR, mask, build_zero_cst (TREE_TYPE (mask)),
NULL, NULL); NULL, NULL);
gsi_insert_after (&gsi, g, GSI_CONTINUE_LINKING); gsi_insert_after (&gsi, g, GSI_CONTINUE_LINKING);
make_edge (loop->header, incr_bb, EDGE_TRUE_VALUE); edge e = make_edge (loop->header, incr_bb, EDGE_TRUE_VALUE);
FALLTHRU_EDGE (loop->header)->flags = EDGE_FALSE_VALUE; e->probability = profile_probability::unlikely ().guessed ();
edge fallthru = FALLTHRU_EDGE (loop->header);
fallthru->flags = EDGE_FALSE_VALUE;
fallthru->probability = profile_probability::likely ().guessed ();
} }
basic_block latch_bb = NULL; basic_block latch_bb = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment