diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-28 11:12:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-28 11:12:40 -0700 |
| commit | e22b4dbb1bed1393fc028b87b8ff6ff30e1b73f3 (patch) | |
| tree | 5fa276d207921d07eb56cc3a990477777fa33898 /source/slang/slang-emit.cpp | |
| parent | 0a6926003fd2300858e3089fe82f421543852395 (diff) | |
Small fixes and cleanups on CUDA/CPP codegen. (#2746)
* Small fixes and cleanups on CUDA/CPP codegen.
* Disable `legalizeEmptyTypes` for now.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit.cpp')
| -rw-r--r-- | source/slang/slang-emit.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 6a0f46e0a..a18eed928 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -475,7 +475,6 @@ Result linkAndOptimizeIR( // We don't need the legalize pass for C/C++ based types if(options.shouldLegalizeExistentialAndResourceTypes ) -// if (!(sourceLanguage == SourceLanguage::CPP || sourceStyle == SourceLanguage::C)) { // The Slang language allows interfaces to be used like // ordinary types (including placing them in constant @@ -534,6 +533,20 @@ Result linkAndOptimizeIR( #endif validateIRModuleIfEnabled(codeGenContext, irModule); } + else + { +#if 0 + // On CPU/CUDA targets, we simply elminate any empty types. + // TODO: disable for now, since the CPU compute shader + // trampoline is still hard coded to assume there are + // entrypoint and global parameters. renable when + // we fix that logic. + legalizeEmptyTypes( + irModule, + sink); + eliminateDeadCode(irModule); +#endif + } // Once specialization and type legalization have been performed, // we should perform some of our basic optimization steps again, |
