extsrc/mesa/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
// Insert extra moves so that, if multiple register constraints on a value are
// in conflict, these conflicts can be resolved.
Insert extra moves so that, if multiple register constraints on a value are
in conflict, these conflicts can be resolved.
Insert extra moves so that if multiple register constraints on a value are in conflict these conflicts can be resolved .
bool
RegAlloc::InsertConstraintsPass::insertConstraintMoves()
{
   for (DLList::Iterator it = constrList.iterator(); !it.end(); it.next()) {
      Instruction *cst = reinterpret_cast<Instruction *>(it.get());
      for (int s = 0; cst->srcExists(s); ++s) {
         if (!detectConflict(cst, s))
             continue;
         Instruction *mov = new_Instruction(func, OP_MOV,
                                            typeOfSize(cst->src[s].getSize()));
         mov->setSrc(0, cst->getSrc(s));
         mov->setDef(0, new_LValue(func, FILE_GPR));
         cst->setSrc(s, mov->getDef(0));
         cst->bb->insertBefore(cst, mov);
      }
   }
   return true;
}
bool RegAlloc :: InsertConstraintsPass :: insertConstraintMoves ( ) { for ( DLList :: Iterator it = constrList . iterator ( ) ; ! it . end ( ) ; it . next ( ) ) { Instruction * cst = reinterpret_cast < Instruction * > ( it . get ( ) ) ; for ( int s = 0 ; cst -> srcExists ( s ) ; ++ s ) { if ( ! detectConflict ( cst , s ) ) continue ; Instruction * mov = new_Instruction ( func , OP_MOV , typeOfSize ( cst -> src [ s ] . getSize ( ) ) ) ; mov -> setSrc ( 0 , cst -> getSrc ( s ) ) ; mov -> setDef ( 0 , new_LValue ( func , FILE_GPR ) ) ; cst -> setSrc ( s , mov -> getDef ( 0 ) ) ; cst -> bb -> insertBefore ( cst , mov ) ; } } return true ; }
Insert extra moves so that, if multiple register constraints on a value are
in conflict, these conflicts can be resolved.
Insert extra moves so that if multiple register constraints on a value are in conflict these conflicts can be resolved .