aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-10-25 14:03:24 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-10-25 14:03:24 +0000
commit4dd7c0dcd87c86aad3d2cd45a08798eb445a9d3c (patch)
tree234adacda48bf7de4f23080af42ed731757ecf2f /gcc/tree-if-conv.c
parentcd747405e4cb332d639b248be140424b5e06b609 (diff)
downloadgcc-4dd7c0dcd87c86aad3d2cd45a08798eb445a9d3c.zip
gcc-4dd7c0dcd87c86aad3d2cd45a08798eb445a9d3c.tar.gz
gcc-4dd7c0dcd87c86aad3d2cd45a08798eb445a9d3c.tar.bz2
tree-if-conv.c: Include tree-ssa-sccvn.h.
2018-10-25 Richard Biener <rguenther@suse.de> * tree-if-conv.c: Include tree-ssa-sccvn.h. (tree_if_conversion): Run CSE on the if-converted loop body. From-SVN: r265489
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 52aa575..0ef7daa 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -118,6 +118,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfganal.h"
#include "internal-fn.h"
#include "fold-const.h"
+#include "tree-ssa-sccvn.h"
/* Only handle PHIs with no more arguments unless we are asked to by
simd pragma. */
@@ -2979,6 +2980,7 @@ tree_if_conversion (struct loop *loop)
unsigned int todo = 0;
bool aggressive_if_conv;
struct loop *rloop;
+ bitmap exit_bbs;
again:
rloop = NULL;
@@ -3056,6 +3058,14 @@ tree_if_conversion (struct loop *loop)
/* Delete dead predicate computations. */
ifcvt_local_dce (loop->header);
+ /* Perform local CSE, this esp. helps the vectorizer analysis if loads
+ and stores are involved.
+ ??? We'll still keep dead stores though. */
+ exit_bbs = BITMAP_ALLOC (NULL);
+ bitmap_set_bit (exit_bbs, single_exit (loop)->dest->index);
+ todo |= do_rpo_vn (cfun, loop_preheader_edge (loop), exit_bbs);
+ BITMAP_FREE (exit_bbs);
+
todo |= TODO_cleanup_cfg;
cleanup: