]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/gimple-expr.h
Make it cheaper to test whether an SSA name is a virtual operand
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 24 Dec 2016 14:30:18 +0000 (14:30 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 24 Dec 2016 14:30:18 +0000 (14:30 +0000)
commite7960be786ae786c6fc2ec48480bfb279c6d99e2
treec7c60297d704befab04918f7214aaabe3e997af7
parent284a35df5d759e4ed0c7e03b5354dbfafddd67df
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
gcc/ChangeLog
gcc/gimple-expr.h
gcc/tree-core.h
gcc/tree.h