diff --git a/visa/BinaryEncodingIGA.cpp b/visa/BinaryEncodingIGA.cpp index 6355191181bc..5e4cc2964b12 100644 --- a/visa/BinaryEncodingIGA.cpp +++ b/visa/BinaryEncodingIGA.cpp @@ -975,6 +975,25 @@ void BinaryEncodingIGA::SetSWSB(G4_INST *inst, SWSB &sw) { sw.sbid = token; } + // Workaround: adjust send's swsb to align with HW behavior. Only adjust + // when solely token or distance is used on the instruction. + // - send has only SBID.src/dst --> SBID.set + // - send has only distance --> $0 and distance + // This workaround can be removed once vISA doesn't produce such SWSB. + // Currently this could happen only on EOT send. + if (inst->isSend() && !sw.hasBothDistAndToken() && + !sw.verify(IGAKernel->getModel().getSWSBEncodeMode(), + SWSB::InstType::SEND)) { + sw.tokenType = SWSB::TokenType::SET; + if (sw.hasDist()) { + // if the distance type cannot be combined with SBID.set, force + // to ALL pipe + if (sw.distType != SWSB::DistType::REG_DIST_ALL && + sw.distType != SWSB::DistType::REG_DIST_FLOAT && + sw.distType != SWSB::DistType::REG_DIST_INT) + sw.distType = SWSB::DistType::REG_DIST_ALL; + } + } return; } diff --git a/visa/LocalScheduler/SWSB_G4IR.cpp b/visa/LocalScheduler/SWSB_G4IR.cpp index 3c111a2ff997..6963a917829d 100644 --- a/visa/LocalScheduler/SWSB_G4IR.cpp +++ b/visa/LocalScheduler/SWSB_G4IR.cpp @@ -2904,8 +2904,7 @@ void SWSB::tokenAllocation() { printf("\n=======nodeID: %d, startID: %d, endID: %d\n", node->getNodeID(), node->getLiveStartID(), node->getLiveEndID()); #endif - - if (!fg.builder->hasFourALUPipes() && inst->isEOT()) { + if (inst->isEOT()) { continue; }