+2016-08-11 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-threadbackward.c (pass_data_thread_jumps): Remove
+ unconditional TODO_cleanup_cfg.
+ (pass_thread_jumps::execute): Initialize loops, perform a CFG
+ cleanup only if we threaded a jump.
+
2016-08-11 Alan Modra <amodra@gmail.com>
PR target/71680
+2016-08-11 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Adjust.
+
2016-08-11 Alan Modra <amodra@gmail.com>
* gcc.target/powerpc/pr71680.c: New.
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-thread1-stats -fdump-tree-thread2-stats -fdump-tree-thread3-stats -fdump-tree-dom3-stats -fdump-tree-vrp2-stats -fno-guess-branch-probability" } */
+/* { dg-options "-O2 -fdump-tree-thread1-stats -fdump-tree-thread2-stats -fdump-tree-dom2-stats -fdump-tree-thread3-stats -fdump-tree-dom3-stats -fdump-tree-vrp2-stats -fno-guess-branch-probability" } */
/* { dg-final { scan-tree-dump "Jumps threaded: 16" "thread1" } } */
-/* { dg-final { scan-tree-dump "Jumps threaded: 6" "thread2" } } */
+/* { dg-final { scan-tree-dump "Jumps threaded: 9" "thread2" } } */
/* { dg-final { scan-tree-dump "Jumps threaded: 3" "thread3" } } */
+/* { dg-final { scan-tree-dump-not "Jumps threaded" "dom2" } } */
/* { dg-final { scan-tree-dump-not "Jumps threaded" "dom3" } } */
/* { dg-final { scan-tree-dump-not "Jumps threaded" "vrp2" } } */
0,
0,
0,
- ( TODO_cleanup_cfg | TODO_update_ssa ),
+ TODO_update_ssa,
};
class pass_thread_jumps : public gimple_opt_pass
unsigned int
pass_thread_jumps::execute (function *fun)
{
+ loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES);
+
/* Try to thread each block with more than one successor. */
basic_block bb;
FOR_EACH_BB_FN (bb, fun)
if (EDGE_COUNT (bb->succs) > 1)
find_jump_threads_backwards (bb);
}
- thread_through_all_blocks (true);
- return 0;
+ bool changed = thread_through_all_blocks (true);
+
+ loop_optimizer_finalize ();
+ return changed ? TODO_cleanup_cfg : 0;
}
}