Skip to content

Commit d36f8dd

Browse files
bcheng0127sys_zuul
authored andcommitted
[Autobackout][FuncReg]Revert of change: bf60373
relax ACC substitution constraints Change-Id: Iaa29487e7cd56ca2d5565a3beb59be7218e75d5a
1 parent 2507c05 commit d36f8dd

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

visa/Gen4_IR.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7822,6 +7822,11 @@ bool G4_INST::canSrcBeAcc(Gen4_Operand_Number opndNum) const
78227822
}
78237823

78247824
G4_SrcRegRegion* src = getSrc(srcId)->asSrcRegRegion();
7825+
if (srcId == 1 && src->getModifier() != Mod_src_undef)
7826+
{
7827+
// src1 acc does not support modifiers
7828+
return false;
7829+
}
78257830
if (!src->getRegion()->isContiguous(getExecSize()))
78267831
{
78277832
return false;
@@ -7912,7 +7917,7 @@ bool G4_INST::canSrcBeAcc(Gen4_Operand_Number opndNum) const
79127917
case G4_mad:
79137918
// no int acc if it's used as mul operand
79147919
return builder.canMadHaveAcc() &&
7915-
(IS_FTYPE(src->getType()) || (src->getType() == Type_DF));
7920+
((srcId == 1 && (IS_FTYPE(src->getType()) || (src->getType() == Type_DF))) || (srcId == 0 && src->getModifier() == Mod_src_undef));
79167921
case G4_csel:
79177922
return builder.canMadHaveAcc();
79187923
case G4_mul:

visa/HWConformity.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4392,10 +4392,7 @@ static bool isAccCandidate(G4_INST* inst, G4_Kernel& kernel, int& lastUse, bool&
43924392
}
43934393
else if (opndNum != Opnd_src0)
43944394
{
4395-
if (!useInst->canSwapSource())
4396-
{
4397-
return false;
4398-
}
4395+
return false;
43994396
}
44004397

44014398
if (useInst->getSingleDef(opndNum) == nullptr)
@@ -4506,22 +4503,6 @@ static bool replaceDstWithAcc(G4_INST* inst, int accNum, IR_Builder& builder)
45064503
return false;
45074504
}
45084505
}
4509-
4510-
if (useInst->getNumSrc() == 2)
4511-
{
4512-
if (use.second != Opnd_src0)
4513-
{
4514-
if (useInst->canSwapSource() && !useInst->getSrc(0)->isAccReg())
4515-
{
4516-
useInst->swapSrc(0, 1);
4517-
use.second = Opnd_src0;
4518-
}
4519-
else
4520-
{
4521-
return false;
4522-
}
4523-
}
4524-
}
45254506
}
45264507

45274508
// at this point acc substitution must succeed

0 commit comments

Comments
 (0)