Lib/Target/Subst.cpp
/**
 * Rename used registers in an instruction
 *
 * @return true if anything replaced, false otherwise
 */
Rename used registers in an instruction
@return true if anything replaced, false otherwise
Rename used registers in an instruction @return true if anything replaced false otherwise
bool renameUses(Instr &instr, Reg const &current, Reg const &replace_with) {
  assert(current != replace_with);  
  if  (instr.tag != ALU) return false;
  bool replaced = false;
  if (instr.ALU.srcA.is_reg() && instr.ALU.srcA.reg() == current) {
    instr.ALU.srcA.reg() = replace_with;
    replaced = true;
  }
  if (instr.ALU.srcB.is_reg() && instr.ALU.srcB.reg() == current) {
    instr.ALU.srcB.reg() = replace_with;
    replaced = true;
  }
  return replaced;
}
bool renameUses ( Instr & instr , Reg const & current , Reg const & replace_with ) { assert ( current != replace_with ) ; if ( instr . tag != ALU ) return false ; bool replaced = false ; if ( instr . ALU . srcA . is_reg ( ) && instr . ALU . srcA . reg ( ) == current ) { instr . ALU . srcA . reg ( ) = replace_with ; replaced = true ; } if ( instr . ALU . srcB . is_reg ( ) && instr . ALU . srcB . reg ( ) == current ) { instr . ALU . srcB . reg ( ) = replace_with ; replaced = true ; } return replaced ; }
Rename used registers in an instruction
 @return true if anything replaced, false otherwise
Rename used registers in an instruction @return true if anything replaced false otherwise
// otherwise rename is senseless