Lib/Liveness/LiveSet.cpp
/**
 * Determine the available register in the register file, to use for variable 'index'.
 *
 * @param index  index of variable
 */
Determine the available register in the register file, to use for variable 'index'.
@param index  index of variable
Determine the available register in the register file to use for variable ' index ' . @param index index of variable
std::vector<bool> LiveSets::possible_registers(int index, RegUsage &alloc, RegTag reg_tag) {
  assert(reg_tag == REG_A || reg_tag == REG_B);
  const int NUM_REGS = Platform::size_regfile();
  std::vector<bool> possible(NUM_REGS);
  for (int j = 0; j < NUM_REGS; j++)
    possible[j] = true;
  RegIdSet &set = (*this)[index];
  for (auto j : set) {
    Reg neighbour = alloc[j].reg;
    if (neighbour.tag == reg_tag) possible[neighbour.regId] = false;
  }
  return possible;
}
std :: vector < bool > LiveSets :: possible_registers ( int index , RegUsage & alloc , RegTag reg_tag ) { assert ( reg_tag == REG_A || reg_tag == REG_B ) ; const int NUM_REGS = Platform :: size_regfile ( ) ; std :: vector < bool > possible ( NUM_REGS ) ; for ( int j = 0 ; j < NUM_REGS ; j ++ ) possible [ j ] = true ; RegIdSet & set = ( * this ) [ index ] ; for ( auto j : set ) { Reg neighbour = alloc [ j ] . reg ; if ( neighbour . tag == reg_tag ) possible [ neighbour . regId ] = false ; } return possible ; }
Determine the available register in the register file, to use for variable 'index'.
Determine the available register in the register file to use for variable ' index ' .
// Eliminate impossible choices of register for this variable