Skip to content

Commit 3bcf4d9

Browse files
committed
Reload list info after procedure/suspend
1 parent c73ead2 commit 3bcf4d9

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/engine/internal/llvm/instructions/procedures.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ LLVMInstruction *Procedures::buildCallProcedure(LLVMInstruction *ins)
8181
}
8282

8383
m_utils.reloadVariables(m_utils.targetVariables());
84+
m_utils.reloadLists();
8485
return ins->next;
8586
}
8687

src/engine/internal/llvm/llvmbuildutils.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ void LLVMBuildUtils::reloadVariables(llvm::Value *targetVariables)
329329
}
330330
}
331331

332+
void LLVMBuildUtils::reloadLists()
333+
{
334+
// Load list size info
335+
if (m_warp) {
336+
for (auto &[list, listPtr] : m_listPtrs) {
337+
llvm::Value *size = m_builder.CreateLoad(m_builder.getInt64Ty(), listPtr.sizePtr);
338+
m_builder.CreateStore(size, listPtr.size);
339+
}
340+
}
341+
}
342+
332343
void LLVMBuildUtils::pushScopeLevel()
333344
{
334345
m_stringHeap.push_back({});
@@ -1256,6 +1267,7 @@ void LLVMBuildUtils::createSuspend()
12561267
syncVariables(m_targetVariables);
12571268
m_coroutine->createSuspend();
12581269
reloadVariables(m_targetVariables);
1270+
reloadLists();
12591271

12601272
if (m_warpArg) {
12611273
m_builder.CreateBr(nextBranch);

src/engine/internal/llvm/llvmbuildutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class LLVMBuildUtils
6363

6464
void syncVariables(llvm::Value *targetVariables);
6565
void reloadVariables(llvm::Value *targetVariables);
66+
void reloadLists();
6667

6768
void pushScopeLevel();
6869
void popScopeLevel();

0 commit comments

Comments
 (0)