Skip to content

Commit 9bcee81

Browse files
iwwuigcbot
authored andcommitted
Update emitLSCTypedWrite
Support SIMD1 model with waveShuffleIndex data types
1 parent f47f21f commit 9bcee81

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18522,6 +18522,23 @@ void EmitPass::emitLSCTypedWrite(llvm::Instruction *pInsn) {
1852218522
m_currShader->CopyVariable(pPayload, pSrc_W, 3 * numEltGRF);
1852318523
}
1852418524

18525+
WIAnalysis *WI = &getAnalysis<WIAnalysis>();
18526+
// If the dstBuf and coordinates are all uniform,
18527+
// check if all data elements have been replaced with WaveShuffleIndex
18528+
if (WI->isUniform(pllDstBuffer) && WI->isUniform(pllU) && WI->isUniform(pllV) && WI->isUniform(pllR)) {
18529+
GenIntrinsicInst *genX = dyn_cast<GenIntrinsicInst>(pllSrc_X);
18530+
GenIntrinsicInst *genY = dyn_cast<GenIntrinsicInst>(pllSrc_Y);
18531+
GenIntrinsicInst *genZ = dyn_cast<GenIntrinsicInst>(pllSrc_Z);
18532+
GenIntrinsicInst *genW = dyn_cast<GenIntrinsicInst>(pllSrc_W);
18533+
if (genX && genX->getIntrinsicID() == GenISAIntrinsic::GenISA_WaveShuffleIndex &&
18534+
genY && genY->getIntrinsicID() == GenISAIntrinsic::GenISA_WaveShuffleIndex &&
18535+
genZ && genZ->getIntrinsicID() == GenISAIntrinsic::GenISA_WaveShuffleIndex &&
18536+
genW && genW->getIntrinsicID() == GenISAIntrinsic::GenISA_WaveShuffleIndex) {
18537+
m_encoder->SetSimdSize(SIMDMode::SIMD1);
18538+
m_encoder->SetNoMask();
18539+
}
18540+
}
18541+
1852518542
m_encoder->SetPredicate(flag);
1852618543
m_encoder->LSC_TypedReadWrite(
1852718544
pGenInst->getIntrinsicID() == GenISAIntrinsic::GenISA_typedwriteMS ? LSC_STORE_QUAD_MSRT : LSC_STORE_QUAD,

0 commit comments

Comments
 (0)