Граф коммитов

18 Коммитов

Автор SHA1 Сообщение Дата
Tex Riddell fbe1371aae
Fix Validation for RDAT and other issues with Subobjects (#1706)
- re-serialize module when changed by removing either subobjects or
  root signature metadata
- improve error detection/handling for loading/creating subobjects
- load subobjects from RDAT if not in DxilModule for RDAT comparison
- fix subobjects missing from desc in DxilRuntimeReflection
- default ReducibilityAnalysis to pass so it doesn't fail when no
  functions are present
- report error on subobject if validator (< 1.4) will not accept
  them, so they will not be captured
- container validation for required/disallowed parts for libraries
2018-11-13 14:49:32 -08:00
Tex Riddell 254b8853be
Fix dependency on HL/DxilModule from llvm::Module (#1651)
- use function pointers for HL/DxilModule remove function callbacks
- move ReducibilityAnalysis to llvm/Analysis
2018-10-31 19:18:28 -07:00
Xiang Li 4df08af7c0
Move DxilModule into DXIL directory. (#1599)
* Move DxilModule into DXIL directory.
2018-10-16 00:28:35 -07:00
Greg Roth 4aa0ac6c50 [linux-port] Fix GCC build on alpine Linux (and others) (#1378)
Alpine Linux and probably several others, define fopen64, fseeko64,
ftello64, and tmpfile64 to their 32 bit equivalents in system
headers. This results in duplicates in areas of the code that
include 32 bit and 64 bit references to this. Since HLSL doesn't
have any of these functions anyway, we can safely exclude them.
2018-06-26 15:15:32 -04:00
Greg Roth b9f2c78314 [linux-port] Evade unused in LLVM code (#1327)
Primarily if not exclusively due to the massive carveouts of the
original LLVM source base as part of the HLSL adaptation, many
variables and functions are left unused. In keeping with the
practice of commenting or ifdef-ing out unused portions of this
code and marking every such exclusion as an HLSL change, this adds
few comments and moves a lot of preprocessor conditionals around to
encompass the portions left unused as a consequence of the earlier
exclusions.
Fixes 450 clang and 442 gcc warnings.
2018-06-05 14:07:51 -04:00
Greg Roth d27307905c Make correct/consistent include capitalization (#1269)
Several #included files were capitalized incorrectly in the case of
files pertaining to the project, or inconsistently in the case of
Windows headers which are typically only relevant where capitalization
doesn't matter. In spite of that, consistent capitalization can be
useful for cross platform stubbing purposes.

This corrects capitalization of a few Dxil* headers and forces
capitalization of Windows-specific headers to be consistent with
the overwhelming majority of other cases.

No functional change, just cross-platform facilitation
2018-05-10 10:47:52 -07:00
Xiang Li a489c2ec25
Transform mad(a, 0, b) into b. (#1150) 2018-03-19 18:04:56 -07:00
Tex Riddell bbe8831fe1 fix dot-cfg so it doesn't act like dot-cfg-only (#556) 2017-08-15 12:13:24 -07:00
Xiang Li e5c0e5ffaa Merge DivergenceAnalysis from llvm3.8. (#528) 2017-08-07 12:14:46 -07:00
Marcelo Lopez Ruiz d5bb3089cf Add support for custom allocators (#390)
Supporting a custom allocator for dxcompiler.
Adds recovery for exceptions and out-of-memory handling.
Add custom allocator support to linker.
Fix for release-only test failure.
Removes assertion about presence of command-line option registration
2017-07-06 16:45:48 -07:00
David Peixotto 022eb5717f Add hooks for constant folding extensions (#209)
This commit adds placeholder hooks to support constant folding of
extensions.  They are defined in a separate file to make it easy to merge
changes or link in other versions. There should be no upstream changes to
these definitions.
2017-04-13 15:04:14 -07:00
Lei Zhang 892e7953fd Match filename cases (#199) 2017-04-10 22:52:10 -07:00
David Peixotto b0fd2d3949 Use opcode class to guide constant folding possibilities (#191)
This change modifies dxil constant folding to use the opcode class when
deciding if a dxil function can be constant folded. We now require a
DxilModule to be available when constant folding dxil functions.

To ensure that the dxil module is available we add a new pass that loads a
dxil module from metadata if it does not exist. We use the new pass in the
dxopt tests for constant folding.
2017-04-06 17:42:42 -07:00
David Peixotto deec58372a Ensure the cached Function->OpCodeClass map is updated (#186)
* Ensure the cached Function->OpCodeClass map is updated

The original goal of this change was to use opcode class for deciding when we
can perform constant folding on a function.

We maintain a mapping from Function* to OpCodeClass inside the OP class.
We wanted to use this map in constant folding to decide if we can constant
fold a function to avoid string comparison on the function names.

However, it turns out that the DxilModule is not always available during
constant folding of dxil calls so we cannot use the map inside of OP. The
change contains a few bug fixes and improvements that came out of trying
to get opcode class working inside constant folding.

  1. Use opcode class in dxil constant folding where possible.
  2. Make sure the opcode cache is refreshed properly.
  3. Remove 64-bit test for bfi.
  4. Add equality comparison for the ShaderModel class.

When switching to use the opcode class for constant folding, we discovered
that our test for 64-bit bfi is invalid. There is no 64-bit overload for
bfi in dxil, so the test we had written was not legal dxil. This change
removes the 64-bit test for bfi constant prop.
2017-04-06 13:48:27 -07:00
David Peixotto ae69cf0a58 Add constant folding for dxil intrinsics (#179)
This commit adds the ability to constant fold dxil intrinsics when
all inputs are constant. We reuse the llvm constant folding
infrastructure and add special cases for calls to dxil intrinsics.
2017-04-04 09:15:19 -07:00
Marcelo Lopez Ruiz 057c354b8b Add support to dndxc for debug line lookup, restore CFG printer passes. (#130) 2017-03-13 20:53:13 -07:00
David Peixotto f805233b49 Revert license text in banner comments to original llvm verbage (#33)
Fix #30: Revert license text in banner comments to original llvm verbage

This commit removes the Microsoft-specific copyright in llvm files
and reverts the copyright wording to the original llvm wording.

We used the following method to find the files to change:
1. Find all files in DirectXShaderCompiler that are also in llvm 3.7
2. For those files that have the Microsoft-specific copyright, revert
   it to the original llvm copyright as present in llvm 3.7
3. Revert the copyright in a few files that are not in llvm, but are
   mostly copies of files in llvm:
	lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp
	lib\Transforms\Scalar\Reg2MemHLSL.cpp

Leave the Microsoft-specific copyright header in files not present
in stock llvm:

    include\dxc\*
    lib\HLSL\*
    lib\DxcSupport\*
    tools\clang\test\HLSL\*
    tools\clang\test\CodeGenHLSL\*
    tools\clang\unittests\HLSL\*
    tools\clang\unittests\HLSLHost\*
    tools\clang\tools\dxcompiler\*
    tools\clang\tools\dxa\*
    tools\clang\tools\dxc\*
    tools\clang\tools\dxopt\*
    tools\clang\tools\dxr\*
    tools\clang\tools\dxv\*
    tools\clang\tools\dotnetc\*
    utils\hct\*
    CONTRIBUTING.md
    COPYRIGHT
    LICENSE-MIT
    README.md
    cmake\modules\FindD3D12.cmake
    cmake\modules\FindDiaSDK.cmake
    cmake\modules\FindTAEF.cmake
    docs\DXIL.rst
    docs\HLSLChanges.rst
    docs\_themes\dxc-theme\layout.html
    docs\_themes\dxc-theme\theme.conf
    docs\_themes\dxc-theme\static\dxc-theme.css
    include\llvm\llvm_assert\assert.h
    include\llvm\llvm_assert\cassert
    include\llvm\Support\MSFileSystem.h
    include\llvm\Support\OacrIgnoreCond.h
    lib\MSSupport\CMakeLists.txt
    lib\MSSupport\MSFileSystemImpl.cpp
    lib\Support\assert.cpp
    lib\Support\MSFileSystemBasic.cpp
    lib\Support\Windows\MSFileSystem.inc.cpp
    lib\Transforms\Scalar\Reg2MemHLSL.cpp
    lib\Transforms\Scalar\ScalarReplAggregatesHLSL.cpp
    tools\clang\docs\UsingDxc.rst
    tools\clang\include\clang\AST\HlslTypes.h
    tools\clang\include\clang\Basic\BuiltinsDXIL.def
    tools\clang\include\clang\Basic\LangOptions.fixed.def
    tools\clang\include\clang\Parse\ParseHLSL.h
    tools\clang\include\clang\Sema\SemaHLSL.h
    tools\clang\lib\AST\ASTContextHLSL.cpp
    tools\clang\lib\AST\HlslTypes.cpp
    tools\clang\lib\CodeGen\CGHLSLMS.cpp
    tools\clang\lib\CodeGen\CGHLSLRuntime.cpp
    tools\clang\lib\CodeGen\CGHLSLRuntime.h
    tools\clang\lib\Frontend\Rewrite\FrontendActions_rewrite.cpp
    tools\clang\lib\Parse\HLSLRootSignature.cpp
    tools\clang\lib\Parse\HLSLRootSignature.h
    tools\clang\lib\Parse\ParseHLSL.cpp
    tools\clang\lib\Sema\gen_intrin_main_tables_15.h
    tools\clang\lib\Sema\SemaHLSL.cpp
    tools\clang\tools\d3dcomp\CMakeLists.txt
    tools\clang\tools\d3dcomp\d3dcomp.cpp
    tools\clang\tools\d3dcomp\d3dcomp.def
    tools\clang\tools\libclang\dxcisenseimpl.cpp
    tools\clang\tools\libclang\dxcisenseimpl.h
    tools\clang\tools\libclang\dxcrewriteunused.cpp
    tools\clang\tools\libclang\libclang.rc
    tools\dxexp\CMakeLists.txt
    tools\dxexp\dxexp.cpp
    tools\dxexp\LLVMBuild.txt
2017-01-24 17:54:00 -08:00
Marcelo Lopez Ruiz 6ee4074a4b first commit 2016-12-28 11:52:27 -08:00