summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-sccp.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-28 21:24:49 -0700
committerGitHub <noreply@github.com>2023-08-28 21:24:49 -0700
commitc787c4b82ba76f87069911f203eb192060b5264f (patch)
tree2aa98326ce8d4c9f2011d79ee9f6d34db14716e7 /source/slang/slang-ir-sccp.cpp
parentaf363c02bf0fa2502c14f454965adff87170ff15 (diff)
Add `target_switch` and `intrinsic_asm` statement. (#3154)
* Add `target_switch` and `__intrinsic_asm` statement. * Cleanup. * WaveGetActiveMask, WaveGetActiveMask, WaveCountBits. * WaveIsFirstLane. * More wave intrinsics. * wave intrinsics. * merge fix. * Fix. * Fix. * Update test. * update test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-sccp.cpp')
-rw-r--r--source/slang/slang-ir-sccp.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-ir-sccp.cpp b/source/slang/slang-ir-sccp.cpp
index ce635dca8..5ae858256 100644
--- a/source/slang/slang-ir-sccp.cpp
+++ b/source/slang/slang-ir-sccp.cpp
@@ -1192,7 +1192,13 @@ struct SCCPContext
}
cfgWorkList.add(switchInst->getDefaultLabel());
}
-
+ else if (auto targetSwitch = as<IRTargetSwitch>(inst))
+ {
+ for (UInt cc = 0; cc < targetSwitch->getCaseCount(); ++cc)
+ {
+ cfgWorkList.add(targetSwitch->getCaseBlock(cc));
+ }
+ }
// There are other cases of terminator instructions not handled
// above (e.g., `return` instructions), but these can't cause
// additional basic blocks in the CFG to execute, so we don't
@@ -1555,7 +1561,6 @@ struct SCCPContext
terminator->removeAndDeallocate();
changed = true;
}
-
}
}