gccint: Liveness information

1 
1 15.5 Liveness information
1 =========================
1 
1 Liveness information is useful to determine whether some register is
1 "live" at given point of program, i.e. that it contains a value that may
1 be used at a later point in the program.  This information is used, for
1 instance, during register allocation, as the pseudo registers only need
1 to be assigned to a unique hard register or to a stack slot if they are
1 live.  The hard registers and stack slots may be freely reused for other
1 values when a register is dead.
1 
1  Liveness information is available in the back end starting with
1 'pass_df_initialize' and ending with 'pass_df_finish'.  Three flavors of
1 live analysis are available: With 'LR', it is possible to determine at
1 any point 'P' in the function if the register may be used on some path
1 from 'P' to the end of the function.  With 'UR', it is possible to
1 determine if there is a path from the beginning of the function to 'P'
1 that defines the variable.  'LIVE' is the intersection of the 'LR' and
1 'UR' and a variable is live at 'P' if there is both an assignment that
1 reaches it from the beginning of the function and a use that can be
1 reached on some path from 'P' to the end of the function.
1 
1  In general 'LIVE' is the most useful of the three.  The macros
1 'DF_[LR,UR,LIVE]_[IN,OUT]' can be used to access this information.  The
1 macros take a basic block number and return a bitmap that is indexed by
1 the register number.  This information is only guaranteed to be up to
1 date after calls are made to 'df_analyze'.  See the file 'df-core.c' for
1 details on using the dataflow.
1 
1  The liveness information is stored partly in the RTL instruction stream
1 and partly in the flow graph.  Local information is stored in the
1 instruction stream: Each instruction may contain 'REG_DEAD' notes
1 representing that the value of a given register is no longer needed, or
1 'REG_UNUSED' notes representing that the value computed by the
1 instruction is never used.  The second is useful for instructions
1 computing multiple values at once.
1