Commit a12cbc57 by Jeff Law Committed by Jeff Law

[PATCH] Minor cleanup of const_and_copies stack

	* tree-ssa-scopedtables.c (const_and_copies::const_and_copies): Remove
	unnecessary constructor.  It's now trivial and implemented inside...
	* tree-ssa-scopedtables.h (const_and_copies): Implement trivial
	constructor.  Add comments to various methods.  Remove unused
	private fields.
	* tree-ssa-dom.c (pass_dominator::execute): Corresponding changes.
	* tree-vrp.c (identify_jump_threads): Likewise.
	* tree-ssa-threadedge.c (thread_through_normal_block): Fix minor
	indentation issues.
	(thread_across_edge): Similarly.
	(record_temporary_equivalences_from_stmts_at_dest): Remove unused
	arguments in constructor call.

From-SVN: r227493
parent 0417fe49
2015-09-04 Jeff Law <law@redhat.com>
* tree-ssa-scopedtables.c (const_and_copies::const_and_copies): Remove
unnecessary constructor. It's now trivial and implemented inside...
* tree-ssa-scopedtables.h (const_and_copies): Implement trivial
constructor. Add comments to various methods. Remove unused
private fields.
* tree-ssa-dom.c (pass_dominator::execute): Corresponding changes.
* tree-vrp.c (identify_jump_threads): Likewise.
* tree-ssa-threadedge.c (thread_through_normal_block): Fix minor
indentation issues.
(thread_across_edge): Similarly.
(record_temporary_equivalences_from_stmts_at_dest): Remove unused
arguments in constructor call.
2015-09-04 Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> 2015-09-04 Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
* config/i386/intelmic-mkoffload.c (prepare_target_image): Fix if the * config/i386/intelmic-mkoffload.c (prepare_target_image): Fix if the
......
...@@ -1168,7 +1168,7 @@ pass_dominator::execute (function *fun) ...@@ -1168,7 +1168,7 @@ pass_dominator::execute (function *fun)
/* Create our hash tables. */ /* Create our hash tables. */
avail_exprs = new hash_table<expr_elt_hasher> (1024); avail_exprs = new hash_table<expr_elt_hasher> (1024);
avail_exprs_stack.create (20); avail_exprs_stack.create (20);
const_and_copies = new class const_and_copies (dump_file, dump_flags); const_and_copies = new class const_and_copies ();
need_eh_cleanup = BITMAP_ALLOC (NULL); need_eh_cleanup = BITMAP_ALLOC (NULL);
need_noreturn_fixup.create (0); need_noreturn_fixup.create (0);
......
...@@ -28,13 +28,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -28,13 +28,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-scopedtables.h" #include "tree-ssa-scopedtables.h"
#include "tree-ssa-threadedge.h" #include "tree-ssa-threadedge.h"
const_and_copies::const_and_copies (FILE *file, int flags)
{
stack.create (20);
dump_file = file;
dump_flags = flags;
}
/* Pop entries off the stack until we hit the NULL marker. /* Pop entries off the stack until we hit the NULL marker.
For each entry popped, use the SRC/DEST pair to restore For each entry popped, use the SRC/DEST pair to restore
SRC to its prior value. */ SRC to its prior value. */
......
...@@ -23,18 +23,31 @@ along with GCC; see the file COPYING3. If not see ...@@ -23,18 +23,31 @@ along with GCC; see the file COPYING3. If not see
class const_and_copies class const_and_copies
{ {
public: public:
const_and_copies (FILE *, int); const_and_copies (void) { stack.create (20); };
~const_and_copies (void) { stack.release (); } ~const_and_copies (void) { stack.release (); }
/* Push the unwinding marker onto the stack. */
void push_marker (void) { stack.safe_push (NULL_TREE); } void push_marker (void) { stack.safe_push (NULL_TREE); }
/* Restore the const/copies table to its state whe the last marker
was pushed. */
void pop_to_marker (void); void pop_to_marker (void);
/* Record a single const/copy pair that can be unwound. */
void record_const_or_copy (tree, tree); void record_const_or_copy (tree, tree);
/* Special entry point when we want to provide an explicit previous
value for the first argument. Try to get rid of this in the future. */
void record_const_or_copy (tree, tree, tree); void record_const_or_copy (tree, tree, tree);
/* When threading we need to invalidate certain equivalences after
following a loop backedge. The entries we need to invalidate will
always be in this unwindable stack. This entry point handles
finding and invalidating those entries. */
void invalidate (tree); void invalidate (tree);
private: private:
vec<tree> stack; vec<tree> stack;
FILE *dump_file;
int dump_flags;
}; };
#endif /* GCC_TREE_SSA_SCOPED_TABLES_H */ #endif /* GCC_TREE_SSA_SCOPED_TABLES_H */
...@@ -432,7 +432,8 @@ record_temporary_equivalences_from_stmts_at_dest (edge e, ...@@ -432,7 +432,8 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
if (cached_lhs if (cached_lhs
&& (TREE_CODE (cached_lhs) == SSA_NAME && (TREE_CODE (cached_lhs) == SSA_NAME
|| is_gimple_min_invariant (cached_lhs))) || is_gimple_min_invariant (cached_lhs)))
const_and_copies->record_const_or_copy (gimple_get_lhs (stmt), cached_lhs); const_and_copies->record_const_or_copy (gimple_get_lhs (stmt),
cached_lhs);
else if (backedge_seen) else if (backedge_seen)
const_and_copies->invalidate (gimple_get_lhs (stmt)); const_and_copies->invalidate (gimple_get_lhs (stmt));
} }
...@@ -1208,7 +1209,8 @@ thread_through_normal_block (edge e, ...@@ -1208,7 +1209,8 @@ thread_through_normal_block (edge e,
/* Now walk each statement recording any context sensitive /* Now walk each statement recording any context sensitive
temporary equivalences we can detect. */ temporary equivalences we can detect. */
gimple stmt gimple stmt
= record_temporary_equivalences_from_stmts_at_dest (e, const_and_copies, simplify, = record_temporary_equivalences_from_stmts_at_dest (e, const_and_copies,
simplify,
*backedge_seen_p); *backedge_seen_p);
/* There's two reasons STMT might be null, and distinguishing /* There's two reasons STMT might be null, and distinguishing
...@@ -1474,8 +1476,8 @@ thread_across_edge (gcond *dummy_cond, ...@@ -1474,8 +1476,8 @@ thread_across_edge (gcond *dummy_cond,
if (!found) if (!found)
found = thread_through_normal_block (path->last ()->e, dummy_cond, found = thread_through_normal_block (path->last ()->e, dummy_cond,
handle_dominating_asserts, handle_dominating_asserts,
const_and_copies, simplify, path, visited, const_and_copies, simplify, path,
&backedge_seen) > 0; visited, &backedge_seen) > 0;
/* If we were able to thread through a successor of E->dest, then /* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */ record the jump threading opportunity. */
......
...@@ -10149,7 +10149,7 @@ identify_jump_threads (void) ...@@ -10149,7 +10149,7 @@ identify_jump_threads (void)
/* Allocate our unwinder stack to unwind any temporary equivalences /* Allocate our unwinder stack to unwind any temporary equivalences
that might be recorded. */ that might be recorded. */
equiv_stack = new const_and_copies (dump_file, dump_flags); equiv_stack = new const_and_copies ();
/* To avoid lots of silly node creation, we create a single /* To avoid lots of silly node creation, we create a single
conditional and just modify it in-place when attempting to conditional and just modify it in-place when attempting to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment