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.ch...@arm.com>

        * gimple.c (gimple_inexpensive_call_p): Consider IFN_LOOP_DIST_ALIAS
        and IFN_LOOP_VECTORIZED as expensive calls.
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;

Reply via email to