@staticmethod
def match(source_registers, destination_registers):
    """
        Find maximum number of matches from source (previous destinations) to
        destination (current source) registers.

        Return list of two-tuples of matches (src_idx, dst_idx)
        """
    matched_pairs = []
    unmatched_dests = set(destination_registers)
    for dst_idx, dst in enumerate(destination_registers):
        for src_idx, src in enumerate(source_registers):
            if src.llvm_type == dst.llvm_type:
                matched_pairs.append((src_idx, dst_idx))
                unmatched_dests.discard(dst)
    return matched_pairs, unmatched_dests
