Fix #6: Produce dxil container output when validation is disabled.#7
Fix #6: Produce dxil container output when validation is disabled.#7
Conversation
Make sure that we wrap the llvm bitcode module in a dxil container even when validation is disabled. Note that we still produce a raw bitcode module output when only a high- level compilation is requested by /fcgl.
|
Hi @dmpots, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
marcelolr
left a comment
There was a problem hiding this comment.
We're probably missing a test for the debug info case - we can add that when we do the update.
| void WrapModuleInDxilContainer(IMalloc *pMalloc, llvm::Module *llvmModule, AbstractMemoryStream *pModuleBitcode, CComPtr<IDxcBlob> &pDxilContainerBlob) { | ||
| CComPtr<AbstractMemoryStream> pContainerStream; | ||
| IFT(CreateMemoryStream(pMalloc, &pContainerStream)); | ||
| SerializeDxilContainerForModule(llvmModule, pModuleBitcode, pContainerStream); |
| HRESULT valHR = S_OK; | ||
| std::unique_ptr<llvm::Module> llvmModule = action.takeModule(); | ||
| if (!opts.CodeGenHighLevel) | ||
| WrapModuleInDxilContainer(pMalloc, llvmModule.get(), pOutputStream, pOutputBlob); |
There was a problem hiding this comment.
Serializing the module into a container will cause the original module to have its debug information stripped, so this will need to be updated to support the debug info module being used properly.
When the llvm module is serialized to a dxil container we strip the debug info. When using the internal validator we need to make a copy of the llvm module before serializing so that debug info is present for validation error messages. Added a test to check that validation error messages have valid debug info.
Integrate validation and dxc option updates
* Initial proposal for math modes The new HLSL math modes aims to provide an alternative to the `precise` attribute which will both be less bug prone and provide a higher degree of control for developers. * Add bullet about dependency on C++ attributes.
Make sure that we wrap the llvm bitcode module in a dxil container
even when validation is disabled.
Note that we still produce a raw bitcode module output when only a
high- level compilation is requested by /fcgl.