@@ -508,9 +508,6 @@ bool AccSubPass::isAccCandidate(G4_INST *inst, int &lastUse, bool &mustBeAcc0,
508508 threeSrcUses.push_back (useInst);
509509 switch (opndNum) {
510510 case Opnd_src2:
511- if (inst->relaxAccInSrc2 ()) { // No need to swap
512- break ;
513- }
514511 if (!kernel.fg .builder ->relaxedACCRestrictions3 () &&
515512 !kernel.fg .builder ->removedAccRestrictionsAsGRF ()) {
516513 // If swapAccSub is disabled, skip further checking on src2.
@@ -572,15 +569,13 @@ bool AccSubPass::isAccCandidate(G4_INST *inst, int &lastUse, bool &mustBeAcc0,
572569 if (!kernel.fg .builder ->relaxedACCRestrictions3 () &&
573570 !kernel.fg .builder ->removedAccRestrictionsAsGRF () && SwappableUses &&
574571 isCommutativeOnSrc12 (useInst)) {
575- if (!useInst->relaxAccInSrc2 ()) {
576- // As src2 cannot use acc, acc substitution is only
577- // feasible if src1 and src2 are different.
578- auto *def2 = useInst->getSingleDef (Opnd_src2);
579- // If the single-def on src2 is the same as this use-inst,
580- // the acc substitution is infeasible.
581- if (def2 && def2 == inst)
582- return false ;
583- }
572+ // As src2 cannot use acc, acc substitution is only
573+ // feasible if src1 and src2 are different.
574+ auto *def2 = useInst->getSingleDef (Opnd_src2);
575+ // If the single-def on src2 is the same as this use-inst,
576+ // the acc substitution is infeasible.
577+ if (def2 && def2 == inst)
578+ return false ;
584579 // CHECK: source modifier on itself & src2 on TGLLP.
585580 if (builder.getPlatform () == GENX_TGLLP) {
586581 switch (useInst->getSrc (1 )->asSrcRegRegion ()->getModifier ()) {
@@ -690,8 +685,7 @@ bool AccSubPass::isAccCandidate(G4_INST *inst, int &lastUse, bool &mustBeAcc0,
690685 // ternary instruction, says 'mad'.
691686 if (SwappableUses) {
692687 if (isCommutativeOnSrc12 (useInst) && useInst->getNumSrc () == 3 &&
693- (opndNum == Opnd_src1 || opndNum == Opnd_src2) &&
694- !useInst->relaxAccInSrc2 ()) {
688+ (opndNum == Opnd_src1 || opndNum == Opnd_src2)) {
695689 SwappableUses->push_back (use);
696690 }
697691 }
0 commit comments