From 957a4d3eb0a14a9d57bbb325ef0e1d458df2d2b9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 Apr 2023 14:28:57 -0700 Subject: Refactor checkpointing policy and availability pass. (#2826) Co-authored-by: Yong He --- source/slang/slang-ir-dce.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'source/slang/slang-ir-dce.cpp') diff --git a/source/slang/slang-ir-dce.cpp b/source/slang/slang-ir-dce.cpp index 1fe88e780..364abe68c 100644 --- a/source/slang/slang-ir-dce.cpp +++ b/source/slang/slang-ir-dce.cpp @@ -327,29 +327,7 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o // if (inst->mightHaveSideEffects()) { - // If the inst has side effect, we should keep it alive. - // An exception is if we have a call to a pure function - // that writes its output to a local variable, but we - // don't have any uses of that local variable. - auto call = as(inst); - if (!call) - return true; - if (!getResolvedInstForDecorations(call->getCallee())->findDecoration()) - return true; - auto parentFunc = getParentFunc(inst); - if (!parentFunc) - return true; - for (UInt i = 0; i < call->getArgCount(); i++) - { - auto arg = call->getArg(i); - if (getParentFunc(arg) != parentFunc) - return true; - if (arg->getOp() != kIROp_Var) - return true; - if (arg->hasMoreThanOneUse()) - return true; - } - return false; + return true; } // // The `mightHaveSideEffects` query is conservative, and will -- cgit v1.2.3