From 28758e0e427ceca196937dc90efe3ab1cb35bd70 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 17 Jul 2025 14:59:33 +0800 Subject: Perf improvements to IR serialization (#7751) * option to use riff as serialization backend * option to use riff as serialization backend * perf * shuffle code * perf improvements to deserialization * formatting * remove bit_cast * correct IR verification * neaten serialized format * fix peek module info * formatting * remove temporary profiling code * cleanup * fix wasm build * more explicit sizes * deserialize via fossil on 32 bit wasm * Make serialized modules Int size agnostic * reorder stable names to allow range based check for 64 bit constants * format * review comments * fix build * fix * c++17 compat slang-common.h --- source/slang/slang-serialize-container.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source/slang/slang-serialize-container.cpp') diff --git a/source/slang/slang-serialize-container.cpp b/source/slang/slang-serialize-container.cpp index 7325f6e42..535155c22 100644 --- a/source/slang/slang-serialize-container.cpp +++ b/source/slang/slang-serialize-container.cpp @@ -580,32 +580,11 @@ static void calcModuleInstructionList(IRModule* module, List& instsOut) instsOut.setCount(1); instsOut[0] = nullptr; - // Stack for parentInst - List parentInstStack; - IRModuleInst* moduleInst = module->getModuleInst(); - parentInstStack.add(moduleInst); - - // Add to list - instsOut.add(moduleInst); - - // Traverse all of the instructions - while (parentInstStack.getCount()) - { - // If it's in the stack it is assumed it is already in the inst map - IRInst* parentInst = parentInstStack.getLast(); - parentInstStack.removeLast(); - IRInstListBase childrenList = parentInst->getDecorationsAndChildren(); - for (IRInst* child : childrenList) - { - instsOut.add(child); - parentInstStack.add(child); - } - } + traverseInstsInSerializationOrder(moduleInst, [&](IRInst* inst) { instsOut.add(inst); }); } - /* static */ SlangResult SerialContainerUtil::verifyIRSerialize( IRModule* module, Session* session, -- cgit v1.2.3