summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-autodiff.cpp
diff options
context:
space:
mode:
authorPankaj Mistry <63069047+pmistryNV@users.noreply.github.com>2024-01-24 13:55:19 -0800
committerGitHub <noreply@github.com>2024-01-24 13:55:19 -0800
commitdd57306d951dbcaf6471659fcd1d2c37738f36d0 (patch)
treece67cd68ce243028947c76e53db314929a1889f2 /source/slang/slang-ir-autodiff.cpp
parent70f6ae4e0427890bf5674e9cca307356125c5c10 (diff)
IRSPIRVAsmOperandInst instructions may not have IRBlock as the immediate parent. Previously special case was added to handle IRDecoration similarly. Replace this with a common method getBlock that traverses the parent chain till it gets to the Block (#3486)
Fixes bug #3432
Diffstat (limited to 'source/slang/slang-ir-autodiff.cpp')
-rw-r--r--source/slang/slang-ir-autodiff.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/source/slang/slang-ir-autodiff.cpp b/source/slang/slang-ir-autodiff.cpp
index 9acb6756e..2605dd028 100644
--- a/source/slang/slang-ir-autodiff.cpp
+++ b/source/slang/slang-ir-autodiff.cpp
@@ -2109,27 +2109,6 @@ bool finalizeAutoDiffPass(TargetRequest* target, IRModule* module)
return modified;
}
-IRBlock* getBlock(IRInst* inst)
-{
- if (!inst)
- return nullptr;
-
- if (auto block = as<IRBlock>(inst))
- return block;
-
- return getBlock(inst->getParent());
-}
-
-IRInst* getInstInBlock(IRInst* inst)
-{
- SLANG_RELEASE_ASSERT(inst);
-
- if (const auto block = as<IRBlock>(inst->getParent()))
- return inst;
-
- return getInstInBlock(inst->getParent());
-}
-
UIndex addPhiOutputArg(IRBuilder* builder, IRBlock* block, IRInst*& inoutTerminatorInst, IRInst* arg)
{
SLANG_RELEASE_ASSERT(as<IRUnconditionalBranch>(block->getTerminator()));