summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-inline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-inline.cpp')
-rw-r--r--source/slang/slang-ir-inline.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-ir-inline.cpp b/source/slang/slang-ir-inline.cpp
index 0d5cb1c70..9b2b59cd9 100644
--- a/source/slang/slang-ir-inline.cpp
+++ b/source/slang/slang-ir-inline.cpp
@@ -277,6 +277,17 @@ struct InliningPassBase
if(!isDefinition(calleeFunc))
return false;
+ // We cannot inline a call inside an `IRExpand`.
+ // Because this will make the cfg inside the `IRExpand` too complex,
+ // and our expand specialization logic isn't general enough to deal
+ // with that yet.
+ for (auto parent = call->getParent(); parent; parent = parent->getParent())
+ {
+ if (as<IRExpand>(parent))
+ return false;
+ if (as<IRGlobalValueWithCode>(parent))
+ break;
+ }
return true;
}