diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-08-17 09:46:19 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-08-17 11:22:22 -0700 |
| commit | 5de3003af561bad33680940ab1809622c428e94b (patch) | |
| tree | ceb6f8b5f4d3c7e941f4edd47984b426d03fb980 /source/slang/emit.cpp | |
| parent | 5230ad2edb28e176d0d7d2a9873ffb8f65285269 (diff) | |
IR generation cleanup work
- Make all instructions store their argument count for now, so we can iterate over them easily.
- Longer term we might try to optimize for space because the common case is that the operand count is known, but keeping it simpler seems better for now
- Split apart the creation of an instruction from adding it to a parent
- Use the above capability to make sure that we add a function to its parent *after* all the parameter/result type emission has occured.
- Perform simple value numbering for types during IR creation
- This logic also tries to pick a good parent for any type instructions, so that types don't get created local to a function unless they really need to
- Create all constants at global scope, and re-use when values are identical
Diffstat (limited to 'source/slang/emit.cpp')
| -rw-r--r-- | source/slang/emit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index c8f3f06cb..d9b2ffcd6 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -3951,11 +3951,11 @@ String emitEntryPoint( throw 99; } - else if(translationUnit->compileRequest->loadedModulesList.Count() != 0) + else if( #else - if(!(translationUnit->compileFlags & SLANG_COMPILE_FLAG_NO_CHECKING ) - || translationUnit->compileRequest->loadedModulesList.Count() != 0) + if(!(translationUnit->compileFlags & SLANG_COMPILE_FLAG_NO_CHECKING ) || #endif + translationUnit->compileRequest->loadedModulesList.Count() != 0) { // The user has `import`ed some Slang modules, and so we are in case (2) // |
