Skip to content

Commit e233af2

Browse files
fangliu2020igcbot
authored andcommitted
Fix dst/src overlapping in HWConformity
After inserting temp to avoid dst/src overlapping, need to check additional region rules to ensure both the new instruction and inserted mov instruction are legitimate.
1 parent 6ba42ba commit e233af2

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

visa/HWConformity.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5460,11 +5460,21 @@ void HWConformity::avoidInstDstSrcOverlap(INST_LIST_ITER it, G4_BB *bb,
54605460
insertMovAfter(it, inst->getDst(), inst->getDst()->getType(), bb);
54615461
newDst->setAccRegSel(accSel);
54625462
inst->setDest(newDst);
5463-
}
5464-
}
54655463

5466-
if (!builder.supportFloatOr64bRegioning()) {
5467-
fixUnalignedRegions(it, bb);
5464+
// After inserting temp to avoid dst/src overlapping, need to check
5465+
// additional region rules to ensure both the new instruction and the
5466+
// inserted mov instruction are legitimate. For example:
5467+
// mov (M1, 4) V67(0,0)<1>:df (-)V67(0,5)<1;1,0>:df
5468+
// After fixing dst/src overlapping =>
5469+
// mov (M1, 4) TV1(0,0)<1>:df (-)V67(0,5)<1;1,0>:df
5470+
// (W) mov (M1, 4) V67(0,0)<1>:df TV1(0,0)<1;1,0>:df
5471+
// Both instructions are illegal.
5472+
if (!builder.supportFloatOr64bRegioning()) {
5473+
auto nextIt = std::next(it);
5474+
fixUnalignedRegions(it, bb);
5475+
fixUnalignedRegions(nextIt, bb);
5476+
}
5477+
}
54685478
}
54695479
}
54705480

0 commit comments

Comments
 (0)