From 11d1e56e1cfb088cc7abf1e86a4434c19ba1f603 Mon Sep 17 00:00:00 2001 From: bcheng0127 Date: Mon, 10 Jul 2023 23:27:30 -0700 Subject: [PATCH] [Autobackout][FuncReg]Revert of change: c9a7831d551c2875b7f85c1b77528b3f90d854d9 For send instruction if any dependence is set the token ID is required For send instruction if any dependence is set the token ID is required --- visa/BinaryEncodingIGA.cpp | 19 +++++++++++++++++++ visa/LocalScheduler/SWSB_G4IR.cpp | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) 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; }