diff options
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 83f6735bd..03b74b36a 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -681,6 +681,9 @@ bool isPureFunctionalCall(IRCall* call) // are not dependent on whatever we do in the call here. continue; default: + // Skip the call itself, since we are checking if the call has side effect. + if (use->getUser() == call) + continue; // We have some other unknown use of the variable address, they can // be loads, or calls using addresses derived from the variable, // we will treat the call as having side effect to be safe. @@ -721,6 +724,23 @@ IRInst* findWitnessTableEntry(IRWitnessTable* table, IRInst* key) return nullptr; } +void moveParams(IRBlock* dest, IRBlock* src) +{ + for (auto param = src->getFirstChild(); param;) + { + auto nextInst = param->getNextInst(); + if (as<IRDecoration>(param) || as<IRParam>(param)) + { + param->insertAtEnd(dest); + } + else + { + break; + } + param = nextInst; + } +} + struct GenericChildrenMigrationContextImpl { IRCloneEnv cloneEnv; |
