Esempio n. 1
0
 def find_nodes(self, ops, spectext, boxkinds=None):
     assert boxkinds is None or isinstance(boxkinds, dict)
     loop = self.parse(ops, boxkinds=boxkinds)
     perfect_specialization_finder = PerfectSpecializationFinder(self.cpu)
     perfect_specialization_finder.find_nodes_loop(loop)
     self.check_specnodes(loop.token.specnodes, spectext)
     return (loop.getboxes(), perfect_specialization_finder.getnode)
Esempio n. 2
0
def optimize_loop(metainterp_sd, old_loop_tokens, loop):
    cpu = metainterp_sd.cpu
    metainterp_sd.logger_noopt.log_loop(loop.inputargs, loop.operations)
    finder = PerfectSpecializationFinder(cpu)
    finder.find_nodes_loop(loop)
    for old_loop_token in old_loop_tokens:
        if equals_specnodes(old_loop_token.specnodes, loop.token.specnodes):
            return old_loop_token
    optimize_loop_1(metainterp_sd, loop)
    return None
Esempio n. 3
0
def _optimize_loop(metainterp_sd, old_loop_tokens, loop):
    cpu = metainterp_sd.cpu
    metainterp_sd.logger_noopt.log_loop(loop.inputargs, loop.operations)
    finder = PerfectSpecializationFinder(cpu)
    finder.find_nodes_loop(loop)
    for old_loop_token in old_loop_tokens:
        if equals_specnodes(old_loop_token.specnodes, loop.token.specnodes):
            return old_loop_token
    optimize_loop_1(metainterp_sd, loop)
    return None