def _filter_kernel_args(self, loops, fundecl):
        """Eliminate redundant arguments in the fused kernel's signature."""
        fused_loop_args = list(flatten([l.args for l in loops]))
        unique_fused_loop_args = Arg.filter_args([l.args for l in loops])
        fused_kernel_args = fundecl.args
        binding = OrderedDict(zip(fused_loop_args, fused_kernel_args))
        new_fused_kernel_args, args_maps = [], []
        for fused_loop_arg, fused_kernel_arg in binding.items():
            unique_fused_loop_arg = unique_fused_loop_args[fused_loop_arg.data]
            if fused_loop_arg is unique_fused_loop_arg:
                new_fused_kernel_args.append(fused_kernel_arg)
                continue
            tobind_fused_kernel_arg = binding[unique_fused_loop_arg]
            if tobind_fused_kernel_arg.is_const:
                # Need to remove the /const/ qualifier from the C declaration
                # if the same argument is written to, somewhere, in the fused
                # kernel. Otherwise, /const/ must be appended, if not present
                # already, to the alias' qualifiers
                if fused_loop_arg._is_written:
                    tobind_fused_kernel_arg.qual.remove('const')
                elif 'const' not in fused_kernel_arg.qual:
                    fused_kernel_arg.qual.append('const')
            # Update the /binding/, since might be useful for the caller
            binding[fused_loop_arg] = tobind_fused_kernel_arg
            # Aliases may be created instead of changing symbol names
            if fused_kernel_arg.sym.symbol == tobind_fused_kernel_arg.sym.symbol:
                continue
            alias = ast_make_alias(dcopy(fused_kernel_arg),
                                   dcopy(tobind_fused_kernel_arg))
            args_maps.append(alias)
        fundecl.children[0].children = args_maps + fundecl.children[0].children
        fundecl.args = new_fused_kernel_args
        return binding
dataset/ETHPy150Open OP2/PyOP2/pyop2/fusion.py/Inspector._filter_kernel_args/original