summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index dcca7d25e..e613f5462 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -15,6 +15,7 @@
#include "slang-ir-specialize.h"
#include "slang-ir-specialize-resources.h"
#include "slang-ir-ssa.h"
+#include "slang-ir-strip-witness-tables.h"
#include "slang-ir-union.h"
#include "slang-ir-validate.h"
#include "slang-ir-wrap-structured-buffers.h"
@@ -441,6 +442,16 @@ Result linkAndOptimizeIR(
break;
}
+ // For all targets that don't support true dynamic dispatch through
+ // witness tables (that is all targets at present), we need
+ // to eliminate witness tables from the IR so that they
+ // don't keep symbols live that we don't actually need.
+ stripWitnessTables(irModule);
+#if 0
+ dumpIRIfEnabled(compileRequest, irModule, "AFTER STRIP WITNESS TABLES");
+#endif
+ validateIRModuleIfEnabled(compileRequest, irModule);
+
// The resource-based specialization pass above
// may create specialized versions of functions, but
// it does not try to completely eliminate the original