summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-dce.cpp
diff options
context:
space:
mode:
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