'list variables used (read/written) in this parfor by
traversing the body and combining block uses.'

def list_vars(self):

    all_uses = []
    for (l, b) in self.loop_body.items():
        for stmt in b.body:
            all_uses += stmt.list_vars()
    for loop in self.loop_nests:
        all_uses.append(loop.index_variable)
        if isinstance(loop.start, ir.Var):
            all_uses.append(loop.start)
        if isinstance(loop.stop, ir.Var):
            all_uses.append(loop.stop)
        if isinstance(loop.step, ir.Var):
            all_uses.append(loop.step)
    for stmt in self.init_block.body:
        all_uses += stmt.list_vars()
    return all_uses
