https://gcc.gnu.org/g:3adfcc5802237e1299d67e6d716481cd3db2234a

commit r15-2297-g3adfcc5802237e1299d67e6d716481cd3db2234a
Author: Jennifer Schmitz <jschm...@nvidia.com>
Date:   Tue Jul 23 03:54:50 2024 -0700

    SVE Intrinsics: Change return type of redirect_call to gcall.
    
    As suggested in the review of
    https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657474.html,
    this patch changes the return type of gimple_folder::redirect_call from
    gimple * to gcall *. The motivation for this is that so far, most callers of
    the function had been casting the result of the function to gcall. These
    call sites were updated.
    
    The patch was bootstrapped and regtested on aarch64-linux-gnu, no 
regression.
    OK for mainline?
    
    Signed-off-by: Jennifer Schmitz <jschm...@nvidia.com>
    
    gcc/
    
            * config/aarch64/aarch64-sve-builtins.cc
            (gimple_folder::redirect_call): Update return type.
            * config/aarch64/aarch64-sve-builtins.h: Likewise.
            * config/aarch64/aarch64-sve-builtins-sve2.cc (svqshl_impl::fold):
            Remove cast to gcall.
            (svrshl_impl::fold): Likewise.

Diff:
---
 gcc/config/aarch64/aarch64-sve-builtins-sve2.cc | 6 +++---
 gcc/config/aarch64/aarch64-sve-builtins.cc      | 2 +-
 gcc/config/aarch64/aarch64-sve-builtins.h       | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc 
b/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc
index 4f25cc680282..dc5915516825 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc
@@ -349,7 +349,7 @@ public:
                instance.base_name = "svlsr";
                instance.base = functions::svlsr;
              }
-           gcall *call = as_a <gcall *> (f.redirect_call (instance));
+           gcall *call = f.redirect_call (instance);
            gimple_call_set_arg (call, 2, amount);
            return call;
          }
@@ -379,7 +379,7 @@ public:
            function_instance instance ("svlsl", functions::svlsl,
                                        shapes::binary_uint_opt_n, MODE_n,
                                        f.type_suffix_ids, GROUP_none, f.pred);
-           gcall *call = as_a <gcall *> (f.redirect_call (instance));
+           gcall *call = f.redirect_call (instance);
            gimple_call_set_arg (call, 2, amount);
            return call;
          }
@@ -392,7 +392,7 @@ public:
            function_instance instance ("svrshr", functions::svrshr,
                                        shapes::shift_right_imm, MODE_n,
                                        f.type_suffix_ids, GROUP_none, f.pred);
-           gcall *call = as_a <gcall *> (f.redirect_call (instance));
+           gcall *call = f.redirect_call (instance);
            gimple_call_set_arg (call, 2, amount);
            return call;
          }
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc 
b/gcc/config/aarch64/aarch64-sve-builtins.cc
index f3983a123e35..0a560eaedca1 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
@@ -3592,7 +3592,7 @@ gimple_folder::load_store_cookie (tree type)
 }
 
 /* Fold the call to a call to INSTANCE, with the same arguments.  */
-gimple *
+gcall *
 gimple_folder::redirect_call (const function_instance &instance)
 {
   registered_function *rfn
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.h 
b/gcc/config/aarch64/aarch64-sve-builtins.h
index 9cc07d5fa3de..9ab6f202c306 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.h
+++ b/gcc/config/aarch64/aarch64-sve-builtins.h
@@ -629,7 +629,7 @@ public:
   tree fold_contiguous_base (gimple_seq &, tree);
   tree load_store_cookie (tree);
 
-  gimple *redirect_call (const function_instance &);
+  gcall *redirect_call (const function_instance &);
   gimple *redirect_pred_x ();
 
   gimple *fold_to_cstu (poly_uint64);

Reply via email to