From ddebd60853b3f34bfd8e89de804fd15808abf75d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 9 May 2023 18:00:48 -0700 Subject: Various fixes for autodiff and slangpy. (#2876) * Various fixes for autodiff and slangpy. * Fix cuda code gen for `select`. * Fix getBuildTagString(). * Fix. --------- Co-authored-by: Yong He --- source/slang/slang-ir-util.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index ba34a725d..55c2b18c0 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -411,10 +411,6 @@ bool isPtrLikeOrHandleType(IRInst* type) return true; if (as(type)) return true; - if (as(type)) - return true; - if (as(type)) - return true; switch (type->getOp()) { case kIROp_ComPtrType: @@ -824,30 +820,30 @@ bool isGlobalOrUnknownMutableAddress(IRGlobalValueWithCode* parentFunc, IRInst* if (!isPtrLikeOrHandleType(type)) return false; + if (root) + { + if (as(root->getDataType())) + { + return false; + } + } + switch (root->getOp()) { case kIROp_GlobalVar: - return true; case kIROp_GlobalParam: case kIROp_GlobalConstant: case kIROp_Var: case kIROp_Param: break; + case kIROp_Call: + return true; default: - // The inst is defined by an unknown inst. return true; } - if (root) - { - if (as(root->getDataType())) - { - return false; - } - auto addrInstParent = getParentFunc(root); - return (addrInstParent != parentFunc); - } - return false; + auto addrInstParent = getParentFunc(root); + return (addrInstParent != parentFunc); } struct GenericChildrenMigrationContextImpl -- cgit v1.2.3