History log of /llvm-project/llvm/lib/Target/DirectX/DirectXTargetMachine.cpp (Results 26 – 38 of 38)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 7059a6c3 18-Nov-2022 Alexander Shaposhnikov <ashaposhnikov@google.com>

[IR] Split out IR printing passes into IRPrinter

This diff splits out (from LLVMCore) IR printing passes into IRPrinter.
This structure is similar to what we already have for IRReader and
enables us

[IR] Split out IR printing passes into IRPrinter

This diff splits out (from LLVMCore) IR printing passes into IRPrinter.
This structure is similar to what we already have for IRReader and
enables us to avoid circular dependencies between LLVMCore and Analysis
(this is a preparation for https://reviews.llvm.org/D137768).
The legacy interface is left unchanged, once the legacy pass manager
is removed (in the future) we will be able to clean it up further.
The bazel build configuration has been updated as well.

Test plan:
1/ Tested the following cmake configurations: static/dynamic linking * lld/gold * clang/gcc
2/ bazel build --config=generic_clang @llvm-project//...

Differential revision: https://reviews.llvm.org/D138081

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4
# 6e05c8df 18-Oct-2022 Chris Bieneman <chris.bieneman@me.com>

[DX] Create globals for DXContainer parts

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

[DX] Create globals for DXContainer parts

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)

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D135793

show more ...


Revision tags: llvmorg-15.0.3
# e530a118 13-Oct-2022 Chris Bieneman <chris.bieneman@me.com>

[DX] Add pass to pretty-print DXIL metadata in asm

When DXC prints IR output it adds a bunch of IR comments in a header
that describe the DXIL metadata in a more human-readable format. This
pass wil

[DX] Add pass to pretty-print DXIL metadata in asm

When DXC prints IR output it adds a bunch of IR comments in a header
that describe the DXIL metadata in a more human-readable format. This
pass will serve that purpose for LLVM by printing out ahead of the IR
printer.

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D135802

show more ...


# 2b2afb25 11-Oct-2022 Chris Bieneman <chris.bieneman@me.com>

[DX] Add analysis and printer for shader flags

This adds infrastructural pieces for an analysis to compute the DXIL
shader flags. In this state the analysis can compute two fairly
straightforward fe

[DX] Add analysis and printer for shader flags

This adds infrastructural pieces for an analysis to compute the DXIL
shader flags. In this state the analysis can compute two fairly
straightforward feature flags for use of double-precision floating
point values and the DX 11.1 extended double support.

This patch does conflict with D135190, conflicts will be resolved prior
to merging.

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D135393

# Conflicts:
# llvm/lib/Target/DirectX/CMakeLists.txt
# llvm/lib/Target/DirectX/DirectXTargetMachine.cpp

show more ...


Revision tags: working
# 22018555 04-Oct-2022 Xiang Li <python3kgae@outlook.com>

[DirectX backend] Add analysis to collect DXILResources

Now only DXILTranslateMetadata uses DXILResources, so DXILResourceWrapper is only used by DXILTranslateMetadata.
Once we add lower for createH

[DirectX backend] Add analysis to collect DXILResources

Now only DXILTranslateMetadata uses DXILResources, so DXILResourceWrapper is only used by DXILTranslateMetadata.
Once we add lower for createHandle, DXILResourceWrapper will be used in more passes.
Also we can add resource index allocation in DXILResourceWrapper.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D135190

show more ...


Revision tags: llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2
# 20f7f9b7 31-Jul-2022 Xiang Li <python3kgae@outlook.com>

[NFC][DirectX backend] Fix crash when emit_obj for DirectX backend.

When emit-obj from clang directly, DirectX backend will hit assert caused by not initialize passes for AsmPrinter.
The fix will in

[NFC][DirectX backend] Fix crash when emit_obj for DirectX backend.

When emit-obj from clang directly, DirectX backend will hit assert caused by not initialize passes for AsmPrinter.
The fix will initialize the passes by calling createPassConfig.
Also ignore global variable which not has section in DXILAsmPrinter::emitGlobalVariable to avoid hit llvm_unreachable in DXILTargetObjectFile::SelectSectionForGlobal.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D130856

show more ...


Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5
# 2af61e62 06-Jun-2022 Chris Bieneman <chris.bieneman@me.com>

[DirectX] Add DirectX target object writer

This is the last piece to bring together writing DXContainer files
containing DXIL through the DirectX backend.

While this change only has one test, all o

[DirectX] Add DirectX target object writer

This is the last piece to bring together writing DXContainer files
containing DXIL through the DirectX backend.

While this change only has one test, all of the tests under
llvm/test/tools/dxil-dis also exercise this code. With this change the
output object file type for the dxil target is now DXContainer. Each of
the existing tests will generate DXContainer files, and the dxil-dis
tests additionally verify that the DXContainers generated are
well-formed and can be parsed by the DirectXShaderCompiler tools.

