def METHOD_NAME(
        caller_knl, callee_knl):
    """
    :returns: a copy of *caller_knl* with the instance of
        :class:`loopy.kernel.function_interface.CallableKernel` addressed by
        *callee_function_name* in the *caller_knl* aligned with the argument
        dimensions required by *caller_knl*.
    """
    from loopy.kernel.array import ArrayBase
    from loopy.kernel.data import auto
    for insn in caller_knl.instructions:
        if not isinstance(insn, CallInstruction) or (
                insn.expression.function.name !=
                callee_knl.name):
            # Call to a callable kernel can only occur through a
            # CallInstruction.
            continue
        def _shape_1_if_empty(shape_caller, shape_callee):
            assert isinstance(shape_caller, tuple)
            if shape_caller == () and shape_caller!=shape_callee:
                return (1,)
            else:
                return shape_caller
        from loopy.kernel.function_interface import (
                ArrayArgDescriptor, get_arg_descriptor_for_expression,
                get_kw_pos_association)
        _, pos_to_kw = get_kw_pos_association(callee_knl)
        arg_id_to_shape = {}
        for arg_id, arg in insn.arg_id_to_arg().items():
            arg_id = pos_to_kw[arg_id]
            arg_descr = get_arg_descriptor_for_expression(caller_knl, arg)
            if isinstance(arg_descr, ArrayArgDescriptor):
                arg_id_to_shape[arg_id] = arg_descr.shape
            else:
                arg_id_to_shape[arg_id] = (1, )
        dim_changer = DimChanger(
                callee_knl.arg_dict,
                arg_id_to_shape)
        new_callee_insns = []
        for callee_insn in callee_knl.instructions:
            if isinstance(callee_insn, MultiAssignmentBase):
                new_callee_insns.append(callee_insn
                        .with_transformed_expressions(dim_changer))
            elif isinstance(callee_insn, (CInstruction,
                    _DataObliviousInstruction)):
                # The layout of the args to a CInstructions is not going to be matched to the caller_kernel,
                # they are appended with unmatched args.
                # We only use Cinstructions exceptionally, e.g. for adding profile instructions,
                # without arguments that required to be matched, so this is ok.
                new_callee_insns.append(callee_insn)
            else:
                raise NotImplementedError("Unknown instruction %s." %
                        type(insn))
        new_args = [arg if not isinstance(arg, ArrayBase)
                    else arg.copy(shape=arg_id_to_shape[arg.name],
                                  dim_tags=None, strides=auto, order="C")
                    for arg in callee_knl.args]
        # subkernel with instructions adjusted according to the new dimensions
        new_callee_knl = callee_knl.copy(instructions=new_callee_insns,
                                         args=new_args)
        return new_callee_knl