@@ -622,8 +622,8 @@ namespace IGC
622
622
623
623
unsigned numParts = 0 ;
624
624
if (NeedSplitting (dst, m_encoderState.m_dstOperand , numParts) ||
625
- NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true ) ||
626
- NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true )) {
625
+ NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true , dst ) ||
626
+ NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true , dst )) {
627
627
628
628
VISA_EMask_Ctrl execMask = GetAluEMask (dst);
629
629
VISA_Exec_Size fromExecSize = GetAluExecSize (dst);
@@ -1050,8 +1050,8 @@ namespace IGC
1050
1050
1051
1051
unsigned numParts = 0 ;
1052
1052
if (NeedSplitting (dst, m_encoderState.m_dstOperand , numParts) ||
1053
- NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true ) ||
1054
- NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true )) {
1053
+ NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true , dst ) ||
1054
+ NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true , dst )) {
1055
1055
1056
1056
VISA_EMask_Ctrl execMask = GetAluEMask (dst);
1057
1057
VISA_Exec_Size fromExecSize = GetAluExecSize (dst);
@@ -1097,7 +1097,7 @@ namespace IGC
1097
1097
// numParts - return the total parts to be split, e.g. if the region spans 4
1098
1098
// GRFs, it needs splitting into 2 parts at least.
1099
1099
bool CEncoder::NeedSplitting (CVariable* var, const SModifier& mod,
1100
- unsigned & numParts, bool isSource) const
1100
+ unsigned & numParts, bool isSource, CVariable* dstVar ) const
1101
1101
{
1102
1102
// If nothing is specified, don't split.
1103
1103
if (!var)
@@ -1139,6 +1139,11 @@ namespace IGC
1139
1139
return false ;
1140
1140
}
1141
1141
1142
+ // Avoid splitting if destination is uniform and is not an indirect address
1143
+ if (dstVar && !GetAluExecSize (dstVar)) {
1144
+ return false ;
1145
+ }
1146
+
1142
1147
// We assume there is no 2 GRF crossing when element size is smaller than
1143
1148
// 4 bytes (or 32 bits), e.g. 16-bit WORD.
1144
1149
if (elemSize < 4 )
@@ -1566,8 +1571,9 @@ namespace IGC
1566
1571
}
1567
1572
}
1568
1573
unsigned numParts = 0 ;
1569
- if (NeedSplitting (dst, m_encoderState.m_dstOperand , numParts) ||
1570
- NeedSplitting (src, m_encoderState.m_srcOperand [0 ], numParts, true )) {
1574
+
1575
+ if ((NeedSplitting (dst, m_encoderState.m_dstOperand , numParts)) ||
1576
+ NeedSplitting (src, m_encoderState.m_srcOperand [0 ], numParts, true , dst)) {
1571
1577
1572
1578
VISA_EMask_Ctrl execMask = GetAluEMask (dst);
1573
1579
VISA_Exec_Size fromExecSize = GetAluExecSize (dst);
@@ -1756,10 +1762,10 @@ namespace IGC
1756
1762
{
1757
1763
unsigned numParts = 0 ;
1758
1764
if (NeedSplitting (dst, m_encoderState.m_dstOperand , numParts) ||
1759
- NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true ) ||
1760
- NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true ) ||
1761
- NeedSplitting (src2, m_encoderState.m_srcOperand [2 ], numParts, true ) ||
1762
- NeedSplitting (src3, m_encoderState.m_srcOperand [3 ], numParts, true )) {
1765
+ NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true , dst ) ||
1766
+ NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true , dst ) ||
1767
+ NeedSplitting (src2, m_encoderState.m_srcOperand [2 ], numParts, true , dst ) ||
1768
+ NeedSplitting (src3, m_encoderState.m_srcOperand [3 ], numParts, true , dst )) {
1763
1769
1764
1770
VISA_EMask_Ctrl execMask = GetAluEMask (dst);
1765
1771
VISA_Exec_Size fromExecSize = GetAluExecSize (dst);
@@ -1810,9 +1816,9 @@ namespace IGC
1810
1816
{
1811
1817
unsigned numParts = 0 ;
1812
1818
if (NeedSplitting (dst, m_encoderState.m_dstOperand , numParts) ||
1813
- NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true ) ||
1814
- NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true ) ||
1815
- NeedSplitting (src2, m_encoderState.m_srcOperand [2 ], numParts, true )) {
1819
+ NeedSplitting (src0, m_encoderState.m_srcOperand [0 ], numParts, true , dst ) ||
1820
+ NeedSplitting (src1, m_encoderState.m_srcOperand [1 ], numParts, true , dst ) ||
1821
+ NeedSplitting (src2, m_encoderState.m_srcOperand [2 ], numParts, true , dst )) {
1816
1822
1817
1823
VISA_EMask_Ctrl execMask = GetAluEMask (dst);
1818
1824
VISA_Exec_Size fromExecSize = GetAluExecSize (dst);
0 commit comments