Skip to content

Commit f1805f7

Browse files
committed
[Autobackout][FuncReg]Revert of change: 8091063
Support Predicate Add with fsub, Part 3 HSD/Radar: n/a Change-Id: Icc97970225cb86bb6ff3b99fb8f19031c08b7c64
1 parent 3244dc1 commit f1805f7

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,6 @@ namespace IGC
964964
case Instruction::FSub:
965965
match = MatchFrc(I) ||
966966
MatchLrp(I) ||
967-
MatchPredAdd(I) ||
968967
MatchMad(I) ||
969968
MatchAbsNeg(I) ||
970969
MatchModifier(I);
@@ -1700,7 +1699,8 @@ namespace IGC
17001699
}
17011700
}
17021701

1703-
assert(I.getOpcode() == Instruction::FAdd || I.getOpcode() == Instruction::FSub);
1702+
// FSub is not supported currently due to addional instruction requirement
1703+
assert(I.getOpcode() == Instruction::FAdd);
17041704
for (uint iAdd = 0; iAdd < 2 && !found; iAdd++)
17051705
{
17061706
Value* src = I.getOperand(iAdd);
@@ -1740,32 +1740,17 @@ namespace IGC
17401740
continue;
17411741
}
17421742

1743-
// % 97 = select i1 %res_s48, float 1.000000e+00, float 0.000000e+00
1744-
// %102 = fmul fast float %97 %98
1745-
1746-
// case 1 (add)
17471743
// Before match
1748-
// %105 = fadd %102 %103
1749-
// After match
1750-
// %105 = %103
1751-
// (%res_s48) %105 = fadd %105 %98
1744+
// % 97 = select i1 %res_s48, float 1.000000e+00, float 0.000000e+00
1745+
// %102 = fmul fast float %97 %98
1746+
// %105 = fadd %102 %103
17521747

1753-
// case 2 (fsub match @ iAdd = 0)
1754-
// Before match
1755-
// %105 = fsub %102 %103
17561748
// After match
1757-
// %105 = -%103
1758-
// (%res_s48) %105 = fadd %105 %98
1749+
// %105 = %103
1750+
// (%res_s48) %105 = fadd %103 %98
17591751

1760-
// case 3 (fsub match @ iAdd = 1)
1761-
// Before match
1762-
// %105 = fsub %103 %102
1763-
// After match
1764-
// %105 = %103
1765-
// (%res_s48) %98 = fadd %105 -%98
1766-
1767-
// sources[0]: store add operand (i.e. %103 above)
1768-
// sources[1]: store mul operand (i.e. %98 above)
1752+
// sources[0]: add operand (i.e. %103 above)
1753+
// sources[1]: mul operand (i.e. %98 above)
17691754

17701755
sources[0] = I.getOperand(1 ^ iAdd);
17711756
sources[1] = mul->getOperand(1 ^ iMul);
@@ -1775,11 +1760,6 @@ namespace IGC
17751760
GetModifier(*sources[1], src_mod[1], sources[1]);
17761761
GetModifier(*pred, pred_mod, pred);
17771762

1778-
if (I.getOpcode() == Instruction::FSub)
1779-
{
1780-
src_mod[iAdd] = CombineModifier(EMOD_NEG, src_mod[iAdd]);
1781-
}
1782-
17831763
found = true;
17841764
break;
17851765
} // if (llvm::SelectInst* selInst = dyn_cast<SelectInst>(mul->getOperand(iMul)))

0 commit comments

Comments
 (0)