From ac886fd3e329a9599ed1ac7a6d8b26ca5821046c Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 4 Oct 2023 11:20:35 -0700 Subject: SPIRV compiler performance fixes. (#3258) * SPIRV compiler performance fixes. * Cleanup. * update project files * Cleanup debug code. * Make redundancy removal non-recursive. --------- Co-authored-by: Yong He --- source/slang/slang-ir-util.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 5ecbc8121..073b8bf96 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -1166,6 +1166,23 @@ UnownedStringSlice getBuiltinFuncName(IRInst* callee) return decor->getName(); } +void hoistInstOutOfASMBlocks(IRBlock* block) +{ + for (auto inst : block->getChildren()) + { + if (auto asmBlock = as(inst)) + { + IRInst* next = nullptr; + for (auto i = asmBlock->getFirstChild(); i; i = next) + { + next = i->getNextInst(); + if (!as(i) && !as(i)) + i->insertBefore(asmBlock); + } + } + } +} + UnownedStringSlice getBasicTypeNameHint(IRType* basicType) { switch (basicType->getOp()) -- cgit v1.2.3