From: Jennifer Schmitz Date: Tue, 23 Jul 2024 10:54:50 +0000 (-0700) Subject: SVE Intrinsics: Change return type of redirect_call to gcall. X-Git-Tag: basepoints/gcc-16~7256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3adfcc5802237e1299d67e6d716481cd3db2234a;p=thirdparty%2Fgcc.git 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 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 --git a/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc b/gcc/config/aarch64/aarch64-sve-builtins-sve2.cc index 4f25cc68028..dc591551682 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 (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 (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 (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 f3983a123e3..0a560eaedca 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 9cc07d5fa3d..9ab6f202c30 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);