Skip to content

Commit eb5648e

Browse files
priyankarpsys_zuul
authored andcommitted
Avoid splitting in case of uniform destination
Change-Id: I66b00d95974f7ad09de0471722541933cb190216
1 parent 04b2cda commit eb5648e

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,8 @@ namespace IGC
622622

623623
unsigned numParts = 0;
624624
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)) {
627627

628628
VISA_EMask_Ctrl execMask = GetAluEMask(dst);
629629
VISA_Exec_Size fromExecSize = GetAluExecSize(dst);
@@ -1050,8 +1050,8 @@ namespace IGC
10501050

10511051
unsigned numParts = 0;
10521052
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)) {
10551055

10561056
VISA_EMask_Ctrl execMask = GetAluEMask(dst);
10571057
VISA_Exec_Size fromExecSize = GetAluExecSize(dst);
@@ -1097,7 +1097,7 @@ namespace IGC
10971097
// numParts - return the total parts to be split, e.g. if the region spans 4
10981098
// GRFs, it needs splitting into 2 parts at least.
10991099
bool CEncoder::NeedSplitting(CVariable* var, const SModifier& mod,
1100-
unsigned& numParts, bool isSource) const
1100+
unsigned& numParts, bool isSource, CVariable* dstVar) const
11011101
{
11021102
// If nothing is specified, don't split.
11031103
if (!var)
@@ -1139,6 +1139,11 @@ namespace IGC
11391139
return false;
11401140
}
11411141

1142+
// Avoid splitting if destination is uniform and is not an indirect address
1143+
if (dstVar && !GetAluExecSize(dstVar)) {
1144+
return false;
1145+
}
1146+
11421147
// We assume there is no 2 GRF crossing when element size is smaller than
11431148
// 4 bytes (or 32 bits), e.g. 16-bit WORD.
11441149
if (elemSize < 4)
@@ -1566,8 +1571,9 @@ namespace IGC
15661571
}
15671572
}
15681573
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)) {
15711577

15721578
VISA_EMask_Ctrl execMask = GetAluEMask(dst);
15731579
VISA_Exec_Size fromExecSize = GetAluExecSize(dst);
@@ -1756,10 +1762,10 @@ namespace IGC
17561762
{
17571763
unsigned numParts = 0;
17581764
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)) {
17631769

17641770
VISA_EMask_Ctrl execMask = GetAluEMask(dst);
17651771
VISA_Exec_Size fromExecSize = GetAluExecSize(dst);
@@ -1810,9 +1816,9 @@ namespace IGC
18101816
{
18111817
unsigned numParts = 0;
18121818
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)) {
18161822

18171823
VISA_EMask_Ctrl execMask = GetAluEMask(dst);
18181824
VISA_Exec_Size fromExecSize = GetAluExecSize(dst);

IGC/Compiler/CISACodeGen/CISABuilder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ namespace IGC
450450

451451
// Variable splitting facilities (if crosses 2 GRF boundary).
452452
bool NeedSplitting(CVariable* var, const SModifier& mod,
453-
unsigned& numParts, bool isSource = false) const;
453+
unsigned& numParts, bool isSource = false, CVariable* dstVar = nullptr) const;
454454
SModifier SplitVariable(VISA_Exec_Size fromExecSize,
455455
VISA_Exec_Size toExecSize,
456456
unsigned thePart,

0 commit comments

Comments
 (0)