diff options
| author | Yong He <yonghe@outlook.com> | 2023-10-25 12:21:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-25 12:21:35 -0700 |
| commit | e04abb54bc69d90a503852d60a89e8bac7b60ec8 (patch) | |
| tree | fdeedbda67c631cd8a8621921a1484c0ecf5ca6f /source | |
| parent | 017534601e86df53c0669be7dbc6c565d2108be6 (diff) | |
Fix single iteration loop detection logic. (#3287)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-simplify-cfg.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-ir-simplify-cfg.cpp b/source/slang/slang-ir-simplify-cfg.cpp index 0fe752c8f..127a515ce 100644 --- a/source/slang/slang-ir-simplify-cfg.cpp +++ b/source/slang/slang-ir-simplify-cfg.cpp @@ -97,8 +97,8 @@ static bool isTrivialSingleIterationLoop( { if (!context.domTree->dominates(loop->getParent(), branchTarget)) return false; - if (targetBlock != loop->getBreakBlock()) - return false; + if (branchTarget != loop->getBreakBlock()) + continue; if (findBreakableRegionHeaderInst(context.domTree, block) != loop) { // If the break is initiated from a nested region, this is not trivial. |
