Commit b356a716 authored by Wei Pan's avatar Wei Pan Committed by gbsbuild

Message descriptor cannot be null, remove unused DAG dependency type etc

Change-Id: Icd87d63a2557d50047772f48b46114bf1329fc6a
parent a04e08d7
...@@ -288,14 +288,11 @@ inline void BinaryEncoding::EncodeSendMsgDesc29_30(G4_INST* inst) ...@@ -288,14 +288,11 @@ inline void BinaryEncoding::EncodeSendMsgDesc29_30(G4_INST* inst)
BinInst *mybin = inst->getBinInst(); BinInst *mybin = inst->getBinInst();
G4_SendMsgDescriptor* msgDesc = inst->getMsgDesc(); G4_SendMsgDescriptor* msgDesc = inst->getMsgDesc();
if (msgDesc != nullptr) G4_Operand* descOpnd = inst->isSplitSend() ? inst->getSrc(2) : inst->getSrc(1);
if (!descOpnd->isImm())
{ {
G4_Operand* descOpnd = inst->isSplitSend() ? inst->getSrc(2) : inst->getSrc(1); uint32_t bitValue = (msgDesc->is16BitReturn() << 1) + msgDesc->is16BitInput();
if (!descOpnd->isImm()) mybin->SetBits(bitsSendDesc_30, bitsSendDesc_29, bitValue);
{
uint32_t bitValue = (msgDesc->is16BitReturn() << 1) + msgDesc->is16BitInput();
mybin->SetBits(bitsSendDesc_30, bitsSendDesc_29, bitValue);
}
} }
} }
......
...@@ -3232,31 +3232,27 @@ void G4_INST::emit_send_desc(std::ostream& output) ...@@ -3232,31 +3232,27 @@ void G4_INST::emit_send_desc(std::ostream& output)
// Emit a text description of the descriptor if it is available // Emit a text description of the descriptor if it is available
G4_SendMsgDescriptor* msgDesc = sendInst->getMsgDesc(); G4_SendMsgDescriptor* msgDesc = sendInst->getMsgDesc();
if (msgDesc) output << " // ";
{
output << " // ";
if (msgDesc->getDescType() != NULL) if (msgDesc->getDescType() != NULL)
{ {
output << msgDesc->getDescType(); output << msgDesc->getDescType();
} }
output << ", resLen=" << msgDesc->ResponseLength(); output << ", resLen=" << msgDesc->ResponseLength();
output << ", msgLen=" << msgDesc->MessageLength(); output << ", msgLen=" << msgDesc->MessageLength();
if (isSplitSend()) if (isSplitSend())
{ {
output << ", extMsgLen=" << msgDesc->extMessageLength(); output << ", extMsgLen=" << msgDesc->extMessageLength();
} }
if (msgDesc->isBarrierMsg()) if (msgDesc->isBarrierMsg())
{ {
output << ", barrier"; output << ", barrier";
} }
}
} }
void void G4_INST::emit_send(std::ostream& output, bool dotStyle)
G4_INST::emit_send(std::ostream& output, bool dotStyle)
{ {
if (pCisaBuilder->m_options.getOption(vISA_SymbolReg)) if (pCisaBuilder->m_options.getOption(vISA_SymbolReg))
......
...@@ -284,16 +284,6 @@ private: ...@@ -284,16 +284,6 @@ private:
G4_Operand *m_bti; G4_Operand *m_bti;
public: public:
G4_SendMsgDescriptor()
{
desc.value = 0;
extDesc.value = 0;
readMsg = false;
writeMsg = false;
m_bti = NULL;
m_sti = NULL;
};
static const int SLMIndex = 0xFE; static const int SLMIndex = 0xFE;
G4_SendMsgDescriptor( uint32_t fCtrl, uint32_t regs2rcv, uint32_t regs2snd, G4_SendMsgDescriptor( uint32_t fCtrl, uint32_t regs2rcv, uint32_t regs2snd,
...@@ -830,9 +820,6 @@ public: ...@@ -830,9 +820,6 @@ public:
return false; return false;
G4_SendMsgDescriptor *MD = getMsgDesc(); G4_SendMsgDescriptor *MD = getMsgDesc();
if (!MD)
return false;
CISA_SHARED_FUNCTION_ID SFID = MD->getFuncId(); CISA_SHARED_FUNCTION_ID SFID = MD->getFuncId();
unsigned FC = MD->getFuncCtrl(); unsigned FC = MD->getFuncCtrl();
...@@ -1117,14 +1104,18 @@ public: ...@@ -1117,14 +1104,18 @@ public:
return NULL; return NULL;
} }
void setMsgDesc( G4_SendMsgDescriptor *in ) void setMsgDesc(G4_SendMsgDescriptor *in)
{ {
assert(in && "null descriptor not expected");
msgDesc = in; msgDesc = in;
resetRightBound((G4_Operand*) dst); resetRightBound((G4_Operand*) dst);
resetRightBound(srcs[0]); resetRightBound(srcs[0]);
} }
G4_SendMsgDescriptor *getMsgDesc() const { return msgDesc; } G4_SendMsgDescriptor *getMsgDesc() const
{
assert(msgDesc && "null descriptor not expected");
return msgDesc;
}
/// Remove all definitons that contribute to this[opndNum] and remove all /// Remove all definitons that contribute to this[opndNum] and remove all
/// uses from their corresponding definitions. To maintain def-use's, this /// uses from their corresponding definitions. To maintain def-use's, this
/// is required while resetting a source operand. /// is required while resetting a source operand.
......
...@@ -5920,7 +5920,6 @@ void GlobalRA::determineSpillRegSize(unsigned& spillRegSize, unsigned& indrSpill ...@@ -5920,7 +5920,6 @@ void GlobalRA::determineSpillRegSize(unsigned& spillRegSize, unsigned& indrSpill
if (curInst->isSend()) if (curInst->isSend())
{ {
G4_SendMsgDescriptor* msgDesc = curInst->getMsgDesc(); G4_SendMsgDescriptor* msgDesc = curInst->getMsgDesc();
ASSERT_USER(msgDesc != NULL, "send has invalid msg descriptor!");
unsigned dstSpillRegSize = 0; unsigned dstSpillRegSize = 0;
dstSpillRegSize = msgDesc->ResponseLength(); dstSpillRegSize = msgDesc->ResponseLength();
......
...@@ -244,15 +244,12 @@ void LocalRA::preLocalRAAnalysis() ...@@ -244,15 +244,12 @@ void LocalRA::preLocalRAAnalysis()
{ {
if (inst->isSend() || inst->isSplitSend()) if (inst->isSend() || inst->isSplitSend())
{ {
if (inst->getMsgDesc()) maxSendReg = (inst->getMsgDesc()->ResponseLength() > maxSendReg) ?
{ (inst->getMsgDesc()->ResponseLength()) : maxSendReg;
maxSendReg = (inst->getMsgDesc()->ResponseLength() > maxSendReg) ? maxSendReg = (inst->getMsgDesc()->MessageLength() > maxSendReg) ?
(inst->getMsgDesc()->ResponseLength()) : maxSendReg; (inst->getMsgDesc()->MessageLength()) : maxSendReg;
maxSendReg = (inst->getMsgDesc()->MessageLength() > maxSendReg) ? maxSendReg = (inst->getMsgDesc()->extMessageLength() > maxSendReg) ?
(inst->getMsgDesc()->MessageLength()) : maxSendReg; (inst->getMsgDesc()->extMessageLength()) : maxSendReg;
maxSendReg = (inst->getMsgDesc()->extMessageLength() > maxSendReg) ?
(inst->getMsgDesc()->extMessageLength()) : maxSendReg;
}
} }
} }
} }
......
...@@ -41,13 +41,6 @@ static DepType DoMemoryInterfereSend(G4_INST *send1, G4_INST *send2, retDepType ...@@ -41,13 +41,6 @@ static DepType DoMemoryInterfereSend(G4_INST *send1, G4_INST *send2, retDepType
return NODEP; return NODEP;
} }
// If it was not possible to decode either send's message descriptor we return
// a conservative dependency.
if (!send1->getMsgDesc() || !send2->getMsgDesc())
{
return INVALID_MSG_DESC;
}
if (send1->getMsgDesc()->isSendBarrier() || send2->getMsgDesc()->isSendBarrier()) if (send1->getMsgDesc()->isSendBarrier() || send2->getMsgDesc()->isSendBarrier())
{ {
return MSG_BARRIER; return MSG_BARRIER;
...@@ -154,13 +147,6 @@ static DepType DoMemoryInterfereScratchSend(G4_INST *send1, G4_INST *send2, retD ...@@ -154,13 +147,6 @@ static DepType DoMemoryInterfereScratchSend(G4_INST *send1, G4_INST *send2, retD
return NODEP; return NODEP;
} }
// If it was not possible to decode either send's message descriptor we return
// a conservative dependency.
if (!send1->getMsgDesc() || !send2->getMsgDesc())
{
return INVALID_MSG_DESC;
}
// scratch RW may only conflict with other scratch RW // scratch RW may only conflict with other scratch RW
if (send1->getMsgDesc()->isScratchRW() != send2->getMsgDesc()->isScratchRW()) if (send1->getMsgDesc()->isScratchRW() != send2->getMsgDesc()->isScratchRW())
{ {
...@@ -247,17 +233,14 @@ DepType vISA::CheckBarrier(G4_INST *inst) ...@@ -247,17 +233,14 @@ DepType vISA::CheckBarrier(G4_INST *inst)
// sendc may imply synchronization // sendc may imply synchronization
return SEND_BARRIER; return SEND_BARRIER;
} }
if (inst->getMsgDesc()) if (inst->getMsgDesc()->isEOTInst())
{ {
if (inst->getMsgDesc()->isEOTInst()) // Send with the EOT message desciptor is a barrier.
{ return SEND_BARRIER;
// Send with the EOT message desciptor is a barrier. }
return SEND_BARRIER; else if (inst->getMsgDesc()->isThreadMessage())
} {
else if (inst->getMsgDesc()->isThreadMessage()) return MSG_BARRIER;
{
return MSG_BARRIER;
}
} }
} }
else if (inst->opcode() == G4_wait || inst->isYieldInst()) else if (inst->opcode() == G4_wait || inst->isYieldInst())
......
...@@ -39,7 +39,6 @@ enum DepType ...@@ -39,7 +39,6 @@ enum DepType
RAW, RAW_MEMORY, RAW, RAW_MEMORY,
WAR, WAR_MEMORY, WAR, WAR_MEMORY,
WAW, WAW_MEMORY, WAW, WAW_MEMORY,
INVALID_MSG_DESC,
CONTROL_FLOW_BARRIER, CONTROL_FLOW_BARRIER,
SEND_BARRIER, SEND_BARRIER,
INDIRECT_ADDR_BARRIER, INDIRECT_ADDR_BARRIER,
......
...@@ -568,12 +568,11 @@ bool preRA_Scheduler::run() ...@@ -568,12 +568,11 @@ bool preRA_Scheduler::run()
unsigned NumOfHighLatencyInsts = 0; unsigned NumOfHighLatencyInsts = 0;
for (auto Inst : *bb) { for (auto Inst : *bb) {
if (Inst->isSend()) { if (Inst->isSend()) {
if (G4_SendMsgDescriptor* MsgDesc = Inst->getMsgDesc()) { G4_SendMsgDescriptor* MsgDesc = Inst->getMsgDesc();
if (MsgDesc->isDataPortRead() || if (MsgDesc->isDataPortRead() ||
MsgDesc->isSampler() || MsgDesc->isSampler() ||
MsgDesc->isAtomicMessage()) MsgDesc->isAtomicMessage())
NumOfHighLatencyInsts++; NumOfHighLatencyInsts++;
}
} }
} }
......
...@@ -17,9 +17,8 @@ unsigned LatencyTable::getLatencyPostRA(G4_INST* Inst) const ...@@ -17,9 +17,8 @@ unsigned LatencyTable::getLatencyPostRA(G4_INST* Inst) const
unsigned LatencyTable::getLatencyLegacy(G4_INST* Inst) const unsigned LatencyTable::getLatencyLegacy(G4_INST* Inst) const
{ {
if (Inst->isSend()) { if (Inst->isSend()) {
if (G4_SendMsgDescriptor* MsgDesc = Inst->getMsgDesc()) G4_SendMsgDescriptor* MsgDesc = Inst->getMsgDesc();
return MsgDesc->getFFLatency(); return MsgDesc->getFFLatency();
return G4_SendMsgDescriptor::getDefaultFFLatency();
} else if (Inst->isMath()) { } else if (Inst->isMath()) {
if (Inst->asMathInst()->getMathCtrl() == MATH_FDIV || if (Inst->asMathInst()->getMathCtrl() == MATH_FDIV ||
Inst->asMathInst()->getMathCtrl() == MATH_POW) Inst->asMathInst()->getMathCtrl() == MATH_POW)
......
...@@ -1642,11 +1642,11 @@ uint32_t DDD::getEdgeLatency_old(Node *node, DepType depT) ...@@ -1642,11 +1642,11 @@ uint32_t DDD::getEdgeLatency_old(Node *node, DepType depT)
G4_SendMsgDescriptor *msgDesc = inst->getMsgDesc(); G4_SendMsgDescriptor *msgDesc = inst->getMsgDesc();
if (msgDesc->isDataPortRead()) if (msgDesc->isDataPortRead())
{ {
return msgDesc->getFFLatency(); return LT.getLatencyPostRA(inst);
} }
} }
if (depT <= NODEP || depT >= INVALID_MSG_DESC) if (depT <= NODEP || depT >= CONTROL_FLOW_BARRIER)
{ {
return node->getOccupancy(); return node->getOccupancy();
} }
...@@ -1672,33 +1672,8 @@ uint32_t DDD::getEdgeLatency_old(Node *node, DepType depT) ...@@ -1672,33 +1672,8 @@ uint32_t DDD::getEdgeLatency_old(Node *node, DepType depT)
return latency; return latency;
} }
uint32_t DDD::getEdgeLatency_new(Node *node, DepType depT) {
if (depT <= NODEP || depT >= INVALID_MSG_DESC)
{
return node->getOccupancy();
}
uint32_t latency = UNCOMPR_LATENCY;
switch (depT)
{
case RAW:
case RAW_MEMORY: {
G4_INST *inst = (*node->getInstructions()).front();
latency = LT.getLatencyPostRA(inst);
break;
}
default:
break;
}
latency = latency > node->getOccupancy() ? latency : node->getOccupancy();
return latency;
}
uint32_t DDD::getEdgeLatency(Node *node, DepType depT) { uint32_t DDD::getEdgeLatency(Node *node, DepType depT) {
uint32_t oldLatency = getEdgeLatency_old(node, depT); uint32_t latency = getEdgeLatency_old(node, depT);
// uint32_t newLatency = getEdgeLatency_new(node, depT);
// assert(oldLatency == newLatency);
uint32_t latency = oldLatency;
if (useMTLatencies) if (useMTLatencies)
{ {
float scale = float(HWthreadsPerEU) / getBuilder()->getCoIssueUints(); float scale = float(HWthreadsPerEU) / getBuilder()->getCoIssueUints();
......
...@@ -304,7 +304,6 @@ public: ...@@ -304,7 +304,6 @@ public:
uint32_t getEdgeLatency_old(Node *node, DepType depT); uint32_t getEdgeLatency_old(Node *node, DepType depT);
uint32_t getEdgeLatency_new(Node *node, DepType depT);
uint32_t getEdgeLatency(Node *node, DepType depT); uint32_t getEdgeLatency(Node *node, DepType depT);
Mem_Manager* get_mem() { return &mem; } Mem_Manager* get_mem() { return &mem; }
IR_Builder* getBuilder() const { return kernel->fg.builder; } IR_Builder* getBuilder() const { return kernel->fg.builder; }
......
...@@ -961,7 +961,6 @@ namespace vISA ...@@ -961,7 +961,6 @@ namespace vISA
for (auto inst : *bb) for (auto inst : *bb)
{ {
if (inst->isSplitSend() && if (inst->isSplitSend() &&
inst->getMsgDesc() &&
inst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER) inst->getMsgDesc()->getFuncId() == CISA_SHARED_FUNCTION_ID::SFID_SAMPLER)
{ {
numSampler++; numSampler++;
......
...@@ -1287,22 +1287,7 @@ SpillManagerGMRF::createPostDstSpillRangeDeclare ( ...@@ -1287,22 +1287,7 @@ SpillManagerGMRF::createPostDstSpillRangeDeclare (
unsigned short nRows; unsigned short nRows;
G4_SendMsgDescriptor* msgDesc = sendOut->getMsgDesc(); G4_SendMsgDescriptor* msgDesc = sendOut->getMsgDesc();
if( msgDesc ) { nRows = msgDesc->ResponseLength();
nRows = msgDesc->ResponseLength();
}
// Otherwise assume all following grfs (limited to 8) in the virtual
// register
else {
nRows =
spilledRegVar->getDeclare ()->getNumRows () -
spilledRegion->getRegOff ();
if (nRows > getSendMaxResponseLength ()) {
nRows = (unsigned short) getSendMaxResponseLength ();
}
}
G4_DstRegRegion * normalizedPostDst = builder_->createDstRegRegion( G4_DstRegRegion * normalizedPostDst = builder_->createDstRegRegion(
Direct, spilledRegVar, spilledRegion->getRegOff (), SUBREG_ORIGIN, Direct, spilledRegVar, spilledRegion->getRegOff (), SUBREG_ORIGIN,
...@@ -1389,28 +1374,15 @@ SpillManagerGMRF::createMRFFillRangeDeclare ( ...@@ -1389,28 +1374,15 @@ SpillManagerGMRF::createMRFFillRangeDeclare (
unsigned short nRows = 0; unsigned short nRows = 0;
G4_SendMsgDescriptor* msgDesc = sendInst->getMsgDesc(); G4_SendMsgDescriptor* msgDesc = sendInst->getMsgDesc();
if( msgDesc ) if (sendInst->isSplitSend() &&
(sendInst->getSrc(1)->asSrcRegRegion() == filledRegion))
{ {
if (sendInst->isSplitSend() && nRows = msgDesc->extMessageLength();
(sendInst->getSrc(1)->asSrcRegRegion () == filledRegion))
{
nRows = msgDesc->extMessageLength();
}
else
{
nRows = msgDesc->MessageLength();
}
} }
else else
{ {
nRows = nRows = msgDesc->MessageLength();
filledRegVar->getDeclare ()->getNumRows () - }
filledRegion->getRegOff ();
if (nRows > getSendMaxMessageLength ()) {
nRows = (unsigned short) getSendMaxMessageLength ();
}
}
G4_SrcRegRegion * normalizedMRFSrc = G4_SrcRegRegion * normalizedMRFSrc =
builder_->createSrcRegRegion( builder_->createSrcRegRegion(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment