+2018-02-01 Richard Biener <rguenther@suse.de>
+
+ * domwalk.h (dom_walker::dom_walker): Add additional constructor
+ for specifying RPO order and allow NULL for that.
+ * domwalk.c (dom_walker::dom_walker): Likewise.
+ (dom_walker::walk): Handle NULL RPO order.
+ * tree-into-ssa.c (rewrite_dom_walker): Do not walk dom children
+ in RPO order.
+ (rewrite_update_dom_walker): Likewise.
+ (mark_def_dom_walker): Likewise.
+
2018-02-01 Richard Sandiford <richard.sandiford@linaro.org>
* config/aarch64/aarch64-protos.h (aarch64_split_sve_subreg_move)
int *bb_index_to_rpo)
: m_dom_direction (direction),
m_skip_unreachable_blocks (reachability != ALL_BLOCKS),
- m_user_bb_to_rpo (bb_index_to_rpo != NULL),
+ m_user_bb_to_rpo (true),
m_unreachable_dom (NULL),
m_bb_to_rpo (bb_index_to_rpo)
{
- /* Compute the basic-block index to RPO mapping if not provided by
- the user. */
- if (! m_bb_to_rpo && direction == CDI_DOMINATORS)
+ /* Set up edge flags if need be. */
+ switch (reachability)
+ {
+ default:
+ gcc_unreachable ();
+ case ALL_BLOCKS:
+ /* No need to touch edge flags. */
+ break;
+
+ case REACHABLE_BLOCKS:
+ set_all_edges_as_executable (cfun);
+ break;
+
+ case REACHABLE_BLOCKS_PRESERVING_FLAGS:
+ /* Preserve the edge flags. */
+ break;
+ }
+}
+
+/* Constructor for a dom walker. */
+
+dom_walker::dom_walker (cdi_direction direction,
+ enum reachability reachability)
+ : m_dom_direction (direction),
+ m_skip_unreachable_blocks (reachability != ALL_BLOCKS),
+ m_user_bb_to_rpo (false),
+ m_unreachable_dom (NULL),
+ m_bb_to_rpo (NULL)
+{
+ /* Compute the basic-block index to RPO mapping. */
+ if (direction == CDI_DOMINATORS)
{
int *postorder = XNEWVEC (int, n_basic_blocks_for_fn (cfun));
int postorder_num = pre_and_rev_post_order_compute (NULL, postorder,
for (dest = first_dom_son (m_dom_direction, bb);
dest; dest = next_dom_son (m_dom_direction, dest))
worklist[sp++] = dest;
- if (sp - saved_sp > 1 && m_dom_direction == CDI_DOMINATORS)
+ /* Sort worklist after RPO order if requested. */
+ if (sp - saved_sp > 1
+ && m_dom_direction == CDI_DOMINATORS
+ && m_bb_to_rpo)
sort_bbs_postorder (&worklist[saved_sp], sp - saved_sp);
}
}
REACHABLE_BLOCKS_PRESERVING_FLAGS
};
+ dom_walker (cdi_direction direction, enum reachability = ALL_BLOCKS);
+
/* You can provide a mapping of basic-block index to RPO if you
- have that readily available or you do multiple walks. */
- dom_walker (cdi_direction direction, enum reachability = ALL_BLOCKS,
- int *bb_index_to_rpo = NULL);
+ have that readily available or you do multiple walks. If you
+ specify NULL as BB_INDEX_TO_RPO dominator children will not be
+ walked in RPO order. */
+ dom_walker (cdi_direction direction, enum reachability, int *bb_index_to_rpo);
~dom_walker ();
+2018-02-01 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/graphite/pr35356-1.c: Adjust.
+
2018-02-01 Richard Sandiford <richard.sandiford@linaro.org>
PR testsuite/83846
*/
-/* { dg-final { scan-tree-dump "if \\\(P_8 >= P_11 \\\+ 1 && P_11 >= 0\\\) \\\{" "graphite" } } */
+/* { dg-final { scan-tree-dump "if \\\(P_\[0-9\]+ >= P_\[0-9\]+ \\\+ 1 && P_\[0-9\]+ >= 0\\\) \\\{" "graphite" } } */
class rewrite_dom_walker : public dom_walker
{
public:
- rewrite_dom_walker (cdi_direction direction) : dom_walker (direction) {}
+ rewrite_dom_walker (cdi_direction direction)
+ : dom_walker (direction, ALL_BLOCKS, NULL) {}
virtual edge before_dom_children (basic_block);
virtual void after_dom_children (basic_block);
class rewrite_update_dom_walker : public dom_walker
{
public:
- rewrite_update_dom_walker (cdi_direction direction) : dom_walker (direction) {}
+ rewrite_update_dom_walker (cdi_direction direction)
+ : dom_walker (direction, ALL_BLOCKS, NULL) {}
virtual edge before_dom_children (basic_block);
virtual void after_dom_children (basic_block);
};
mark_def_dom_walker::mark_def_dom_walker (cdi_direction direction)
- : dom_walker (direction), m_kills (BITMAP_ALLOC (NULL))
+ : dom_walker (direction, ALL_BLOCKS, NULL), m_kills (BITMAP_ALLOC (NULL))
{
}