diff options
| author | Mukund Keshava <mkeshava@nvidia.com> | 2025-03-11 21:40:05 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-11 16:10:05 +0000 |
| commit | f59e0ef409844f2514435a8df8ceeff3663e5db3 (patch) | |
| tree | 7f8f7514ed140a49f03923d84a549fdbfdcbcc84 /source/slang/slang.cpp | |
| parent | ff55a569a0bff44a6f8abb105c07cbc2484bc007 (diff) | |
IR: Add SPIR-V disassembly for embedded downstream IR dumps (#6529)
* IR: Add SPIR-V disassembly for embedded downstream IR dumps
When dumping IR that contains embedded downstream SPIR-V code (via
EmbeddedDownstreamIR instructions), display the disassembled SPIR-V
instead of just showing "<binary blob>".
This CL also does:
- Adds a new interface for disassembly and get result.
- Modify export-library-generics.slang test test to check for the
disassembled SPIR-V
Fixes #6513
* Add module-dual-target-verify test
Fixes #6517
Adds a new test to verify that dxil and spirv targets are stored
separately in the precompiled blob.
* Fix review comments from cheneym2
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index e17d7ba9c..a23342458 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -3747,6 +3747,24 @@ SlangResult EndToEndCompileRequest::executeActionsInner() { SLANG_RETURN_ON_FAIL( translationUnit->getModule()->precompileForTarget(targetEnum, nullptr)); + + if (frontEndReq->optionSet.shouldDumpIR()) + { + DiagnosticSinkWriter writer(frontEndReq->getSink()); + + dumpIR( + translationUnit->getModule()->getIRModule(), + frontEndReq->m_irDumpOptions, + "PRECOMPILE_FOR_TARGET_COMPLETE_ALL", + frontEndReq->getSourceManager(), + &writer); + + dumpIR( + translationUnit->getModule()->getIRModule()->getModuleInst(), + frontEndReq->m_irDumpOptions, + frontEndReq->getSourceManager(), + &writer); + } } } } |
