Lib/Target/Satisfy.cpp
/**
 * Insert NOPs between VPM setup and VPM read, if needed
 *
 * Replaces VPM_STALL instructions with NOPs.
 */
Insert NOPs between VPM setup and VPM read, if needed
Replaces VPM_STALL instructions with NOPs.
Insert NOPs between VPM setup and VPM read if needed Replaces VPM_STALL instructions with NOPs .
Instr::List removeVPMStall(Instr::List &instrs) {
  Instr::List newInstrs(instrs.size() * 2);
  for (int i = 0; i < instrs.size(); i++) {
    Instr instr = instrs[i];
    if (instr.tag != VPM_STALL) {
      newInstrs << instr;
      continue;
    }
    int numNops = 3;  
    for (int j = 1; j <= 3; j++) {
      if ((i + j) >= instrs.size()) break;
      Instr next = instrs[i+j];
      if (next.tag == LAB) break;
      if (next.is_src_reg(Target::instr::VPM_READ)) break;
      numNops--;
    }
    for (int j = 0; j < numNops; j++)
      newInstrs << Instr::nop();
  }
  return newInstrs;
}
Instr :: List removeVPMStall ( Instr :: List & instrs ) { Instr :: List newInstrs ( instrs . size ( ) * 2 ) ; for ( int i = 0 ; i < instrs . size ( ) ; i ++ ) { Instr instr = instrs [ i ] ; if ( instr . tag != VPM_STALL ) { newInstrs << instr ; continue ; } int numNops = 3 ; for ( int j = 1 ; j <= 3 ; j ++ ) { if ( ( i + j ) >= instrs . size ( ) ) break ; Instr next = instrs [ i + j ] ; if ( next . tag == LAB ) break ; if ( next . is_src_reg ( Target :: instr :: VPM_READ ) ) break ; numNops -- ; } for ( int j = 0 ; j < numNops ; j ++ ) newInstrs << Instr :: nop ( ) ; } return newInstrs ; }
Insert NOPs between VPM setup and VPM read, if needed
 Replaces VPM_STALL instructions with NOPs.
Insert NOPs between VPM setup and VPM read if needed Replaces VPM_STALL instructions with NOPs .
// Number of nops to insert