public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [GCC RFC]Expensive internal function calls.
@ 2017-08-18 10:10 Bin Cheng
  2017-08-18 10:18 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Cheng @ 2017-08-18 10:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

Hi,
As a followup patch for fix to PR81832, this patch considers internal function call to
IFN_LOOP_DIST_ALIAS and IFN_LOOP_VECTORIZED as expensive.  Or interpreted
in another way: return false since we shouldn't be asked the question?  Any comments?
BTW, I have no problem to drop this if not appropriate.

Thanks,
bin
2017-08-16  Bin Cheng  <bin.cheng@arm.com>

	* gimple.c (gimple_inexpensive_call_p): Consider IFN_LOOP_DIST_ALIAS
	and IFN_LOOP_VECTORIZED as expensive calls.

[-- Attachment #2: expensive-ifn-calls.txt --]
[-- Type: text/plain, Size: 711 bytes --]

diff --git a/gcc/gimple.c b/gcc/gimple.c
index c4e6f81..6d4e376 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3038,7 +3038,16 @@ bool
 gimple_inexpensive_call_p (gcall *stmt)
 {
   if (gimple_call_internal_p (stmt))
-    return true;
+    {
+      /* Some internal function calls are only meant to indicate temporary
+	 arrangement of optimization and are never used in code generation.
+	 We always consider these calls expensive.  */
+      if (gimple_call_internal_p (stmt, IFN_LOOP_DIST_ALIAS)
+	  || gimple_call_internal_p (stmt, IFN_LOOP_VECTORIZED))
+	return false;
+
+      return true;
+    }
   tree decl = gimple_call_fndecl (stmt);
   if (decl && is_inexpensive_builtin (decl))
     return true;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GCC RFC]Expensive internal function calls.
  2017-08-18 10:10 [GCC RFC]Expensive internal function calls Bin Cheng
@ 2017-08-18 10:18 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2017-08-18 10:18 UTC (permalink / raw)
  To: Bin Cheng; +Cc: gcc-patches, nd

On Fri, Aug 18, 2017 at 10:45 AM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> As a followup patch for fix to PR81832, this patch considers internal function call to
> IFN_LOOP_DIST_ALIAS and IFN_LOOP_VECTORIZED as expensive.  Or interpreted
> in another way: return false since we shouldn't be asked the question?  Any comments?
> BTW, I have no problem to drop this if not appropriate.

I think as the meaning is to cost the actual call making it expensive
is wrong given it
will end up as constant.  So, no, this doesn't look correct.

Richard.

> Thanks,
> bin
> 2017-08-16  Bin Cheng  <bin.cheng@arm.com>
>
>         * gimple.c (gimple_inexpensive_call_p): Consider IFN_LOOP_DIST_ALIAS
>         and IFN_LOOP_VECTORIZED as expensive calls.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-18  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 10:10 [GCC RFC]Expensive internal function calls Bin Cheng
2017-08-18 10:18 ` 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).