Skip to content

Commit 0ca7ce1

Browse files
scottp101sys_zuul
authored andcommitted
* Fix ptr.to.pair when src is uniform but dst is not.
* Bail on MatchRegionPattern if vstride would be too large. Change-Id: Ia33e79c40aef9fd468263fa7989b4bb003ddc1df
1 parent 1fb78eb commit 0ca7ce1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,8 @@ void EmitPass::EmitPtrToPair(GenIntrinsicInst* GII, const SSource Sources[1], co
21062106
m_encoder->Push();
21072107
}
21082108
else {
2109-
m_encoder->SetSrcRegion(0, 2, 1, 0);
2109+
if (!Src->IsUniform())
2110+
m_encoder->SetSrcRegion(0, 2, 1, 0);
21102111
m_encoder->SetSrcSubReg(0, 0);
21112112
m_encoder->Copy(Lo, Src);
21122113
m_encoder->Push();
@@ -2120,7 +2121,8 @@ void EmitPass::EmitPtrToPair(GenIntrinsicInst* GII, const SSource Sources[1], co
21202121
m_encoder->Push();
21212122
}
21222123
else {
2123-
m_encoder->SetSrcRegion(0, 2, 1, 0);
2124+
if (!Src->IsUniform())
2125+
m_encoder->SetSrcRegion(0, 2, 1, 0);
21242126
m_encoder->SetSrcSubReg(0, 1);
21252127
m_encoder->Copy(Hi, Src);
21262128
m_encoder->Push();

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4044,9 +4044,9 @@ namespace IGC
40444044
//Check to make sure we dont end up with an invalid Vertical Stride.
40454045
//Only 1, 2, 4, 8, 16 are supported.
40464046
if (shiftFactor <= 4)
4047-
{
4048-
verticalStride = (int)pow(2, shiftFactor);
4049-
}
4047+
verticalStride = (1U << shiftFactor);
4048+
else
4049+
return false;
40504050
}
40514051
}
40524052
}

0 commit comments

Comments
 (0)