diff options
Diffstat (limited to 'source/slang/emit.cpp')
| -rw-r--r-- | source/slang/emit.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index dd6feb50d..887a62974 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -3,7 +3,6 @@ #include "../core/slang-writer.h" #include "ir-dce.h" -#include "ir-existential.h" #include "ir-glsl-legalize.h" #include "ir-insts.h" #include "ir-link.h" @@ -6667,34 +6666,26 @@ String emitEntryPoint( #endif validateIRModuleIfEnabled(compileRequest, irModule); - - // Any code that makes use of existential (interface) types - // needs to be simplified to use concrete types instead, - // wherever this is possible. - // - // Note: we are applying this *before* doing specialization - // of generics because this pass could expose concrete - // types and/or witness tables that allow for further - // specialization. + // Next, we need to ensure that the code we emit for + // the target doesn't contain any operations that would + // be illegal on the target platform. For example, + // none of our target supports generics, or interfaces, + // so we need to specialize those away. // - // TODO: Simplification of existential-based and generics-based + // Simplification of existential-based and generics-based // code may each open up opportunities for the other, so - // in the long run these will need to be merged into a + // the relevant specialization transformations are handled in a // single pass that looks for all simplification opportunities. // - // TODO: We also need a legalization pass that will "expose" + // TODO: We also need to extend this pass so that it will "expose" // existential values that are nested inside of other types, // so that the simplifications can be applied. // - simplifyExistentialTypes(irModule); - - // Next, we need to ensure that the code we emit for - // the target doesn't contain any operations that would - // be illegal on the target platform. For example, - // none of our target supports generics, or interfaces, - // so we need to specialize those away. + // TODO: This pass is *also* likely to be the place where we + // perform specialization of functions based on parameter + // values that need to be compile-time constants. // - specializeGenerics(irModule); + specializeModule(irModule); // Debugging code for IR transformations... #if 0 |
