aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dse.c
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2019-10-07 23:44:49 +0000
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>2019-10-07 23:44:49 +0000
commitb238b34ea47222ffca7addc5fe4e8c052ade88b3 (patch)
tree45203ecc92dbec87d0c66cc74bce887c2b158735 /gcc/tree-ssa-dse.c
parentcac52161c501abb93ded17a8f41b4a6310dbdab0 (diff)
downloadgcc-b238b34ea47222ffca7addc5fe4e8c052ade88b3.zip
gcc-b238b34ea47222ffca7addc5fe4e8c052ade88b3.tar.gz
gcc-b238b34ea47222ffca7addc5fe4e8c052ade88b3.tar.bz2
re PR tree-optimization/91532 ([SVE] Redundant predicated store in gcc.target/aarch64/fmla_2.c)
2019-10-07 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Richard Biener <rguenther@suse.de> PR tree-optimization/91532 * tree-if-conv.c: Include tree-ssa-dse.h. (ifcvt_local_dce): Change param from bb to loop, and call dse_classify_store. (tree_if_conversion): Pass loop instead of loop->header as arg to ifcvt_local_dce. * tree-ssa-dse.c: Include tree-ssa-dse.h. (delete_dead_or_redundant_assignment): Remove static qualifier from declaration, and add prototype in tree-ssa-dse.h. (dse_store_status): Move to tree-ssa-dse.h. (dse_classify_store): Remove static qualifier and add new tree param stop_at_vuse, and add prototype in tree-ssa-dse.h. * tree-ssa-dse.h: New header. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r276681
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r--gcc/tree-ssa-dse.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index ba67884..d8f7089 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "alias.h"
#include "tree-ssa-loop.h"
+#include "tree-ssa-dse.h"
/* This file implements dead store elimination.
@@ -76,21 +77,13 @@ along with GCC; see the file COPYING3. If not see
fact, they are the same transformation applied to different views of
the CFG. */
-static void delete_dead_or_redundant_assignment (gimple_stmt_iterator *, const char *);
+void delete_dead_or_redundant_assignment (gimple_stmt_iterator *, const char *);
static void delete_dead_or_redundant_call (gimple_stmt_iterator *, const char *);
/* Bitmap of blocks that have had EH statements cleaned. We should
remove their dead edges eventually. */
static bitmap need_eh_cleanup;
-/* Return value from dse_classify_store */
-enum dse_store_status
-{
- DSE_STORE_LIVE,
- DSE_STORE_MAYBE_PARTIAL_DEAD,
- DSE_STORE_DEAD
-};
-
/* STMT is a statement that may write into memory. Analyze it and
initialize WRITE to describe how STMT affects memory.
@@ -662,10 +655,10 @@ dse_optimize_redundant_stores (gimple *stmt)
if only clobber statements influenced the classification result.
Returns the classification. */
-static dse_store_status
+dse_store_status
dse_classify_store (ao_ref *ref, gimple *stmt,
bool byte_tracking_enabled, sbitmap live_bytes,
- bool *by_clobber_p = NULL)
+ bool *by_clobber_p, tree stop_at_vuse)
{
gimple *temp;
int cnt = 0;
@@ -701,6 +694,11 @@ dse_classify_store (ao_ref *ref, gimple *stmt,
}
else
defvar = gimple_vdef (temp);
+
+ /* If we're instructed to stop walking at region boundary, do so. */
+ if (defvar == stop_at_vuse)
+ return DSE_STORE_LIVE;
+
auto_vec<gimple *, 10> defs;
gimple *phi_def = NULL;
FOR_EACH_IMM_USE_STMT (use_stmt, ui, defvar)
@@ -901,7 +899,7 @@ delete_dead_or_redundant_call (gimple_stmt_iterator *gsi, const char *type)
/* Delete a dead store at GSI, which is a gimple assignment. */
-static void
+void
delete_dead_or_redundant_assignment (gimple_stmt_iterator *gsi, const char *type)
{
gimple *stmt = gsi_stmt (*gsi);