Skip to content

Commit 495e061

Browse files
fangliu2020igcbot
authored andcommitted
Fix operands alignment issues for SIMD2 instructions with 64b or float datatype
Fix operands alignment issues for SIMD2 instructions with 64b or float datatype
1 parent 9d7bfe9 commit 495e061

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

visa/HWConformity.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8358,8 +8358,12 @@ void HWConformity::fixUnalignedRegions(INST_LIST_ITER it, G4_BB *bb) {
83588358
// split currently can't handle packed imm
83598359
// Also don't split src byte type since scalar byte to float conversion is
83608360
// not allowed
8361-
auto canSplit = [](G4_INST *inst) {
8362-
if (inst->getPredicate() || inst->getCondMod()) {
8361+
auto canSplit = [](G4_INST *inst, G4_BB *bb) {
8362+
// Can not split any instruction except for NoMask ones because there is
8363+
// no legal emask for the split instructions.
8364+
bool isNoMaskInst = !inst->getPredicate() &&
8365+
(inst->isWriteEnableInst() || bb->isAllLaneActive());
8366+
if (inst->getPredicate() || inst->getCondMod() || !isNoMaskInst) {
83638367
return false;
83648368
}
83658369
for (int i = 0, numSrc = inst->getNumSrc(); i < numSrc; ++i) {
@@ -8370,7 +8374,7 @@ void HWConformity::fixUnalignedRegions(INST_LIST_ITER it, G4_BB *bb) {
83708374
}
83718375
return true;
83728376
};
8373-
if (canSplit(inst)) {
8377+
if (canSplit(inst, bb)) {
83748378
auto prevIt = it == bb->begin() ? it : std::prev(it);
83758379
if (evenlySplitInst(it, bb)) {
83768380
// split introduces new moves which may need fixing

0 commit comments

Comments
 (0)