Depends on D127153 and D127165

Differential Revision: https://reviews.llvm.org/D127166

show more ...


Revision tags: llvmorg-14.0.4
# d401a993 10-May-2022 Chris Bieneman <chris.bieneman@me.com>

[DirectX] Embed DXIL in LLVM Module

At the end of the codegen pipeline for DXIL we will emit the DXIL into
a global variable in the Module annotated for the "DXIL" section.

This will be used by the

[DirectX] Embed DXIL in LLVM Module

At the end of the codegen pipeline for DXIL we will emit the DXIL into
a global variable in the Module annotated for the "DXIL" section.

This will be used by the MCDXContainerStreamer to emit the DXIL into a
DXContainer DXIL part.

Other parts of the DXContainer will be constructed similarly by
serializing their values into GlobalVariables.

This will allow DXIL to flow into DXContainers through the normal
MCStreamer flow used in the MC layer.

Depends on D122270

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D125334

show more ...


# 0c7f7f1b 07-May-2022 python3kgae <python3kgae@outlook.com>

[DirectX backend] Add pass to emit dxil metadata.

A new pass DxilEmitMetadata is added to translate information saved in llvm ir into metadata to match DXIL spec.

Only generate DXIL validator versi

[DirectX backend] Add pass to emit dxil metadata.

A new pass DxilEmitMetadata is added to translate information saved in llvm ir into metadata to match DXIL spec.

Only generate DXIL validator version in this PR.

In llvm ir, validator version is saved in ModuleFlag with "dx.valver" as Key.

!llvm.module.flags = !{!0, !1}
!1 = !{i32 6, !"dx.valver", !2}
!2 = !{i32 1, i32 1}

DXIL validator version has major and minor versions that are specified as named metadata:

!dx.valver = !{!2}
!2 = !{i32 1, i32 7}

Reviewed By: kuhar, beanz

Differential Revision: https://reviews.llvm.org/D125158

show more ...


# 85285be9 02-May-2022 Xiang Li <python3kgae@outlook.com>

[DirectX backend] Add pass to lower llvm intrinsic into dxil op function.

A new pass DXILOpLowering was added.
It will scan all llvm intrinsics, create dxil op function if it can map to dxil op func

[DirectX backend] Add pass to lower llvm intrinsic into dxil op function.

A new pass DXILOpLowering was added.
It will scan all llvm intrinsics, create dxil op function if it can map to dxil op function.
Then translate call instructions on the intrinsic into call on dxil op function.
dxil op function will add i32 argument to the begining of args for dxil opcode.
So cannot use setCalledFunction to update the call instruction on intrinsic.

This commit only support sin to start the work.

Reviewed By: kuhar, beanz

Differential Revision: https://reviews.llvm.org/D124805

show more ...


Revision tags: llvmorg-14.0.3, llvmorg-14.0.2
# f2526c1a 14-Apr-2022 Chris Bieneman <chris.bieneman@me.com>

Add DXIL Bitcode Writer and DXIL testing

This change is a big blob of code that isn't easy to break up. It
either comes in all together as a blob, works and has tests, or it
doesn't do anything.

Lo

Add DXIL Bitcode Writer and DXIL testing

This change is a big blob of code that isn't easy to break up. It
either comes in all together as a blob, works and has tests, or it
doesn't do anything.

Logically you can think of this patch as three things:
(1) Adding virtual interfaces so the bitcode writer can be overridden
(2) Adding a new bitcode writer implementation for DXIL
(3) Adding some (optional) crazy CMake goop to build the
DirectXShaderCompiler's llvm-dis as dxil-dis for testing

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D122082

show more ...


Revision tags: llvmorg-14.0.1
# 6599fdab 23-Mar-2022 Chris Bieneman <chris.bieneman@me.com>

Add DXILPrepare CodeGen pass

The DXIL Prepare pass handles the IR mutations required to convert
modern LLVM IR into something that more closely resembles LLVM-3.7 IR
so that the DXIL bitcode writer

Add DXILPrepare CodeGen pass

The DXIL Prepare pass handles the IR mutations required to convert
modern LLVM IR into something that more closely resembles LLVM-3.7 IR
so that the DXIL bitcode writer can emit 3.7 IR.

This change adds the codegen pass handling the first two IR
transformations:

* stripping new function attributes
* converting fneg into fsub

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D122081

show more ...


# 44a14a6a 28-Mar-2022 Chris Bieneman <chris.bieneman@me.com>

Add stub DirectX backend

This is the bare minimum needed to get the DirectX target compiling,
but does not actually do anything.

Reviewed By: pete, rnk, arsenm, jaebaek

Differential Revision: http

Add stub DirectX backend

This is the bare minimum needed to get the DirectX target compiling,
but does not actually do anything.

Reviewed By: pete, rnk, arsenm, jaebaek

Differential Revision: https://reviews.llvm.org/D122080

show more ...


12