Skip to content

Commit 35cc38f

Browse files
fangliu2020igcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 43681f8
Fix a few register regioning issues for 64b instructions on MTL platform There are a few bug in fix64bInst() which will generate invalid instructions: Bug #1: (P09.0) mov (4) r[A00(0,1), 0]<1>:df conv96(0,1)<0;1,0>:df After HWConformity => (W&P09.0) mov (1) TV(0,0)<1>:df conv96(0,1)<0;1,0>:df // do anything as only 2nd channel enabled (W) mov (2) r[A00(0,1), 0]<1>:ud TV(0,0)<0;2,1>:ud // do all as it's noMask Bug #2: mov (8|M8) reduceSrc_0(2,0)<1>:df V0210(0,8)<1;1,0>:w After HWConformity => mov (8|M8) TV56(0,0)<4>:w V0210(0,8)<1;1,0>:w mov (8|M8) TV57(0,0)<1>:df TV56(0,0)<16;4,4>:w (W) mov (16) reduceSrc_0(2,0)<1>:ud TV57(0,0)<1;1,0>:ud // noMask is incorrect here There are two functions which are fix64bInst() and fixUnalignedRegions() to check the register regioning issue for 64b instructions. fix64bInst() is for all platforms which have no 64b regioning(CHV, BXT, ICLLP, XeLP, DG2, MTL, ARL). And fixUnalignedRegions() is for Xe_XeHPSDV+ platforms. So, there are duplicated fixes for some platforms like DG2, MTL and ARL. We should avoid invoking fix64bInst() for Xe_XeHPSDV+ platforms, and let fixUnalignedRegions() to fix it later. With this change, above bugs can be fixed.
1 parent f49460b commit 35cc38f

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

visa/HWConformity.cpp

+12-18
Original file line numberDiff line numberDiff line change
@@ -5776,12 +5776,8 @@ void HWConformity::conformBB(G4_BB *bb) {
57765776
fixVxHFloat64b(i, bb);
57775777
}
57785778

5779-
if (builder.supportFloatOr64bRegioning()) {
5780-
// This function is for pre-Xe_XeHPSDV platforms. Xe_XeHPSDV+ platforms
5781-
// should be fixed in fixUnalignedRegions() later.
5782-
if (fix64bInst(i, bb)) {
5783-
continue;
5784-
}
5779+
if (fix64bInst(i, bb)) {
5780+
continue;
57855781
}
57865782

57875783
#ifdef _DEBUG
@@ -5844,15 +5840,6 @@ void HWConformity::conformBB(G4_BB *bb) {
58445840
}
58455841
}
58465842

5847-
// Do immdiate Address offset OOB check as previous fixes may generate
5848-
// invalid ImmAddrOffset.
5849-
for (auto iter = bb->begin(), iterEnd = bb->end(); iter != iterEnd; ++iter) {
5850-
fixImmAddrOffsetOOB(iter, bb);
5851-
#ifdef _DEBUG
5852-
verifyG4Kernel(kernel, Optimizer::PI_HWConformityChk, false);
5853-
#endif
5854-
}
5855-
58565843
if (builder.getNativeExecSize() <= g4::SIMD8) {
58575844
return;
58585845
}
@@ -5946,6 +5933,15 @@ void HWConformity::conformBB(G4_BB *bb) {
59465933
#endif
59475934
}
59485935
}
5936+
5937+
// Immdiate Address offset OOB check should be put at the end of conformBB
5938+
// as previous fixes may generate invalid ImmAddrOffset.
5939+
for (auto iter = bb->begin(), iterEnd = bb->end(); iter != iterEnd; ++iter) {
5940+
fixImmAddrOffsetOOB(iter, bb);
5941+
#ifdef _DEBUG
5942+
verifyG4Kernel(kernel, Optimizer::PI_HWConformityChk, false);
5943+
#endif
5944+
}
59495945
}
59505946

59515947
//
@@ -9846,9 +9842,7 @@ void HWConformity::fixImmAddrOffsetOOB(INST_LIST_ITER it, G4_BB *bb) {
98469842
// add(execSize) A(0,0)<1>:uw A(0,0)<1;1,0>:uw imm:w
98479843
auto addrDst = builder.createDst(var->getBase(), 0, sregOff, 1, Type_UW);
98489844
auto addrSrc = builder.createSrc(var->getBase(), 0, sregOff,
9849-
execSize == 1 ? builder.getRegionScalar()
9850-
: builder.getRegionStride1(),
9851-
Type_UW);
9845+
builder.getRegionStride1(), Type_UW);
98529846
auto immSrc = builder.createImm(imm, Type_W);
98539847
auto addrAddInst = builder.createInternalInst(
98549848
nullptr, G4_add, nullptr, g4::NOSAT, G4_ExecSize(execSize), addrDst,

0 commit comments

Comments
 (0)