The type of the overload allowed i64 and refused casts. As a result, if
an i64 value was used, invalid code is produced leading to asserts or
validation errors.
Added support for folding when the params of asdouble are constants
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
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.
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.
* 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.
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.