core/kernel_linux/clients/stress_dead_reg_module.c
/* check if register is dead before this intre */
check if register is dead before this intre
check if register is dead before this intre
bool 
register_is_dead(instr_t *instr, reg_id_t reg)
{
    int  opcode;
    if(instr_is_syscall(instr) || instr_is_interrupt(instr))
        return false;
    opcode = instr_get_opcode(instr);
    if (!instr_writes_to_whole_reg(instr, reg))
        return false;
    if(reg_set_immed(instr, reg))
        return true;
    if(instr_reg_in_src(instr, reg))
	return false;
    return true;
}
bool register_is_dead ( instr_t * instr , reg_id_t reg ) { int opcode ; if ( instr_is_syscall ( instr ) || instr_is_interrupt ( instr ) ) return false ; opcode = instr_get_opcode ( instr ) ; if ( ! instr_writes_to_whole_reg ( instr , reg ) ) return false ; if ( reg_set_immed ( instr , reg ) ) return true ; if ( instr_reg_in_src ( instr , reg ) ) return false ; return true ; }
check if register is dead before this intre
check if register is dead before this intre
// when at interupt, register never die // dead reg must be exact dst being written // reg is set to be immed // r1 = r1 - r1 || r1 = r1 xor r1 || r1 = immed // dead reg cannot be used  // must be a dead reg now