tree-vect-loop.c (optimize_mask_stores): Add bb to the right loop.

* tree-vect-loop.c (optimize_mask_stores): Add bb to the right
	loop.

From-SVN: r246541
This commit is contained in:
Bin Cheng 2017-03-28 15:35:56 +00:00 committed by Bin Cheng
parent 3e907b9056
commit 9d384e80bd
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2017-03-28 Bin Cheng <bin.cheng@arm.com>
* tree-vect-loop.c (optimize_mask_stores): Add bb to the right
loop.
2017-03-28 Bin Cheng <bin.cheng@arm.com>
* tree-vect-loop-manip.c (slpeel_add_loop_guard): New param and

View File

@ -7229,6 +7229,7 @@ optimize_mask_stores (struct loop *loop)
unsigned nbbs = loop->num_nodes;
unsigned i;
basic_block bb;
struct loop *bb_loop;
gimple_stmt_iterator gsi;
gimple *stmt;
auto_vec<gimple *> worklist;
@ -7267,11 +7268,16 @@ optimize_mask_stores (struct loop *loop)
last = worklist.pop ();
mask = gimple_call_arg (last, 2);
bb = gimple_bb (last);
/* Create new bb. */
/* Create then_bb and if-then structure in CFG, then_bb belongs to
the same loop as if_bb. It could be different to LOOP when two
level loop-nest is vectorized and mask_store belongs to the inner
one. */
e = split_block (bb, last);
bb_loop = bb->loop_father;
gcc_assert (loop == bb_loop || flow_loop_nested_p (loop, bb_loop));
join_bb = e->dest;
store_bb = create_empty_bb (bb);
add_bb_to_loop (store_bb, loop);
add_bb_to_loop (store_bb, bb_loop);
e->flags = EDGE_TRUE_VALUE;
efalse = make_edge (bb, store_bb, EDGE_FALSE_VALUE);
/* Put STORE_BB to likely part. */