diff options
| author | Yong He <yonghe@outlook.com> | 2024-08-23 21:45:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-23 21:45:59 -0700 |
| commit | b2ca2d5a4efeae807d3c3f48f60235e47413b559 (patch) | |
| tree | 643d2bab5776e5f8f7cfa722975af9e826d77c9d /source/slang/slang-lower-to-ir.cpp | |
| parent | e4088cd602bd4d5a72fea67a787b1319acfc044d (diff) | |
Make variadic generics work with interfaces and forward autodiff. (#4905)
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 2828752a0..02c4fae68 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -11,6 +11,7 @@ #include "slang-check.h" #include "slang-ir-bit-field-accessors.h" #include "slang-ir-loop-inversion.h" +#include "slang-ir-lower-expand-type.h" #include "slang-ir.h" #include "slang-ir-util.h" #include "slang-ir-constexpr.h" @@ -1987,7 +1988,7 @@ struct ValLoweringVisitor : ValVisitor<ValLoweringVisitor, LoweredValInfo, Lower } else { - return lowerType(context, type->getTypePack()); + return context->irBuilder->getTupleType(lowerType(context, type->getTypePack())); } } @@ -11080,6 +11081,13 @@ RefPtr<IRModule> generateIRForTranslationUnit( // Synthesize some code we want to make sure is inlined and simplified synthesizeBitFieldAccessors(module); + // Lower `IRExpandType` types to use `IRExpand`, where the pattern type + // is nested inside the `IRExpand` as its children, instead of being same + // level entities as the ExpandType itself. + // This will unify the specialization logic for both type and value level + // expansion. + lowerExpandType(module); + // Generate DebugValue insts to store values into debug variables, // if debug symbols are enabled. if (context->includeDebugInfo) |
