Thanks Lehua, actually Yes.

Consider we will have a try for hashmap way and will keep you posted.

Pan

-----Original Message-----
From: Lehua Ding <lehua.d...@rivai.ai> 
Sent: Friday, September 15, 2023 10:29 AM
To: Li, Pan2 <pan2...@intel.com>; gcc-patches@gcc.gnu.org
Cc: Wang, Yanzhang <yanzhang.w...@intel.com>; kito.ch...@gmail.com; 
juzhe.zh...@rivai.ai
Subject: Re: [PATCH v3] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV 
intrinsic

Hi Pan,

> +function_instance *
> +function_base::get_non_overloaded_instance (unsigned int code,
> +                                         vec<tree, va_gc> &arglist) const
> +{
> +  unsigned int code_limit = vec_safe_length (registered_functions);
> +
> +  for (unsigned fun_code = code; fun_code < code_limit; fun_code++)
> +    {
> +      registered_function *rfun = (*registered_functions)[fun_code];
> +      function_instance instance = rfun->instance;
> +
> +      if (rfun->overloaded_p)
> +     continue;
> +
> +      unsigned k;
> +      const rvv_arg_type_info *args = instance.op_info->args;
> +
> +      for (k = 0; args[k].base_type != NUM_BASE_TYPES; k++)
> +     {
> +       if (k >= arglist.length ())
> +         break;

Can we fast continue if args length not equal arglist length before this 
loop:

   if (args lengh != arglist.length ())
     continue;

   for (k = 0; args[k].base_type != NUM_BASE_TYPES; k++)
   {
     ...

-- 
Best,
Lehua

Reply via email to