Skip to content

Commit 6218054

Browse files
pratikasharigcbot
authored andcommitted
Fix condition for acc rule
Fix condition for acc rule
1 parent 605bc38 commit 6218054

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

visa/Passes/AccSubstitution.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,12 @@ bool AccSubPass::replaceDstWithAcc(G4_INST* inst, int accNum)
636636
{
637637
// mul/mac can't have both sources be acc
638638
// Note that we only need to check for explicit mac here since we will not change mad to mac
639-
if (!builder.relaxedACCRestrictions_1())
639+
if (useInst->opcode() == G4_mul || useInst->opcode() == G4_mac)
640640
{
641-
if (useInst->opcode() == G4_mul || useInst->opcode() == G4_mac)
641+
if (useInst->getSrc(0)->isAccReg() || useInst->getSrc(1)->isAccReg() ||
642+
useInst->getSrc(0)->compareOperand(useInst->getSrc(1)) == G4_CmpRelation::Rel_eq)
642643
{
643-
if (useInst->getSrc(0)->isAccReg() || useInst->getSrc(1)->isAccReg())
644-
{
645-
return false;
646-
}
644+
return false;
647645
}
648646
}
649647
}

0 commit comments

Comments
 (0)