From 5dd401e416e18fdfe904a66284b0cf56cf256ec7 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 31 May 2023 12:36:48 -0700 Subject: Fix div-by-zero error during sccp. (#2911) * Diagnose on div-by-zero during sccp. * fix --------- Co-authored-by: Yong He --- source/slang/slang-lower-to-ir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-lower-to-ir.cpp') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 486c152d5..b36f0dc94 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -9657,7 +9657,7 @@ RefPtr generateIRForTranslationUnit( // constructSSA(module); simplifyCFG(module); - applySparseConditionalConstantPropagation(module); + applySparseConditionalConstantPropagation(module, compileRequest->getSink()); // Next, inline calls to any functions that have been // marked for mandatory "early" inlining. @@ -9677,7 +9677,7 @@ RefPtr generateIRForTranslationUnit( // constructSSA(module); simplifyCFG(module); - applySparseConditionalConstantPropagation(module); + applySparseConditionalConstantPropagation(module, compileRequest->getSink()); // Propagate `constexpr`-ness through the dataflow graph (and the // call graph) based on constraints imposed by different instructions. -- cgit v1.2.3