Skip to content

Commit bf94c04

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: 0fe2acf: src2 acc support
For single precision float instruction only
1 parent 8955b78 commit bf94c04

File tree

4 files changed

+9
-41
lines changed

4 files changed

+9
-41
lines changed

visa/G4_IR.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7336,24 +7336,6 @@ bool G4_INST::canDstBeAcc() const {
73367336
}
73377337
}
73387338

7339-
bool G4_INST::relaxAccInSrc2 () const {
7340-
if (getNumSrc() != 3)
7341-
return false;
7342-
7343-
if (builder.canUseAccInSrc2ForFloat3SourcesInst()) {
7344-
if ((getDst() && !IS_FTYPE(getDst()->getType())) ||
7345-
(getSrc(2) && !IS_FTYPE(getSrc(2)->getType())) ||
7346-
(getSrc(0) && !IS_FTYPE(getSrc(0)->getType())) ||
7347-
(getSrc(1) && !IS_FTYPE(getSrc(1)->getType()))) {
7348-
return false;
7349-
} else {
7350-
return true;
7351-
}
7352-
}
7353-
7354-
return false;
7355-
}
7356-
73577339
// returns true if src0/1/2 may be replaced by an explicit acc
73587340
// in addition to opcode-specific checks, we require
73597341
// -- contiguous regions
@@ -7366,8 +7348,7 @@ bool G4_INST::canSrcBeAccBeforeHWConform(Gen4_Operand_Number opndNum) const {
73667348

73677349
if (!builder.relaxedACCRestrictions3() &&
73687350
!builder.removedAccRestrictionsAsGRF() && srcId == 2) {
7369-
if (!relaxAccInSrc2())
7370-
return false;
7351+
return false;
73717352
}
73727353

73737354
if (getSrc(srcId) == nullptr || !getSrc(srcId)->isSrcRegRegion()) {

visa/G4_IR.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,6 @@ class G4_INST {
878878

879879
bool canSrcBeAccBeforeHWConform(Gen4_Operand_Number opndNum) const;
880880

881-
bool relaxAccInSrc2() const;
882-
883881
bool canSrcBeAccAfterHWConform(Gen4_Operand_Number opndNum) const;
884882

885883
TARGET_PLATFORM getPlatform() const;

visa/HWCaps.inc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -810,11 +810,6 @@ bool removedAccRestrictionsAsGRF() const {
810810
return false;
811811
}
812812

813-
// when all source and dst are float data type, Src2 can be accumulator
814-
bool canUseAccInSrc2ForFloat3SourcesInst() const {
815-
return getPlatform() >= Xe2;
816-
}
817-
818813

819814
bool needBothAcc(G4_Operand *opnd) const {
820815
switch (opnd->getType()) {

visa/Passes/AccSubstitution.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)