@@ -5176,7 +5176,7 @@ void EmitPass::emitLegacySimdBlockRead(llvm::Instruction* inst, llvm::Value* ptr
5176
5176
m_encoder->SetUniformSIMDSize(simdmode);
5177
5177
if (useA64)
5178
5178
{
5179
- emitGatherA64(gatherDst, gatherOff, blkBits, nBlks);
5179
+ emitGatherA64(inst, gatherDst, gatherOff, blkBits, nBlks);
5180
5180
}
5181
5181
else
5182
5182
{
@@ -14422,7 +14422,7 @@ bool EmitPass::hasA64WAEnable() const
14422
14422
return m_currShader->m_Platform->WaEnableA64WA();
14423
14423
}
14424
14424
14425
- void EmitPass::emitGatherA64(CVariable* dst, CVariable* offset, unsigned elemSize, unsigned numElems)
14425
+ void EmitPass::emitGatherA64(Value* loadInst, CVariable* dst, CVariable* offset, unsigned elemSize, unsigned numElems)
14426
14426
{
14427
14427
if (hasA64WAEnable() && !offset->IsUniform()) {
14428
14428
CVariable* curMask = nullptr;
@@ -14431,6 +14431,11 @@ void EmitPass::emitGatherA64(CVariable* dst, CVariable* offset, unsigned elemSiz
14431
14431
A64LSLoopHead(offset, curMask, lsPred, label);
14432
14432
14433
14433
// do send with pred
14434
+ if (isa<LoadInst>(loadInst) && !m_currShader->IsCoalesced(loadInst))
14435
+ {
14436
+ // load inst is the single def of the vISA variable and therefore a kill
14437
+ m_encoder->Lifetime(LIFETIME_START, dst);
14438
+ }
14434
14439
m_encoder->SetPredicate(lsPred);
14435
14440
m_encoder->GatherA64(dst, offset, elemSize, numElems);
14436
14441
m_encoder->Push();
@@ -14442,7 +14447,7 @@ void EmitPass::emitGatherA64(CVariable* dst, CVariable* offset, unsigned elemSiz
14442
14447
}
14443
14448
}
14444
14449
14445
- void EmitPass::emitGather4A64(CVariable* dst, CVariable* offset)
14450
+ void EmitPass::emitGather4A64(Value* loadInst, CVariable* dst, CVariable* offset)
14446
14451
{
14447
14452
if (hasA64WAEnable() && !offset->IsUniform()) {
14448
14453
CVariable* curMask = nullptr;
@@ -14451,6 +14456,11 @@ void EmitPass::emitGather4A64(CVariable* dst, CVariable* offset)
14451
14456
A64LSLoopHead(offset, curMask, lsPred, label);
14452
14457
14453
14458
// do send with pred
14459
+ if (isa<LoadInst>(loadInst) && !m_currShader->IsCoalesced(loadInst))
14460
+ {
14461
+ // load inst is the single def of the vISA variable and therefore a kill
14462
+ m_encoder->Lifetime(LIFETIME_START, dst);
14463
+ }
14454
14464
m_encoder->SetPredicate(lsPred);
14455
14465
m_encoder->Gather4A64(dst, offset);
14456
14466
m_encoder->Push();
@@ -14581,7 +14591,7 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
14581
14591
}
14582
14592
else
14583
14593
{
14584
- emitGatherA64(gatherDst, eOffset, 8, totalBytes);
14594
+ emitGatherA64(inst, gatherDst, eOffset, 8, totalBytes);
14585
14595
}
14586
14596
14587
14597
m_encoder->Push();
@@ -14771,7 +14781,7 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
14771
14781
}
14772
14782
else
14773
14783
{
14774
- emitGatherA64(gatherDst, gatherOff, blkBits, nBlks);
14784
+ emitGatherA64(inst, gatherDst, gatherOff, blkBits, nBlks);
14775
14785
}
14776
14786
m_encoder->Push();
14777
14787
@@ -14849,10 +14859,10 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
14849
14859
m_encoder->Gather4Scaled(subLoadDst, resource, addrVarSIMD8);
14850
14860
break;
14851
14861
case VectorMessage::MESSAGE_A64_UNTYPED_SURFACE_RW:
14852
- emitGather4A64(subLoadDst, addrVarSIMD8);
14862
+ emitGather4A64(inst, subLoadDst, addrVarSIMD8);
14853
14863
break;
14854
14864
case VectorMessage::MESSAGE_A64_SCATTERED_RW:
14855
- emitGatherA64(subLoadDst, addrVarSIMD8, blkBits, numBlks);
14865
+ emitGatherA64(inst, subLoadDst, addrVarSIMD8, blkBits, numBlks);
14856
14866
break;
14857
14867
default:
14858
14868
assert(0 && "Somethings wrong!");
@@ -14924,10 +14934,10 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
14924
14934
m_encoder->Gather4Scaled(gatherDst, resource, rawAddrVar);
14925
14935
break;
14926
14936
case VectorMessage::MESSAGE_A64_UNTYPED_SURFACE_RW:
14927
- emitGather4A64(gatherDst, rawAddrVar);
14937
+ emitGather4A64(inst, gatherDst, rawAddrVar);
14928
14938
break;
14929
14939
case VectorMessage::MESSAGE_A64_SCATTERED_RW:
14930
- emitGatherA64(gatherDst, rawAddrVar, blkBits, numBlks);
14940
+ emitGatherA64(inst, gatherDst, rawAddrVar, blkBits, numBlks);
14931
14941
break;
14932
14942
default:
14933
14943
assert(false && "Internal Error: unexpected message kind for load!");
0 commit comments