Skip to content

Commit 2f0ed94

Browse files
weiyu-chensys_zuul
authored andcommitted
Remove some unnecessary divergent CF checks.
Change-Id: Iff355c519e7126e54d8785086535e8a2f97a3010
1 parent f81761c commit 2f0ed94

File tree

2 files changed

+17
-33
lines changed

2 files changed

+17
-33
lines changed

visa/HWConformity.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -943,10 +943,8 @@ bool HWConformity::fixLine(INST_LIST_ITER it, G4_BB *bb)
943943
new_dst_opnd = builder.Create_Dst_Opnd_From_Dcl(src0_dcl, 1);
944944

945945
G4_INST* newInst = builder.createMov(mov_size, new_dst_opnd, src0, InstOpt_NoOpt, false);
946-
if (bb->isInSimdFlow())
947-
{
948-
newInst->setNoMask(true);
949-
}
946+
newInst->setNoMask(true);
947+
950948
bb->insert(it, newInst);
951949
inst->setSrc(new_src0_opnd, 0);
952950
return true;
@@ -2320,10 +2318,7 @@ bool HWConformity::fixMULInst( INST_LIST_ITER &i, G4_BB *bb )
23202318
inst->setDest(acc_dst_opnd);
23212319
fixMulSrc1(i, bb);
23222320

2323-
if (bb->isInSimdFlow())
2324-
{
2325-
inst->setNoMask(true);
2326-
}
2321+
inst->setNoMask(true);
23272322

23282323
if (pred != NULL) {
23292324
// conditional modifier cannot be used
@@ -2661,10 +2656,8 @@ void HWConformity::fixMULHInst( INST_LIST_ITER &i, G4_BB *bb )
26612656
iter--;
26622657
fixMulSrc1(iter, bb);
26632658

2664-
if (bb->isInSimdFlow())
2665-
{
2666-
newMul->setNoMask(true);
2667-
}
2659+
newMul->setNoMask(true);
2660+
26682661
inst->setOpcode( G4_mach );
26692662

26702663
if (src1->isImm() && src0->getType() != src1->getType())

visa/ReduceExecSize.cpp

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,10 +1584,6 @@ void HWConformity::moveSrcToGRF( INST_LIST_ITER it, uint32_t srcNum, uint16_t nu
15841584
G4_INST* newInst = builder.createMov(
15851585
execSize, dstRegion, src, (bb->isInSimdFlow() ? InstOpt_WriteEnable : InstOpt_NoOpt), false);
15861586

1587-
if( bb->isInSimdFlow() )
1588-
{
1589-
newInst->setOptionOn( InstOpt_WriteEnable );
1590-
}
15911587
// insert instruction and maintain def-use chain
15921588
bb->insert( it, newInst );
15931589
inst->transferDef( newInst, Gen4_Operand_Number(srcNum + 1), Opnd_src0 );
@@ -1634,10 +1630,8 @@ void HWConformity::saveDst( INST_LIST_ITER& it, uint8_t stride, G4_BB *bb )
16341630
unsigned int new_option = inst->getOption();
16351631

16361632
G4_INST* newInst = builder.createMov(execSize, tmpDstOpnd, srcRegion, new_option, false);
1637-
if (bb->isInSimdFlow())
1638-
{
1639-
newInst->setNoMask(true);
1640-
}
1633+
newInst->setNoMask(true);
1634+
16411635
bb->insert(it, newInst);
16421636
inst->setDest(builder.duplicateOperand( tmpDstOpnd ) );
16431637
}
@@ -1656,10 +1650,8 @@ void HWConformity::restoreDst( INST_LIST_ITER& it, G4_DstRegRegion *origDst, G4_
16561650
unsigned int new_option = inst->getOption();
16571651

16581652
G4_INST* newInst = builder.createMov(execSize, origDst, srcRegion, new_option, false);
1659-
if (bb->isInSimdFlow())
1660-
{
1661-
newInst->setNoMask(true);
1662-
}
1653+
newInst->setNoMask(true);
1654+
16631655
INST_LIST_ITER iter = it;
16641656
iter++;
16651657
bb->insert( iter, newInst );
@@ -1730,25 +1722,24 @@ void HWConformity::removeBadSrc( INST_LIST_ITER& iter, G4_BB *bb, bool crossGRF
17301722
for (int i = 0; i < inst->getNumSrc(); i++)
17311723
{
17321724

1733-
if( badTwoGRFSrc[i] )
1725+
if (badTwoGRFSrc[i])
17341726
{
1735-
if( !crossGRFDst ||
1736-
( dst && IS_DTYPE( dst->getType() ) && IS_WTYPE(inst->getSrc(i)->getType()) ) )
1727+
if (!crossGRFDst ||
1728+
(dst && IS_DTYPE(dst->getType()) && IS_WTYPE(inst->getSrc(i)->getType())))
17371729
{
1738-
//moveSrcToGRF( iter, i, 1, bb, invDUTab );
1739-
inst->setSrc( insertMovBefore( iter, i, inst->getSrc(i)->getType(), bb ), i );
1730+
inst->setSrc(insertMovBefore(iter, i, inst->getSrc(i)->getType(), bb), i);
17401731
}
17411732
else
17421733
{
1743-
moveSrcToGRF( iter, i, 2, bb );
1734+
moveSrcToGRF(iter, i, 2, bb);
17441735
}
17451736
badTwoGRFSrc[i] = false;
17461737
INST_LIST_ITER tmpIter = iter;
17471738
tmpIter--;
1748-
reduceExecSize( tmpIter, bb );
1749-
if( builder.getOption(vISA_OptReport) )
1739+
reduceExecSize(tmpIter, bb);
1740+
if (builder.getOption(vISA_OptReport))
17501741
{
1751-
(*tmpIter)->emit( std::cout );
1742+
(*tmpIter)->emit(std::cout);
17521743
std::cout << std::endl;
17531744
}
17541745
}

0 commit comments

Comments
 (0)