Skip to content

Commit 7a25cd4

Browse files
skachkov-inteligcbot
authored andcommitted
Fix setup of block size in svm.gather from
gather.private conversion
1 parent 5e5823c commit 7a25cd4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXThreadPrivateMemory.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -809,18 +809,18 @@ bool GenXThreadPrivateMemory::replaceScatterPrivate(CallInst *CI) {
809809
{Pred->getType(), EltsOffset->getType(),
810810
ValueOp->getType()});
811811

812-
unsigned logNumBlocks = genx::log2(EltSz);
813-
unsigned Scale = 0; // scale is always 0
812+
Value *logNumBlocks = ConstantInt::get(I32Ty, m_useGlobalMem ? 0 : genx::log2(EltSz));
813+
Value *Scale = ConstantInt::get(Type::getInt16Ty(*m_ctx), 0); // scale is always 0
814814
Value *Surface = ConstantInt::get(I32Ty,
815815
visa::getReservedSurfaceIndex(m_stack));
816816
CallInst *ScatterStScaled =
817817
m_useGlobalMem
818818
? IntrinsicInst::Create(
819819
F,
820-
{Pred, ConstantInt::get(I32Ty, logNumBlocks), EltsOffset, ValueOp})
820+
{Pred, logNumBlocks, EltsOffset, ValueOp})
821821
: IntrinsicInst::Create(
822-
F, {Pred, ConstantInt::get(I32Ty, logNumBlocks),
823-
ConstantInt::get(Type::getInt16Ty(*m_ctx), Scale), Surface,
822+
F, {Pred, logNumBlocks,
823+
Scale, Surface,
824824
Offset, EltsOffset, ValueOp});
825825
ScatterStScaled->insertAfter(CI);
826826
m_scatter.push_back(ScatterStScaled);

0 commit comments

Comments
 (0)