parameters: (func_ir, typingctx, targetctx, flags, locals)
return_statement: return main, loops
docstring: Loop lifting transformation.
  
      Given a interpreter `func_ir` returns a 2 tuple of
      `(toplevel_interp, [loop0_interp, loop1_interp, ....])`
docstring_summary: Loop lifting transformation.
docstring_tokens: Loop lifting transformation .
function: def loop_lifting(func_ir, typingctx, targetctx, flags, locals):
      """
      Loop lifting transformation.
  
      Given a interpreter `func_ir` returns a 2 tuple of
      `(toplevel_interp, [loop0_interp, loop1_interp, ....])`
      """
      blocks = func_ir.blocks.copy()
      cfg = compute_cfg_from_blocks(blocks)
      loopinfos = _loop_lift_get_candidate_infos(cfg, blocks,
                                                 func_ir.variable_lifetime.livemap)
      loops = []
      if loopinfos:
          _logger.debug('loop lifting this IR with %d candidates:\n%s',
                        len(loopinfos), func_ir.dump_to_string())
      for loopinfo in loopinfos:
          lifted = _loop_lift_modify_blocks(func_ir, loopinfo, blocks,
                                            typingctx, targetctx, flags, locals)
          loops.append(lifted)
  
      # Make main IR
      main = func_ir.derive(blocks=blocks)
  
      return main, loops
function_tokens: def loop_lifting ( func_ir , typingctx , targetctx , flags , locals ) : blocks = func_ir . blocks . copy ( ) cfg = compute_cfg_from_blocks ( blocks ) loopinfos = _loop_lift_get_candidate_infos ( cfg , blocks , func_ir . variable_lifetime . livemap ) loops = [ ] if loopinfos : _logger . debug ( 'loop lifting this IR with %d candidates:\n%s' , len ( loopinfos ) , func_ir . dump_to_string ( ) ) for loopinfo in loopinfos : lifted = _loop_lift_modify_blocks ( func_ir , loopinfo , blocks , typingctx , targetctx , flags , locals ) loops . append ( lifted ) # Make main IR main = func_ir . derive ( blocks = blocks ) return main , loops