@@ -651,7 +651,6 @@ const G4_Operand* G4_INST::getOperand(Gen4_Operand_Number opnd_num) const
651651 return NULL ;
652652}
653653
654-
655654USE_EDGE_LIST_ITER G4_INST::eraseUse (USE_EDGE_LIST_ITER iter)
656655{
657656 G4_INST *useInst = iter->first ;
@@ -1361,8 +1360,12 @@ G4_INST *G4_INST::getSingleDef(Gen4_Operand_Number opndNum, bool MakeUnique)
13611360// Note that this function does not check for duplicates
13621361void G4_INST::addDefUse (G4_INST* inst, Gen4_Operand_Number srcPos)
13631362{
1364- MUST_BE_TRUE (srcPos == Opnd_dst || srcPos == Opnd_src0 || srcPos == Opnd_src1 ||
1365- srcPos == Opnd_src2 || srcPos == Opnd_src3 || srcPos == Opnd_pred ||
1363+ MUST_BE_TRUE (srcPos == Opnd_dst ||
1364+ srcPos == Opnd_src0 || srcPos == Opnd_src1 ||
1365+ srcPos == Opnd_src2 || srcPos == Opnd_src3 ||
1366+ srcPos == Opnd_src4 || srcPos == Opnd_src5 ||
1367+ srcPos == Opnd_src6 || srcPos == Opnd_src7 ||
1368+ srcPos == Opnd_pred ||
13661369 srcPos == Opnd_implAccSrc, " unexpected operand number" );
13671370 useInstList.emplace_back (inst, srcPos);
13681371 inst->defInstList .emplace_back (this , srcPos);
@@ -4892,13 +4895,24 @@ unsigned G4_DstRegRegion::computeRightBound(uint8_t exec_size)
48924895static G4_CmpRelation compareRegRegionToOperand (G4_Operand* regRegion, G4_Operand* opnd)
48934896{
48944897 assert ((regRegion->isSrcRegRegion () || regRegion->isDstRegRegion ()) && " expect either src or dst regRegion" );
4895- bool legal_opnd = opnd->isSrcRegRegion () || opnd->isDstRegRegion () || opnd->isPredicate () || opnd->isCondMod ();
4898+ bool legal_opnd = opnd->isSrcRegRegion () || opnd->isDstRegRegion () || opnd->isPredicate () || opnd->isCondMod () || opnd-> isAddrExp () ;
48964899 G4_VarBase* myBase = regRegion->getBase ();
48974900 G4_VarBase *opndBase = opnd->getBase ();
48984901 G4_RegAccess myAcc = regRegion->getRegAccess ();
48994902 G4_RegAccess opndAcc = opnd->getRegAccess ();
49004903 G4_Declare* myDcl = regRegion->getTopDcl ();
49014904 G4_Declare* opndDcl = opnd->getTopDcl ();
4905+ if (opnd->isAddrExp ())
4906+ {
4907+ opndBase = opnd->asAddrExp ()->getRegVar ()->getBaseRegVar ();
4908+ opndDcl = opnd->asAddrExp ()->getRegVar ()->getDeclare ();
4909+ }
4910+
4911+ if (regRegion->isAddrExp ())
4912+ {
4913+ myBase = opnd->asAddrExp ()->getRegVar ()->getBaseRegVar ();
4914+ myDcl = opnd->asAddrExp ()->getRegVar ()->getDeclare ();
4915+ }
49024916
49034917 if (!legal_opnd || myBase == nullptr || opndBase == nullptr )
49044918 {
@@ -4920,6 +4934,11 @@ static G4_CmpRelation compareRegRegionToOperand(G4_Operand* regRegion, G4_Operan
49204934 {
49214935 return Rel_interfere;
49224936 }
4937+
4938+ if (opnd->isAddrExp () || regRegion->isAddrExp ())
4939+ {
4940+ return Rel_interfere;
4941+ }
49234942 }
49244943
49254944 if (opndAcc == myAcc && myAcc != Direct)
@@ -8318,6 +8337,24 @@ G4_Operand* G4_InstIntrinsic::getIntrinsicSrc(unsigned i) const
83188337 return srcs[i];
83198338}
83208339
8340+ G4_Operand* G4_InstIntrinsic::getOperand (Gen4_Operand_Number opnd_num) const
8341+ {
8342+ switch (opnd_num) {
8343+ case Opnd_src0: return srcs[0 ];
8344+ case Opnd_src1: return srcs[1 ];
8345+ case Opnd_src2: return srcs[2 ];
8346+ case Opnd_src3: return srcs[3 ];
8347+ case Opnd_src4: return srcs[4 ];
8348+ case Opnd_src5: return srcs[5 ];
8349+ case Opnd_src6: return srcs[6 ];
8350+ case Opnd_src7: return srcs[7 ];
8351+ default :
8352+ MUST_BE_TRUE (0 , " Operand number is out of range." );
8353+ break ;
8354+ }
8355+ return NULL ;
8356+ }
8357+
83218358void G4_InstIntrinsic::setIntrinsicSrc (G4_Operand* opnd, unsigned i)
83228359{
83238360 MUST_BE_TRUE (i < G4_MAX_INTRINSIC_SRCS, ERROR_INTERNAL_ARGUMENT);
0 commit comments