public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-72] Assume a call is expensive when it mismatches
@ 2022-05-02 12:59 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-05-02 12:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1cb220498e1f59021dab36c39c5d726e9f070c6a

commit r13-72-g1cb220498e1f59021dab36c39c5d726e9f070c6a
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 13 15:43:01 2022 +0200

    Assume a call is expensive when it mismatches
    
    This makes sure to not consider calls to builtin decls with
    mismatching arguments as inexpensive.
    
    2022-04-13  Richard Biener  <rguenther@suse.de>
    
            * tree-scalar-evolution.cc (expression_expensive_p):
            Never consider mismatched calls as cheap.

Diff:
---
 gcc/tree-scalar-evolution.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc
index 44157265ce8..b53d7aaa71d 100644
--- a/gcc/tree-scalar-evolution.cc
+++ b/gcc/tree-scalar-evolution.cc
@@ -3420,12 +3420,15 @@ expression_expensive_p (tree expr, hash_map<tree, uint64_t> &cache,
 		  break;
 	      return true;
 	    }
+	  break;
+
 	default:
+	  if (cfn == CFN_LAST
+	      || !is_inexpensive_builtin (get_callee_fndecl (expr)))
+	    return true;
 	  break;
 	}
 
-      if (!is_inexpensive_builtin (get_callee_fndecl (expr)))
-	return true;
       FOR_EACH_CALL_EXPR_ARG (arg, iter, expr)
 	if (expression_expensive_p (arg, cache, op_cost))
 	  return true;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-02 12:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 12:59 [gcc r13-72] Assume a call is expensive when it mismatches Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).