GCC Middle and Back End API Reference
hw_doloop_hooks Struct Reference

#include <hw-doloop.h>

Collaboration diagram for hw_doloop_hooks:

Data Fields

rtx(* end_pattern_reg )(rtx insn)
bool(* opt )(hwloop_info loop)
void(* fail )(hwloop_info loop)

Detailed Description

   A set of hooks to be defined by a target that wants to use the reorg_loops
   functionality.

   reorg_loops is intended to handle cases where special hardware loop
   setup instructions are required before the loop, for example to set
   up loop counter registers that are not exposed to the register
   allocator, or to inform the hardware about loop bounds.

   reorg_loops performs analysis to discover loop_end patterns created
   by the earlier loop-doloop pass, and sets up a hwloop_info
   structure for each such insn it finds.  It then tries to discover
   the basic blocks containing the loop by tracking the lifetime of
   the iteration register.

   If a valid loop can't be found, the FAIL function is called;
   otherwise the OPT function is called for each loop, visiting
   innermost loops first and ascending.  

Field Documentation

rtx(* hw_doloop_hooks::end_pattern_reg)(rtx insn)
     Examine INSN.  If it is a suitable doloop_end pattern, return the
     iteration register, which should be a single hard register.
     Otherwise, return NULL_RTX.  

Referenced by discover_loops().

void(* hw_doloop_hooks::fail)(hwloop_info loop)
     Handle a loop that was marked bad for any reason.  This could be
     used to split the doloop_end pattern.  
bool(* hw_doloop_hooks::opt)(hwloop_info loop)
     Optimize LOOP.  The target should perform any additional analysis
     (e.g. checking that the loop isn't too long), and then perform
     its transformations.  Return true if successful, false if the
     loop should be marked bad.  If it returns false, the FAIL
     function is called.  

The documentation for this struct was generated from the following file: