From 216dfba0af66210a46ef0df18beb73d975fdf727 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 19 Dec 2022 11:47:19 -0800 Subject: Separate primal computations from unzipped function into an explicit function. (#2569) Co-authored-by: Yong He --- source/slang/slang-ir-sccp.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (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 fbc00848b..c03eee695 100644 --- a/source/slang/slang-ir-sccp.cpp +++ b/source/slang/slang-ir-sccp.cpp @@ -1678,5 +1678,21 @@ bool applySparseConditionalConstantPropagation( return changed; } + +bool applySparseConditionalConstantPropagation(IRInst* func) +{ + SharedSCCPContext shared; + shared.module = func->getModule(); + shared.sharedBuilder.init(shared.module); + shared.sharedBuilder.deduplicateAndRebuildGlobalNumberingMap(); + + SCCPContext globalContext; + globalContext.shared = &shared; + globalContext.code = nullptr; + + // Run recursive SCCP passes on each child code block. + return applySparseConditionalConstantPropagationRec(globalContext, func); +} + } -- cgit v1.2.3