diff options
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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<IRSPIRVAsm>(inst)) + { + IRInst* next = nullptr; + for (auto i = asmBlock->getFirstChild(); i; i = next) + { + next = i->getNextInst(); + if (!as<IRSPIRVAsmInst>(i) && !as<IRSPIRVAsmOperand>(i)) + i->insertBefore(asmBlock); + } + } + } +} + UnownedStringSlice getBasicTypeNameHint(IRType* basicType) { switch (basicType->getOp()) |
