Skip to content

Commit 6105eaf

Browse files
jaladreipsigcbot
authored andcommitted
Fix RTStack2 size used for memcpy in cross block load vectorization path
Fix RTStack2 size used for memcpy in cross block load vectorization path
1 parent 8653a04 commit 6105eaf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

IGC/AdaptorCommon/RayTracing/NewTraceRayInlineLoweringPass.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,15 @@ class InlineRaytracing : public AllocationLivenessAnalyzer {
160160
auto key = std::make_pair(IRB.GetInsertBlock(), rqObject);
161161
if (m_CrossBlockVectorizationStacks.find(key) == m_CrossBlockVectorizationStacks.end()) {
162162

163+
auto &DL = m_pCGCtx->getModule()->getDataLayout();
163164
llvm::RTBuilder::InsertPointGuard g(IRB);
165+
164166
IRB.SetInsertPoint(key.first->getParent()->getEntryBlock().getFirstNonPHI());
165167
auto *SMStack =
166168
IRB.CreateAlloca(IRB.getRTStack2Ty(), nullptr,
167169
VALUE_NAME("CrossBlockLoadSMStackForBlock"));
168170
IRB.SetInsertPoint(key.first->getFirstNonPHI());
169-
IRB.CreateMemCpy(SMStack, getStackPtr(IRB, rqObject), IRB.getSyncRTStackSize(),
171+
IRB.CreateMemCpy(SMStack, getStackPtr(IRB, rqObject), IRB.getInt64(DL.getTypeAllocSize(IRB.getRTStack2Ty())),
170172
RayDispatchGlobalData::StackChunkSize);
171173
m_CrossBlockVectorizationStacks[key] = SMStack;
172174
}

0 commit comments

Comments
 (0)