From c787c4b82ba76f87069911f203eb192060b5264f Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 28 Aug 2023 21:24:49 -0700 Subject: 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 --- source/slang/slang-ir-sccp.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-sccp.cpp') 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(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; } - } } -- cgit v1.2.3