[PATCH] D135793: [DX] Create globals for DXContainer parts

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 10:19:54 PDT 2022


beanz created this revision.
beanz added reviewers: tex3d, pow2clk, python3kgae, bogner.
Herald added a subscriber: hiraditya.
Herald added a project: All.
beanz requested review of this revision.
Herald added a project: LLVM.

DXContainer files have a handful of sections that need to be written.
This adds a pass to write the section data into IR globals, and writes
the shader flag data into a global.

The test cases here verify that the shader flags are correctly written
from the IR into the global and emitted to the DXContainer.

This change also fixes a bug in the MCDXContainerWriter, where the size
of the dxbc::ProgramHeader was not being included in the part offset
calcuations. This is verified to be working by the new testcases where
obj2yaml can properly dump part data for parts after the DXIL part.

Resolves issue #57742 (https://github.com/llvm/llvm-project/issues/57742)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135793

Files:
  llvm/lib/MC/MCDXContainerWriter.cpp
  llvm/lib/Target/DirectX/CMakeLists.txt
  llvm/lib/Target/DirectX/DXContainerGlobals.cpp
  llvm/lib/Target/DirectX/DXILShaderFlags.cpp
  llvm/lib/Target/DirectX/DXILShaderFlags.h
  llvm/lib/Target/DirectX/DirectX.h
  llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
  llvm/test/CodeGen/DirectX/ShaderFlags/double-extensions.ll
  llvm/test/CodeGen/DirectX/ShaderFlags/doubles.ll
  llvm/test/CodeGen/DirectX/embed-dxil.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135793.467187.patch
Type: text/x-patch
Size: 9020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221012/cac78dcf/attachment.bin>


More information about the llvm-commits mailing list