summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-inline.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-08-19 15:03:56 -0700
committerGitHub <noreply@github.com>2024-08-19 15:03:56 -0700
commit453683bf44f2112719802eaac2b332d49eebd640 (patch)
treed399db4c9cba90c11980186d3df1ffcc4d423b5a /source/slang/slang-ir-inline.cpp
parentecf85df6eee3da76ef54b14e4ab083f22da89e46 (diff)
Tuple swizzling, concat, comparison and `countof`. (#4856)
* Tuple swizzling and element access. * Update proposal status. * Cleanup. * Fix merrge error. * Address review.
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;
}