diff options
Diffstat (limited to 'source/slang/slang-ir-link.cpp')
| -rw-r--r-- | source/slang/slang-ir-link.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp index 5bb485b22..8b08b9045 100644 --- a/source/slang/slang-ir-link.cpp +++ b/source/slang/slang-ir-link.cpp @@ -1170,6 +1170,17 @@ IRFunc* cloneFuncImpl( return clonedFunc; } +// Can an inst with `opcode` contain basic blocks as children? +bool canInstContainBasicBlocks(IROp opcode) +{ + switch (opcode) + { + case kIROp_Expand: + return true; + default: + return false; + } +} IRInst* cloneInst( IRSpecContextBase* context, @@ -1238,7 +1249,10 @@ IRInst* cloneInst( argCount, newArgs.getArrayView().getBuffer()); builder->addInst(clonedInst); registerClonedValue(context, clonedInst, originalValues); - cloneDecorationsAndChildren(context, clonedInst, originalInst); + if (canInstContainBasicBlocks(clonedInst->getOp())) + cloneGlobalValueWithCodeCommon(context, (IRGlobalValueWithCode*)clonedInst, (IRGlobalValueWithCode*)originalInst, originalValues); + else + cloneDecorationsAndChildren(context, clonedInst, originalInst); cloneExtraDecorations(context, clonedInst, originalValues); return clonedInst; } |
