summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2019-01-28 14:21:21 -0800
committerGitHub <noreply@github.com>2019-01-28 14:21:21 -0800
commitadb3e222393a780de41f258bd273fa3231db10c0 (patch)
tree1d39bbf22e31dbc0e1d3861258dbcbbeb0dc3bc6 /source/slang/emit.cpp
parent3b9573af2c1c898eb8c5b98b6d29cd3889579a51 (diff)
parent3c3513ab501277333d1062ad2737ac4a60dac6f7 (diff)
Merge branch 'master' into yong-fix2
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp33
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