ipa-inline-analysis.c (find_foldable_builtin_expect): Use gimple_call_internal_p.
authorMarek Polacek <polacek@redhat.com>
Mon, 26 Sep 2016 15:50:13 +0000 (15:50 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 26 Sep 2016 15:50:13 +0000 (15:50 +0000)
* ipa-inline-analysis.c (find_foldable_builtin_expect): Use
gimple_call_internal_p.
* ipa-split.c (find_return_bb): Likewise.
(execute_split_functions): Likewise.
* omp-low.c (dump_oacc_loop_part): Likewise.
(oacc_loop_xform_head_tail): Likewise.
* predict.c (predict_loops): Likewise.
* sanopt.c (pass_sanopt::execute): Likewise.
* tree-cfg.c (get_abnormal_succ_dispatcher): Likewise.
* tree-parloops.c (oacc_entry_exit_ok_1): Likewise.
* tree-stdarg.c (gimple_call_ifn_va_arg_p): Remove function.
(expand_ifn_va_arg_1): Use gimple_call_internal_p.
(expand_ifn_va_arg): Likewise.
* tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
(optimize_mask_stores): Likewise.
* tree-vect-stmts.c (vect_simd_lane_linear): Likewise.
(vect_transform_stmt): Likewise.
* tree-vectorizer.c (vect_loop_vectorized_call): Likewise.
* tsan.c (instrument_memory_accesses): Likewise.

From-SVN: r240498

13 files changed:
gcc/ChangeLog
gcc/ipa-inline-analysis.c
gcc/ipa-split.c
gcc/omp-low.c
gcc/predict.c
gcc/sanopt.c
gcc/tree-cfg.c
gcc/tree-parloops.c
gcc/tree-stdarg.c
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.c
gcc/tsan.c

index cfccbb460eab93102a31624137e7b183b4de548c..9427b50600776d6d6fc6396a389a14216a2ec00a 100644 (file)
@@ -1,3 +1,25 @@
+2016-09-26  Marek Polacek  <polacek@redhat.com>
+
+       * ipa-inline-analysis.c (find_foldable_builtin_expect): Use
+       gimple_call_internal_p.
+       * ipa-split.c (find_return_bb): Likewise.
+       (execute_split_functions): Likewise.
+       * omp-low.c (dump_oacc_loop_part): Likewise.
+       (oacc_loop_xform_head_tail): Likewise.
+       * predict.c (predict_loops): Likewise.
+       * sanopt.c (pass_sanopt::execute): Likewise.
+       * tree-cfg.c (get_abnormal_succ_dispatcher): Likewise.
+       * tree-parloops.c (oacc_entry_exit_ok_1): Likewise.
+       * tree-stdarg.c (gimple_call_ifn_va_arg_p): Remove function.
+       (expand_ifn_va_arg_1): Use gimple_call_internal_p.
+       (expand_ifn_va_arg): Likewise.
+       * tree-vect-loop.c (vect_determine_vectorization_factor): Likewise.
+       (optimize_mask_stores): Likewise.
+       * tree-vect-stmts.c (vect_simd_lane_linear): Likewise.
+       (vect_transform_stmt): Likewise.
+       * tree-vectorizer.c (vect_loop_vectorized_call): Likewise.
+       * tsan.c (instrument_memory_accesses): Likewise.
+
 2016-09-26  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
             Alexander Monakov  <amonakov@ispras.ru>
 
index 132779d2621f5548afac45453bf96e1ad6a49d8e..8228e8ae3e8a272046a85841b49cf10b86a72f10 100644 (file)
@@ -2398,9 +2398,7 @@ find_foldable_builtin_expect (basic_block bb)
     {
       gimple *stmt = gsi_stmt (bsi);
       if (gimple_call_builtin_p (stmt, BUILT_IN_EXPECT)
-         || (is_gimple_call (stmt)
-             && gimple_call_internal_p (stmt)
-             && gimple_call_internal_fn (stmt) == IFN_BUILTIN_EXPECT))
+         || gimple_call_internal_p (stmt, IFN_BUILTIN_EXPECT))
         {
           tree var = gimple_call_lhs (stmt);
           tree arg = gimple_call_arg (stmt, 0);
index ac8b4787b100394845772fa0211078a1add3aeb9..0c25fcae59fa801e5ffdff5ba22725316610757d 100644 (file)
@@ -788,9 +788,7 @@ find_return_bb (void)
       /* For -fsanitize=thread, allow also TSAN_FUNC_EXIT () in the return
         bb.  */
       else if ((flag_sanitize & SANITIZE_THREAD)
-              && is_gimple_call (stmt)
-              && gimple_call_internal_p (stmt)
-              && gimple_call_internal_fn (stmt) == IFN_TSAN_FUNC_EXIT)
+              && gimple_call_internal_p (stmt, IFN_TSAN_FUNC_EXIT))
        ;
       else
        break;
@@ -1840,9 +1838,7 @@ execute_split_functions (void)
            }
 
          if ((flag_sanitize & SANITIZE_THREAD)
-             && is_gimple_call (stmt)
-             && gimple_call_internal_p (stmt)
-             && gimple_call_internal_fn (stmt) == IFN_TSAN_FUNC_EXIT)
+             && gimple_call_internal_p (stmt, IFN_TSAN_FUNC_EXIT))
            {
              /* We handle TSAN_FUNC_EXIT for splitting either in the
                 return_bb, or in its immediate predecessors.  */
index bf52d849d9e345fa6db82ce5fc9cdfc290d066bc..422f2b20c3701cf1e16246fe7ea199874e6da07a 100644 (file)
@@ -19047,9 +19047,7 @@ dump_oacc_loop_part (FILE *file, gcall *from, int depth,
     {
       gimple *stmt = gsi_stmt (gsi);
 
-      if (is_gimple_call (stmt)
-         && gimple_call_internal_p (stmt)
-         && gimple_call_internal_fn (stmt) == IFN_UNIQUE)
+      if (gimple_call_internal_p (stmt, IFN_UNIQUE))
        {
          enum ifn_unique_kind k
            = ((enum ifn_unique_kind) TREE_INT_CST_LOW
@@ -19271,10 +19269,8 @@ oacc_loop_xform_head_tail (gcall *from, int level)
   for (gimple_stmt_iterator gsi = gsi_for_stmt (from);;)
     {
       gimple *stmt = gsi_stmt (gsi);
-      
-      if (is_gimple_call (stmt)
-         && gimple_call_internal_p (stmt)
-         && gimple_call_internal_fn (stmt) == IFN_UNIQUE)
+
+      if (gimple_call_internal_p (stmt, IFN_UNIQUE))
        {
          enum ifn_unique_kind k
            = ((enum ifn_unique_kind)
@@ -19285,9 +19281,7 @@ oacc_loop_xform_head_tail (gcall *from, int level)
          else if (k == kind && stmt != from)
            break;
        }
-      else if (is_gimple_call (stmt)
-              && gimple_call_internal_p (stmt)
-              && gimple_call_internal_fn (stmt) == IFN_GOACC_REDUCTION)
+      else if (gimple_call_internal_p (stmt, IFN_GOACC_REDUCTION))
        *gimple_call_arg_ptr (stmt, 3) = replacement;
 
       gsi_next (&gsi);
index b3d169770c99d384cd3d7da4e2705d1cf153a704..463fd0b610e5f9b0d750939a6398ee551777c461 100644 (file)
@@ -2024,9 +2024,7 @@ predict_loops (void)
                   && gimple_expr_code (call_stmt) == NOP_EXPR
                   && TREE_CODE (gimple_assign_rhs1 (call_stmt)) == SSA_NAME)
                 call_stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (call_stmt));
-              if (gimple_code (call_stmt) == GIMPLE_CALL
-                  && gimple_call_internal_p (call_stmt)
-                  && gimple_call_internal_fn (call_stmt) == IFN_BUILTIN_EXPECT
+              if (gimple_call_internal_p (call_stmt, IFN_BUILTIN_EXPECT)
                   && TREE_CODE (gimple_call_arg (call_stmt, 2)) == INTEGER_CST
                   && tree_fits_uhwi_p (gimple_call_arg (call_stmt, 2))
                   && tree_to_uhwi (gimple_call_arg (call_stmt, 2))
index eeb4cd00de0c8c29ab15a64a7db1996f58dcb728..27c43da539f92ac59a7abc1d011f00bab3109356 100644 (file)
@@ -686,8 +686,7 @@ pass_sanopt::execute (function *fun)
        for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
          {
            gimple *stmt = gsi_stmt (gsi);
-           if (is_gimple_call (stmt) && gimple_call_internal_p (stmt)
-               && gimple_call_internal_fn (stmt) == IFN_ASAN_CHECK)
+           if (gimple_call_internal_p (stmt, IFN_ASAN_CHECK))
              ++asan_num_accesses;
          }
     }
index badbd96951c933acca8eb4470aca93b6c097010b..2ed450c4cabdf7f9bb2d9902b78fecd22160d628 100644 (file)
@@ -621,10 +621,7 @@ get_abnormal_succ_dispatcher (basic_block bb)
        gimple_stmt_iterator gsi
          = gsi_start_nondebug_after_labels_bb (e->dest);
        gimple *g = gsi_stmt (gsi);
-       if (g
-           && is_gimple_call (g)
-           && gimple_call_internal_p (g)
-           && gimple_call_internal_fn (g) == IFN_ABNORMAL_DISPATCHER)
+       if (g && gimple_call_internal_p (g, IFN_ABNORMAL_DISPATCHER))
          return e->dest;
       }
   return NULL;
index a16015271a13d9c6c67ef4d79e0c61e93b9c4a87..4779441b0cff33f235be5508e9d30123f4704a8a 100644 (file)
@@ -2990,9 +2990,7 @@ oacc_entry_exit_ok_1 (bitmap in_loop_bbs, vec<basic_block> region_bbs,
                   && !gimple_vdef (stmt)
                   && !gimple_vuse (stmt))
            continue;
-         else if (is_gimple_call (stmt)
-                  && gimple_call_internal_p (stmt)
-                  && gimple_call_internal_fn (stmt) == IFN_GOACC_DIM_POS)
+         else if (gimple_call_internal_p (stmt, IFN_GOACC_DIM_POS))
            continue;
          else if (gimple_code (stmt) == GIMPLE_RETURN)
            continue;
index f72a60b9362ce74122d7f601277661a42da8290e..0c5e430920604b962dcf7cb40fac14ced8ad4717 100644 (file)
@@ -991,16 +991,6 @@ finish:
     }
 }
 
-/* Return true if STMT is IFN_VA_ARG.  */
-
-static bool
-gimple_call_ifn_va_arg_p (gimple *stmt)
-{
-  return (is_gimple_call (stmt)
-         && gimple_call_internal_p (stmt)
-         && gimple_call_internal_fn (stmt) == IFN_VA_ARG);
-}
-
 /* Expand IFN_VA_ARGs in FUN.  */
 
 static void
@@ -1018,7 +1008,7 @@ expand_ifn_va_arg_1 (function *fun)
        tree ap, aptype, expr, lhs, type;
        gimple_seq pre = NULL, post = NULL;
 
-       if (!gimple_call_ifn_va_arg_p (stmt))
+       if (!gimple_call_internal_p (stmt, IFN_VA_ARG))
          continue;
 
        modified = true;
@@ -1116,7 +1106,7 @@ expand_ifn_va_arg (function *fun)
       gimple_stmt_iterator i;
       FOR_EACH_BB_FN (bb, fun)
        for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
-         gcc_assert (!gimple_call_ifn_va_arg_p (gsi_stmt (i)));
+         gcc_assert (!gimple_call_internal_p (gsi_stmt (i), IFN_VA_ARG));
     }
 }
 
index 58f3456fe407e2da9049880b8348154ebeb9cc86..a84ca3f2f348aa76207e8bb08a83915dbd9f496d 100644 (file)
@@ -424,9 +424,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
          else
            {
              gcc_assert (!STMT_VINFO_DATA_REF (stmt_info));
-             if (is_gimple_call (stmt)
-                 && gimple_call_internal_p (stmt)
-                 && gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
+             if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
                scalar_type = TREE_TYPE (gimple_call_arg (stmt, 3));
              else
                scalar_type = TREE_TYPE (gimple_get_lhs (stmt));
@@ -7180,9 +7178,7 @@ optimize_mask_stores (struct loop *loop)
           gsi_next (&gsi))
        {
          stmt = gsi_stmt (gsi);
-         if (is_gimple_call (stmt)
-             && gimple_call_internal_p (stmt)
-             && gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
+         if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
            worklist.safe_push (stmt);
        }
     }
index dbbd731a12dd044340468bcd8d909dfe91b298fb..47770adcdc0d8218ad5a5084b70da73d9253c2b3 100644 (file)
@@ -3003,9 +3003,7 @@ vect_simd_lane_linear (tree op, struct loop *loop,
          default:
            return;
          }
-      else if (is_gimple_call (def_stmt)
-              && gimple_call_internal_p (def_stmt)
-              && gimple_call_internal_fn (def_stmt) == IFN_GOMP_SIMD_LANE
+      else if (gimple_call_internal_p (def_stmt, IFN_GOMP_SIMD_LANE)
               && loop->simduid
               && TREE_CODE (gimple_call_arg (def_stmt, 0)) == SSA_NAME
               && (SSA_NAME_VAR (gimple_call_arg (def_stmt, 0))
@@ -8446,9 +8444,7 @@ vect_transform_stmt (gimple *stmt, gimple_stmt_iterator *gsi,
     case call_vec_info_type:
       done = vectorizable_call (stmt, gsi, &vec_stmt, slp_node);
       stmt = gsi_stmt (*gsi);
-      if (is_gimple_call (stmt)
-         && gimple_call_internal_p (stmt)
-         && gimple_call_internal_fn (stmt) == IFN_MASK_STORE)
+      if (gimple_call_internal_p (stmt, IFN_MASK_STORE))
        is_store = true;
       break;
 
index 1d55041fb223981fd3562777eaea36ab3ca57563..22e587afb4c6b5c11bf2e5c0994d2ada618f9ea9 100644 (file)
@@ -436,9 +436,7 @@ vect_loop_vectorized_call (struct loop *loop)
       if (!gsi_end_p (gsi))
        {
          g = gsi_stmt (gsi);
-         if (is_gimple_call (g)
-             && gimple_call_internal_p (g)
-             && gimple_call_internal_fn (g) == IFN_LOOP_VECTORIZED
+         if (gimple_call_internal_p (g, IFN_LOOP_VECTORIZED)
              && (tree_to_shwi (gimple_call_arg (g, 0)) == loop->num
                  || tree_to_shwi (gimple_call_arg (g, 1)) == loop->num))
            return g;
index aba21f81bd66627c4ea221736c80d4aa15235b17..91dbd41a0b49ddf9bea65bddd8738906b1760f97 100644 (file)
@@ -779,9 +779,7 @@ instrument_memory_accesses (void)
     for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
       {
        gimple *stmt = gsi_stmt (gsi);
-       if (is_gimple_call (stmt)
-           && gimple_call_internal_p (stmt)
-           && gimple_call_internal_fn (stmt) == IFN_TSAN_FUNC_EXIT)
+       if (gimple_call_internal_p (stmt, IFN_TSAN_FUNC_EXIT))
          {
            if (fentry_exit_instrument)
              replace_func_exit (stmt);