Skip to content

Commit dd0200c

Browse files
bcheng0127sys_zuul
authored andcommitted
send message code clean
Change-Id: I5ba96a7e4c6257f4dbad6c72eb98fe015a09ace8
1 parent 1c716ab commit dd0200c

File tree

3 files changed

+29
-19
lines changed

3 files changed

+29
-19
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4904,6 +4904,17 @@ static uint32_t getBlockMsgSize(uint32_t bytesRemaining, bool do256Byte)
49044904

49054905

49064906
void EmitPass::emitSimdBlockWrite(llvm::Instruction* inst, llvm::Value* ptrVal)
4907+
{
4908+
emitLegacySimdBlockWrite(inst, ptrVal);
4909+
4910+
}
4911+
4912+
void EmitPass::emitSimdBlockRead(llvm::Instruction* inst, llvm::Value* ptrVal)
4913+
{
4914+
emitLegacySimdBlockRead(inst, ptrVal);
4915+
}
4916+
4917+
void EmitPass::emitLegacySimdBlockWrite(llvm::Instruction* inst, llvm::Value* ptrVal)
49074918
{
49084919
Value* llPtr = inst->getOperand(0);
49094920
Value* dataPtr = inst->getOperand(1);
@@ -5091,7 +5102,7 @@ void EmitPass::emitSimdBlockWrite(llvm::Instruction* inst, llvm::Value* ptrVal)
50915102
}
50925103
}
50935104

5094-
void EmitPass::emitSimdBlockRead(llvm::Instruction* inst, llvm::Value* ptrVal)
5105+
void EmitPass::emitLegacySimdBlockRead(llvm::Instruction* inst, llvm::Value* ptrVal)
50955106
{
50965107
Value* llPtr = inst->getOperand(0);
50975108
PointerType* ptrType = cast<PointerType>(llPtr->getType());
@@ -5278,6 +5289,7 @@ void EmitPass::emitSimdBlockRead(llvm::Instruction* inst, llvm::Value* ptrVal)
52785289
}
52795290
}
52805291

5292+
52815293
void EmitPass::emitMediaBlockIO(const llvm::GenIntrinsicInst* inst, bool isRead)
52825294
{
52835295
uint ImgArgIndex = (uint)GetImmediateVal(inst->getOperand(0));
@@ -14556,15 +14568,13 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
1455614568
m_encoder->SetUniformSIMDSize(SIMDMode::SIMD1);
1455714569
}
1455814570

14571+
if (useA32)
1455914572
{
14560-
if (useA32)
14561-
{
14562-
m_encoder->ByteGather(gatherDst, resource, eOffset, 8, totalBytes);
14563-
}
14564-
else
14565-
{
14566-
emitGatherA64(gatherDst, eOffset, 8, totalBytes);
14567-
}
14573+
m_encoder->ByteGather(gatherDst, resource, eOffset, 8, totalBytes);
14574+
}
14575+
else
14576+
{
14577+
emitGatherA64(gatherDst, eOffset, 8, totalBytes);
1456814578
}
1456914579

1457014580
m_encoder->Push();
@@ -15153,18 +15163,16 @@ void EmitPass::emitVectorStore(StoreInst* inst, Value* offset, ConstantInt* immO
1515315163
}
1515415164
setPredicateForDiscard();
1515515165

15166+
if (useA32)
1515615167
{
15157-
if (useA32)
15158-
{
15159-
{
15160-
m_encoder->ByteScatter(storedVar, resource, eOffset, blkBits, nBlks);
15161-
}
15162-
}
15163-
else
1516415168
{
15165-
emitScatterA64(storedVar, eOffset, blkBits, nBlks);
15169+
m_encoder->ByteScatter(storedVar, resource, eOffset, blkBits, nBlks);
1516615170
}
1516715171
}
15172+
else
15173+
{
15174+
emitScatterA64(storedVar, eOffset, blkBits, nBlks);
15175+
}
1516815176

1516915177
if (dstUniform)
1517015178
{
@@ -15179,7 +15187,6 @@ void EmitPass::emitVectorStore(StoreInst* inst, Value* offset, ConstantInt* immO
1517915187
storedVar = BroadcastIfUniform(storedVar);
1518015188

1518115189
VectorMessage VecMessInfo(this);
15182-
1518315190
VecMessInfo.getInfo(Ty, align, useA32);
1518415191

1518515192
for (uint32_t i = 0; i < VecMessInfo.numInsts; ++i)
@@ -15241,6 +15248,7 @@ void EmitPass::emitVectorStore(StoreInst* inst, Value* offset, ConstantInt* immO
1524115248
}
1524215249
}
1524315250

15251+
1524415252
void EmitPass::emitVectorCopy(CVariable* Dst, CVariable* Src, uint32_t nElts,
1524515253
uint32_t DstSubRegOffset, uint32_t SrcSubRegOffset)
1524615254
{

IGC/Compiler/CISACodeGen/EmitVISAPass.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ namespace IGC
211211
void emitSimdShuffleDown(llvm::Instruction* inst);
212212
void emitSimdBlockRead(llvm::Instruction* inst, llvm::Value* ptrVal = nullptr);
213213
void emitSimdBlockWrite(llvm::Instruction* inst, llvm::Value* ptrVal = nullptr);
214+
void emitLegacySimdBlockWrite(llvm::Instruction* inst, llvm::Value* ptrVal = nullptr);
215+
void emitLegacySimdBlockRead(llvm::Instruction* inst, llvm::Value* ptrVal = nullptr);
214216
void emitSimdMediaBlockRead(llvm::Instruction* inst);
215217
void emitSimdMediaBlockWrite(llvm::Instruction* inst);
216218
void emitMediaBlockIO(const llvm::GenIntrinsicInst* inst, bool isRead);

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ namespace IGC
21952195
{
21962196
if (isa<LoadInst>(inst))
21972197
{
2198-
pass->emitVectorLoad(cast<LoadInst>(inst), offset, immOffset);
2198+
pass->emitLoad(cast<LoadInst>(inst), offset, immOffset);
21992199
}
22002200
else if (isa<StoreInst>(inst))
22012201
{

0 commit comments

Comments
 (0)