summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-ssa.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-10-10 15:59:45 -0700
committerGitHub <noreply@github.com>2022-10-10 15:59:45 -0700
commit768e62f6c7541439e2edc18dad5fb3846d2e05f9 (patch)
tree8c68424ee65905b77d3ecb4c7659c5fdcc6ab948 /source/slang/slang-ir-ssa.cpp
parent8487678d6504459935fec07886d2e53ed688ac2f (diff)
Support multi-level break + single-return conversion + general inline. (#2436)
* Support multi-level break. * Single return. * Add test for inlining `void` return-type functions. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-ssa.cpp')
-rw-r--r--source/slang/slang-ir-ssa.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang-ir-ssa.cpp b/source/slang/slang-ir-ssa.cpp
index 797fcb25c..a496db3a8 100644
--- a/source/slang/slang-ir-ssa.cpp
+++ b/source/slang/slang-ir-ssa.cpp
@@ -531,12 +531,13 @@ IRInst* addPhiOperands(
auto block = blockInfo->block;
List<IRInst*> operandValues;
+ auto predecessorCount = block->getPredecessors().getCount();
for (auto predBlock : block->getPredecessors())
{
// Precondition: if we have multiple predecessors, then
// each must have only one successor (no critical edges).
//
- SLANG_ASSERT(predBlock->getSuccessors().getCount() == 1);
+ SLANG_RELEASE_ASSERT(predecessorCount <= 1 || predBlock->getSuccessors().getCount() == 1);
auto predInfo = *context->blockInfos.TryGetValue(predBlock);