diff options
| author | Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> | 2023-02-17 16:22:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-17 16:22:47 -0500 |
| commit | 79049bc7617be0d20f6ed5d9d1dfe75006aa675a (patch) | |
| tree | 882bf8c76e36ee770a8645f2b200bd90d22ec728 /source | |
| parent | f253d15a3b2681dfa40491451fcb3f21f1dbe412 (diff) | |
Cleaned up legacy differential type handling + type casting bugfixes (#2660)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-autodiff-fwd.cpp | 4 | ||||
| -rw-r--r-- | source/slang/slang-ir-autodiff.h | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-ssa.cpp | 5 |
3 files changed, 4 insertions, 7 deletions
diff --git a/source/slang/slang-ir-autodiff-fwd.cpp b/source/slang/slang-ir-autodiff-fwd.cpp index 214e97ff6..26d84720f 100644 --- a/source/slang/slang-ir-autodiff-fwd.cpp +++ b/source/slang/slang-ir-autodiff-fwd.cpp @@ -1363,8 +1363,6 @@ InstPair ForwardDiffTranscriber::transcribeInstImpl(IRBuilder* builder, IRInst* case kIROp_Neq: return transcribeBinaryLogic(builder, origInst); - case kIROp_CastIntToFloat: - case kIROp_CastFloatToInt: case kIROp_MakeVector: case kIROp_MakeMatrix: case kIROp_MakeMatrixFromScalar: @@ -1470,6 +1468,8 @@ InstPair ForwardDiffTranscriber::transcribeInstImpl(IRBuilder* builder, IRInst* case kIROp_PackAnyValue: case kIROp_UnpackAnyValue: case kIROp_GetNativePtr: + case kIROp_CastIntToFloat: + case kIROp_CastFloatToInt: // A call to createDynamicObject<T>(arbitraryData) cannot provide a diff value, // so we treat this inst as non differentiable. // We can extend the frontend and IR with a separate op-code that can provide an explicit diff value. diff --git a/source/slang/slang-ir-autodiff.h b/source/slang/slang-ir-autodiff.h index 38e4636ac..7bcd4c90b 100644 --- a/source/slang/slang-ir-autodiff.h +++ b/source/slang/slang-ir-autodiff.h @@ -173,8 +173,8 @@ struct DifferentiableTypeConformanceContext case kIROp_FloatType: case kIROp_HalfType: case kIROp_DoubleType: - case kIROp_VectorType: return origType; + case kIROp_ArrayType: { auto diffElementType = (IRType*)getDifferentialForType( diff --git a/source/slang/slang-ir-ssa.cpp b/source/slang/slang-ir-ssa.cpp index 20a8d7d13..d8246edae 100644 --- a/source/slang/slang-ir-ssa.cpp +++ b/source/slang/slang-ir-ssa.cpp @@ -1056,10 +1056,7 @@ bool constructSSA(ConstructSSAContext* context) // Figure out what variables we can promote to // SSA temporaries. - if (!(context->promotableVars.getCount() > 0)) - { - identifyPromotableVars(context); - } + identifyPromotableVars(context); // If none of the variables are promote-able, // then we can exit without making any changes |
