summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-dce.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-04-21 14:28:57 -0700
committerGitHub <noreply@github.com>2023-04-21 14:28:57 -0700
commit957a4d3eb0a14a9d57bbb325ef0e1d458df2d2b9 (patch)
treefabc9317b1595c9f74f5b25ee83d16f4260a19d3 /source/slang/slang-ir-dce.cpp
parent69a327a98e3f9504863f9ecb623aa93036ac43db (diff)
Refactor checkpointing policy and availability pass. (#2826)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-dce.cpp')
-rw-r--r--source/slang/slang-ir-dce.cpp24
1 files changed, 1 insertions, 23 deletions
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<IRCall>(inst);
- if (!call)
- return true;
- if (!getResolvedInstForDecorations(call->getCallee())->findDecoration<IRReadNoneDecoration>())
- 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