@@ -964,7 +964,6 @@ namespace IGC
964
964
case Instruction::FSub:
965
965
match = MatchFrc (I) ||
966
966
MatchLrp (I) ||
967
- MatchPredAdd (I) ||
968
967
MatchMad (I) ||
969
968
MatchAbsNeg (I) ||
970
969
MatchModifier (I);
@@ -1700,7 +1699,8 @@ namespace IGC
1700
1699
}
1701
1700
}
1702
1701
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);
1704
1704
for (uint iAdd = 0 ; iAdd < 2 && !found; iAdd++)
1705
1705
{
1706
1706
Value* src = I.getOperand (iAdd);
@@ -1740,32 +1740,17 @@ namespace IGC
1740
1740
continue ;
1741
1741
}
1742
1742
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)
1747
1743
// 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
1752
1747
1753
- // case 2 (fsub match @ iAdd = 0)
1754
- // Before match
1755
- // %105 = fsub %102 %103
1756
1748
// After match
1757
- // %105 = - %103
1758
- // (%res_s48) %105 = fadd %105 %98
1749
+ // %105 = %103
1750
+ // (%res_s48) %105 = fadd %103 %98
1759
1751
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)
1769
1754
1770
1755
sources[0 ] = I.getOperand (1 ^ iAdd);
1771
1756
sources[1 ] = mul->getOperand (1 ^ iMul);
@@ -1775,11 +1760,6 @@ namespace IGC
1775
1760
GetModifier (*sources[1 ], src_mod[1 ], sources[1 ]);
1776
1761
GetModifier (*pred, pred_mod, pred);
1777
1762
1778
- if (I.getOpcode () == Instruction::FSub)
1779
- {
1780
- src_mod[iAdd] = CombineModifier (EMOD_NEG, src_mod[iAdd]);
1781
- }
1782
-
1783
1763
found = true ;
1784
1764
break ;
1785
1765
} // if (llvm::SelectInst* selInst = dyn_cast<SelectInst>(mul->getOperand(iMul)))
0 commit comments