summaryrefslogtreecommitdiff
path: root/gcc/gimple-expr.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2016-12-24 14:30:18 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2016-12-24 14:30:18 +0000
commite7960be786ae786c6fc2ec48480bfb279c6d99e2 (patch)
treec7c60297d704befab04918f7214aaabe3e997af7 /gcc/gimple-expr.h
parent284a35df5d759e4ed0c7e03b5354dbfafddd67df (diff)
Make it cheaper to test whether an SSA name is a virtual operand
virtual_operand_p handled SSA names by looking at the flags of the underlying variable. This seems to be a relatively common source of cache misses, mainly because virtual_operand_p is the first thing tested by is_gimple_reg. This patch caches the information in the SSA name itself. Several flags seem to be free so the patch arbitrarily uses public_flag. Tested on aarch64-linux-gnu and x86_64-linux-gnu. It improves compile time by a small (<1%) but reproducable amount on the tests I've tried. gcc/ * 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. From-SVN: r243916
Diffstat (limited to 'gcc/gimple-expr.h')
-rw-r--r--gcc/gimple-expr.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/gimple-expr.h b/gcc/gimple-expr.h
index f2ccd29a94a..faf4c53db30 100644
--- a/gcc/gimple-expr.h
+++ b/gcc/gimple-expr.h
@@ -105,11 +105,7 @@ static inline bool
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);