+2016-12-24 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-core.h (tree_base): Document the meaning of public_flag
+ for SSA names.
+ * tree.h (SSA_NAME_IS_VIRTUAL_OPERAND): New macro.
+ (SET_SSA_NAME_VAR_OR_IDENTIFIER): Record whether the variable
+ is a virtual operand.
+ * gimple-expr.h (virtual_operand_p): Use SSA_NAME_IS_VIRTUAL_OPERAND.
+
2016-12-22 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* tree-pretty-print.c (dump_generic_node): Change dump format for
virtual_operand_p (tree op)
{
if (TREE_CODE (op) == SSA_NAME)
- {
- op = SSA_NAME_VAR (op);
- if (!op)
- return false;
- }
+ return SSA_NAME_IS_VIRTUAL_OPERAND (op);
if (TREE_CODE (op) == VAR_DECL)
return VAR_DECL_IS_VIRTUAL_OPERAND (op);
/* SSA_NAME accessors. */
+/* Whether SSA_NAME NODE is a virtual operand. This simply caches the
+ information in the underlying SSA_NAME_VAR for efficiency. */
+#define SSA_NAME_IS_VIRTUAL_OPERAND(NODE) \
+ SSA_NAME_CHECK (NODE)->base.public_flag
+
/* Returns the IDENTIFIER_NODE giving the SSA name a name or NULL_TREE
if there is no name associated with it. */
#define SSA_NAME_IDENTIFIER(NODE) \
? NULL_TREE : (NODE)->ssa_name.var)
#define SET_SSA_NAME_VAR_OR_IDENTIFIER(NODE,VAR) \
- do { SSA_NAME_CHECK (NODE)->ssa_name.var = (VAR); } while (0)
+ do \
+ { \
+ tree var_ = (VAR); \
+ SSA_NAME_CHECK (NODE)->ssa_name.var = var_; \
+ SSA_NAME_IS_VIRTUAL_OPERAND (NODE) \
+ = (var_ \
+ && TREE_CODE (var_) == VAR_DECL \
+ && VAR_DECL_IS_VIRTUAL_OPERAND (var_)); \
+ } \
+ while (0)
/* Returns the statement which defines this SSA name. */
#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->ssa_name.def_stmt