GCC Middle and Back End API Reference
valtrack.h File Reference
#include "bitmap.h"
#include "df.h"
#include "rtl.h"
#include "basic-block.h"
#include "hash-table.h"
Include dependency graph for valtrack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dead_debug_global_entry
struct  dead_debug_hash_descr
struct  dead_debug_global
struct  dead_debug_use
struct  dead_debug_local

Enumerations

enum  debug_temp_where { DEBUG_TEMP_BEFORE_WITH_REG = -1, DEBUG_TEMP_BEFORE_WITH_VALUE = 0, DEBUG_TEMP_AFTER_WITH_REG = 1, DEBUG_TEMP_AFTER_WITH_REG_FORCE = 2 }

Functions

void dead_debug_global_init (struct dead_debug_global *, bitmap)
void dead_debug_global_finish (struct dead_debug_global *, bitmap)
void dead_debug_local_init (struct dead_debug_local *, bitmap, struct dead_debug_global *)
void dead_debug_local_finish (struct dead_debug_local *, bitmap)
void dead_debug_add (struct dead_debug_local *, df_ref, unsigned int)
int dead_debug_insert_temp (struct dead_debug_local *, unsigned int uregno, rtx insn, enum debug_temp_where)
void propagate_for_debug (rtx, rtx, rtx, rtx, basic_block)

Enumeration Type Documentation

This type controls the behavior of dead_debug_insert_temp WRT UREGNO and INSN.

Enumerator:
DEBUG_TEMP_BEFORE_WITH_REG 

Bind a newly-created debug temporary to a REG for UREGNO, and insert the debug insn before INSN. REG is expected to die at INSN.

DEBUG_TEMP_BEFORE_WITH_VALUE 

Bind a newly-created debug temporary to the value INSN stores in REG, and insert the debug insn before INSN.

DEBUG_TEMP_AFTER_WITH_REG 

Bind a newly-created debug temporary to a REG for UREGNO, and insert the debug insn after INSN. REG is expected to be set at INSN.

DEBUG_TEMP_AFTER_WITH_REG_FORCE 

Like DEBUG_TEMP_AFTER_WITH_REG, but force addition of a debug temporary even if there is just a single debug use. This is used on regs that are becoming REG_DEAD on INSN and so uses of the reg later on are invalid.


Function Documentation

void dead_debug_add ( struct dead_debug_local ,
df_ref  ,
unsigned  int 
)
void dead_debug_global_finish ( struct dead_debug_global ,
bitmap   
)
void dead_debug_global_init ( struct dead_debug_global ,
bitmap   
)
int dead_debug_insert_temp ( struct dead_debug_local debug,
unsigned int  uregno,
rtx  insn,
enum debug_temp_where  where 
)

If UREGNO is referenced by any entry in DEBUG, emit a debug insn before or after INSN (depending on WHERE), that binds a (possibly global) debug temp to the widest-mode use of UREGNO, if WHERE is *_WITH_REG, or the value stored in UREGNO by INSN otherwise, and replace all uses of UREGNO in DEBUG with uses of the debug temp. INSN must be where UREGNO dies, if WHERE is *_BEFORE_*, or where it is set otherwise. Return the number of debug insns emitted.

 Move all uses of uregno from debug->head to uses, setting mode to
 the widest referenced mode.   
         If this loc has been changed e.g. to debug_expr already
         as part of a multi-register use, just drop it.   
 We may have dangling bits in debug->used for registers that were part
 of a multi-register use, one component of which has been reset.   
 Recover the expression INSN stores in REG.   
         Lose if the REG-setting insn is a CALL.   
     ??? Should we try to extract it from a PARALLEL?   
     Cool, it's the same REG, we can use SRC.   
         Hmm...  Something's fishy, we should be setting REG here.   
         If we're not overwriting all the hardware registers that
         setting REG in its mode would, we won't know what to bind
         the debug temp to.  ??? We could bind the debug_expr to a
         CONCAT or PARALLEL with the split multi-registers, and
         replace them as we found the corresponding sets.   
         Ok, it's the same (hardware) REG, but with a different
         mode, so SUBREG it.   
         We should be setting REG here.  Lose.   
         Lose if we're setting something other than the lowpart of
         REG.   
         If we're not overwriting all the hardware registers that
         setting REG in its mode would, we won't know what to bind
         the debug temp to.   
         Yay, we can use SRC, just adjust its mode.   
     Oh well, we're out of luck.   
     We couldn't figure out the value stored in REG, so reset all
     of its pending debug uses.   
 If there's a single (debug) use of an otherwise unused REG, and
 the debug use is not part of a larger expression, then it
 probably doesn't make sense to introduce a new debug temp.   
   Create DEBUG_EXPR (and DEBUG_EXPR_DECL).   
 Emit a debug bind insn before the insn in which reg dies.   
 Adjust all uses.   
     ??? Should we simplify subreg of subreg?   

References DF_REF_REAL_LOC, DF_REF_REGNO, GET_MODE, GET_MODE_BITSIZE, dead_debug_use::next, NULL, REG_P, and dead_debug_use::use.

Referenced by df_create_unused_note().

void dead_debug_local_finish ( struct dead_debug_local ,
bitmap   
)
void dead_debug_local_init ( struct dead_debug_local debug,
bitmap  used,
struct dead_debug_global global 
)

Initialize DEBUG to an empty list, and clear USED, if given. Link back to GLOBAL, if given, and bring in used bits from it.

Referenced by gate_ud_dce().

void propagate_for_debug ( rtx  insn,
rtx  last,
rtx  dest,
rtx  src,
basic_block  this_basic_block 
)

Replace all the occurrences of DEST with SRC in DEBUG_INSNs between INSN and LAST, not including INSN, but including LAST. Also stop at the end of THIS_BASIC_BLOCK.