diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-05-27 06:37:48 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-05-27 04:37:48 +0000 |
commit | 6acd8c92ef9e9ff26daff5082a16e196b482f340 (patch) | |
tree | ea338a500918a1d1d64a97ad09facc865389ae97 /gcc/ipa-polymorphic-call.c | |
parent | c6b8c3adf9880dcaad5eed5257cd688c2ab7bf94 (diff) | |
download | gcc-6acd8c92ef9e9ff26daff5082a16e196b482f340.zip gcc-6acd8c92ef9e9ff26daff5082a16e196b482f340.tar.gz gcc-6acd8c92ef9e9ff26daff5082a16e196b482f340.tar.bz2 |
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::get_dynamic_type): Short circuit the
case when call target is already known.
From-SVN: r223733
Diffstat (limited to 'gcc/ipa-polymorphic-call.c')
-rw-r--r-- | gcc/ipa-polymorphic-call.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c index b69f541..1a82bb7 100644 --- a/gcc/ipa-polymorphic-call.c +++ b/gcc/ipa-polymorphic-call.c @@ -1561,6 +1561,11 @@ ipa_polymorphic_call_context::get_dynamic_type (tree instance, ref = OBJ_TYPE_REF_EXPR (ref); ref = walk_ssa_copies (ref); + /* If call target is already known, no need to do the expensive + memory walk. */ + if (is_gimple_min_invariant (ref)) + return false; + /* Check if definition looks like vtable lookup. */ if (TREE_CODE (ref) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (ref) |