The default generated RUN line generated by ExtractIRForPassTest.py adds
the desired pass to the options, but forgot to add the '-', so it would
fail with difficult to diagnose error in dxopt during argument parsing.
This adds the missing '-' so the RUN line doesn't have to be fixed in
this way every time the script is used.
A few syntax errors fixed along the way:
- hcttracei.py: `print` -> `print()`, `<>` -> `!=`
- hcttest-system-values.py: `os.path.join()` close paren before
arguments
The previous PR #5881 didn't do what it meant to and had a lot of debug
code due to a mistaken commit. This reverts that commit and restores the
setting of the build type flag
A slightly complex series of events causes invocations of hctbuild after
the first to enable asserts in release builds. This sets the build type
even when it isn't needed to avoid it.
Because the build type was not being set when generating for visual
studio in hctbuild, when generating the cmake files using CMakeLists, it
would produce an alarming message saying it was defaulting to debug,
but, in fact, since it didn't care for the purposes of sln file
generation, that wasn't actually a problem, just confusing. It did set a
variable to enable asserts, but didn't do this for release variant
builds
The real problem occurs if hctbuild is invoked again, at that point,
instead of defaulting to Debug, it leaves the build type empty because
of another variable set in the cache.
Additionally, since the first invocation enabled asserts, that also
comes from the cache and so code that strips NDEBUG from all build
variants is invoked because the build type is, in fact, not debug, it's
an empty string.
1. printf format mismatch.
2. avoid cast from CComPtr<IncludeHandlerVFSOverlayForTest> to
CComPtr<IDxcIncludeHandler>.
3. fix signed unsigned mismatch.
4. fix order of fields in constructor.
5. add override for override methods.
6. port
01f4209631
7. add copy assignment operator to avoid
-Wdeprecated-copy-with-user-provided-copy
8. disable -Wignored-qualifiers for taef header WexTestClass.h.
9. remove unused fields.
10. add -clang-cl for hctbuild.
Bumps cryptography from 41.0.3 to 41.0.4.
Sourced from cryptography's changelog:
41.0.4 - 2023-09-19
* Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.1.3.
fc11bce693
bump for 41.0.4
https://github.com/pyca/cryptography/pull/9629
See full diff in https://github.com/pyca/cryptography/compare/41.0.3...41.0.4
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This action and scripting was written by @tru for LLVM and addresses
some of the false positives we've been seeing in our action. There is
more room for improvement, but it would be better to unify than to have
divergent approaches since we're solving the same problem.
The code to structurize loop exits assumed exiting blocks always use
BranchInst and never SwitchInst. This caused a crash. This change makes
the structurizer preemptively check whether this assumption is true
before attempting.
The way taef tests were gathered and executed previously flattened the
list of arguments to a string. This allowed the weird /select: flag to
work correctly, but if any of the arguments had spaces, they were
misinterpretted having lost the implicit quotes around each.
By removing the flattening, putting a space between the flag and the
argument for /select: and removing the explicit quotes around that
argument, the command executes properly whether there are spaces or not
Additionally added a way to detect when these commands failed since they
were silently failing and skipping a large swath of testing when spaces
were present.
Fixes#5719
We don't keep these annotations up to date or rely on them, so to
simplify our platform layering and ease code formatting this change
removes all the SAL annotations from internal APIs. This change also
replaces most `_Analysis_Assme_(...)` annotations with `assert(...)`.
One `_Analysis_Assume_` in ParseDecl.cpp needed to be updated because it
was incorrect. The code was `_Analysis_Assume_(assert(name.size() >
sizeof("space"));`. When converted to an `assert` it fired in our test
suite because the sizeof a string literal includes the null terminator,
but the size of a StringRef does not.
A few of the `_Analysis_Assume_` annotations were removed because they
didn't make sense (like the ones inside the `DXASSERT` implementation,
and a few others were removed to avoid introducing additional header or
linkage dependencies.
This change does not introduce any functional or behavioral changes.
This PR aims to add some functionality to hctdb_instrhelp.py to
efficiently search and find specific instructions.
For example, in #5451, a parser needed to be written to parse through
gen_intrin_main.txt to search for any set of instructions that:
1. had at least one function attribute that was "readnone"
2. All had the same return type
3. All had the same argument list (types and length)
This search could've been made much easier if hctdb_instrhelp.py had a
method to search through instructions in a database-like manner.
This PR allows the user to define a query function with which to filter
out dxil instructions in hctdb.py. The instructions can be filtered out
based on function attributes, return type, function name, and the
function argument list. It should allow the user to quickly find
instructions that satisfy any arbitrary requirements.
On the command line, the user may run: `python3 hctdb_instrhelp.py
--query-dxil=<filename-no-extension>`
This command will instruct hctdb_instrhelp.py to run a query using the
inst_query_dxil function defined by the filename argument in the command
line. Alternatively, for hl operations, one can instead use the
--query-hlsl argument, and define a function called inst_query_hlsl in
that file instead.
And then the query functionality of the script will be run, which
applies the user-defined query function to all instructions and outputs
the query results.
Fixes#5556
Two related things:
-Move value/store annotations before instruction number annotations so
that we can avoid giving instruction numbers to the allocas that the
value-to-declare pass adds, since they are only there to implement PIX
shader debugging and do not need to be debugged by the PIX end-user.
And, otherwise, adding them messes up the instruction numbering for the
next part:
-Add parameters that allow PIX to limit instrumentation to a smaller
range of instruction numbers. This is a crude way to make
instrumentation workable for very large (>100k or so instructions)
shaders which otherwise will break the GPU driver either via out of
memory or via TDRs when the instrumentation is run.
This is for enable clang-cl build on windows.
The gtest fix is merging from
f66ab00704
to work around 'operator <<' is ambiguous on DefaultPrintNonContainerTo.
Improve output of DXC test runs:
- Add `-lit-verbose` option to `hctbuild` to setup lit test runs with
verbose output (`hcttest` will list test names as they run)
- Hide tests that are never supported (there was over 10K of unsupported
tests found by LIT discovery)
- Show warnings about non-essential tools only in LIT debug mode
- Skip over file copying and non-LIT part of `hcttest.cmd` if all
requested tests have already been run
- CMD tests have been move under clang's lit tests; keep the `hcttest
cmd` option for running cmd tests separately
Number of unsupported tests was reduced from 10452 to 1 if spir-v is
enabled, 39 if not. The number of tests that run did not change.
Add any_sampler builtin parameter type. This will match any sampler type
as the select() built-in added with HLSL 2021 requires.
Adds a new built-in overload that takes the any_sampler type and ensures
that the last two arguments and return type match. Many of the changes
were required because we never had to ensure object parameter types
matched nor transmit that type to the return type before. Most of the
changes to MatchArguments in SemaHLSL are addressing new issues this
revealed. Non-basic types can pass the conversion check if they outright
match.
Adds testing to select() and the ternary operator that it supplements
for these usages
Fixes#4673
Lit TAEF files fixes:
- Use filter parameter when enumerating tests. This enables listing of
just the tests that should run, and it also filtering by architecture.
This is crucial for isolating ARM64 and ARM64EC versions of tests that
are in the same test dll.
- Fix verbose parameter - it was not getting applied
- Enable verbose on all tests - the output is shown only when the test fails
Related to #5489.
This is for support adapter option for exec test when using lit.
no_priority is enabled for clang test too.
CMake behavior will be the same except not support adapter option.
Also hcttest cmd will only run cmd test for lit.
It is not easy to pass through the quoted /p options thru python. And
these options are mainly for local debug filter, not for taef FileCheck
tests. Just fall back to taef for these options and treat them like taef
helper.
This is help to allow lit FileCheck shell test.
This is prepare for allow both taef FileCheck and lit shell FileCheck
exist.
For tests under HLSLFileCheck directory, taef FileCheck will run. Else
py llvm-lit.py will run.
This is used set a path that lit will use to write out an xml file
containing the test results.
I had tried to reuse the existing `-dxc-cmake-extra-args` flag to set
the output, but I ran into a lot of problems getting the arg value to
parse correctly since it has embedded `=` signs that cmd treats as a
command line separator the same as a space (we need to pass a value like
`-DLLVM_LIT_ARGS=--xunit-xml-output=log.xml`). No combination of quotes
and backslashes could get the arg value passed through correctly, so I
opted for the direct route taken in this PR.
For `-Od`/`-O0` compilations, the compiler generates nop instructions in
the form of:
```
@dx.nothing.a = internal constant [1 x i32] zeroinitializer
...
%0 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
```
This instruction is intended to be a complete no-op, and backends that
recognizes this pattern can turn it into proper hardware specific no-op
instructions for debug purposes.
When linking DXIL libraries, the passes that run end up removing these
nops. This change adds a new pass `DxilReinsertNops` to run at the
beginning of linking to read the `LoadInst`s representing nops and turn
them back into calls of `dx.noop`, before turning back into loads again
at the end.
This PR adds a new PIX pass that instruments DXR 1.0 shaders
(intersection, any/closest hit and miss). The new pass emits each shader
invocation's [ray system
values](https://microsoft.github.io/DirectX-Specs/d3d/Raytracing.html#system-value-intrinsics)
and DispatchRaysIndex into a UAV that can be read back later. This will
enable new DXR debugging features in PIX.
* Prevent update_spirv_deps.sh from updating re2 and effcee.
As per discussion in
https://github.com/microsoft/DirectXShaderCompiler/pull/5246, the
repositories re2 and effcee should not be updated when rolling
submodules forward.
* Also ignore DirectX-Headers submodule updates.
* Fix comment to match code.
Replaced all the `if "%var%"==""` with `if [not] defined var`, which is
the proper way to determine whether the variable is defined or empty.
The other way breaks if statement parsing under various conditions.
This fixes handling of TAEF's /p:"var=val" parameter syntax as long as you
specify your additional TAEF parameters after a `--` argument break.
* Enable lit by default.
* Update README for git user bin.
* Add DXC_DISABLE_LIT to replace DXC_ENABLE_LIT
* Set -DDXC_DISABLE_LIT=Off for appveyor.
* Keep original name for ClangSPIRVTests
* Set correct path for unit tests binary.
* Remove doc about DXC_DISABLE_LIT
* Remove extra space.
* Remove DxcOnUnix.rst.
We effectively have reference parameter passing for intrinsics, but we
accomplish it by extremely careful interpretation of `out` and `inout`
in specific contexts.
This change separates the two in our intrinsic defintiions. Parameters
marked `ref` become lvalue reference types in the intrinsic function
declarations but do not get annotated with `AR_QUAL_OUT`. This allows
us to differentate them as true reference parameters.
For the atomic result intrinsics this allows us to clear up some hacks
because we needed them to not be `out` parameters but we needed them to
be passed by reference.
I've left a comment in SemaHLSL where we match arguement types about a
further cleanup we should do to correct reference binding errors, but
that is a larger task that we should do separately.
* [lit] Port Support %if ... %else syntax for RUN lines from upstream
Based on
1041a9642b
This syntax allows to modify RUN lines based on features
available. For example:
RUN: ... | FileCheck %s --check-prefix=%if windows %{CHECK-W%} %else %{CHECK-NON-W%}
CHECK-W: ...
CHECK-NON-W: ...
This is merged to allow dxilver check apply on each RUN line.
* [dxa] Add option to dump reflection
New option -dumpreflection is added to dump reflection data.
This is to support %D3DReflect test in lit.
* Move Reflection dump to DxilContainer.
This is for enable lit by default.
It fix issue when running single test instead of all test under lit.
%TEST_CLANG% will not get update until out of the if.
* [enable lit] Keep same name for ClangHLSLTests when enable lit
This is for enable lit by default.
It will make sure with/without lit enabled, ClangHLSLTests output dll with same name.
Use ClangHLSLTests because LIT needs GoogleTest binaries to be named that way for test discovery.
* Fix build error for deprecated function in UCRT.
This is for enable-lit by default.
gtest got link error for missing dup/dup2/close/creat.
* Update comment.
* Mark HLSL Change.
HLSL objects have a special hook for validating template arguments.
Previously, this didn't handle dependent arguments.
This change skips dependent arguments, which will be checked once they are concrete.
* [CMake] Update distribution build for DXC
Building off the LLVM 3.9 changes, this gets the `install-distribution`
target working for DXC with preset parameters that configure the
normal distribution. It also enables the DXC distribution to be built
through Visual Studio builds since DXC has a limited number of
components so it doesn't suffer from the IDE issues that upstream
LLVM & Clang do.
The `hctbuild` tooling has been updated to set a default install
prefix relative to the build directory, and allow overriding with a flag.
Cherry-picked commit details below:
From c90e12fe9fd7eb9fd7b342e7ac0cec971dd3e4db Mon Sep 17 00:00:00 2001
From: Chris Bieneman <beanz@apple.com>
Date: Tue, 23 Feb 2016 20:33:53 +0000
Subject: [PATCH] [CMake] Create an install-distribution target driven by LLVM_DISTRIBUTION_COMPONENTS
The idea here is to provide a customizable install target that only depends on building the things you actually want to install. It relies on each component being installed having an auto-generated install-${component}, which in turn depends only on the target being installed.
This is fundamentally a workaround for the fact that CMake generates build files which have their "install" target depend on the "all" target. This results in "ninja install" building a bunch of unneeded things.
llvm-svn: 261681
This script automates some operations to make it easier to write IR tests:
1. Gets the pass list for an HLSL compilation using -Odump
2. Compiles HLSL with -fcgl and outputs to intermediate IR
3. Collects list of passes before the desired pass and adds
-hlsl-passes-pause to write correct metadata
4. Invokes dxopt to run passes on -fcgl output and write bitcode result
5. Disassembles bitcode to .ll file for use as a test
6. Inserts RUN line with -hlsl-passes-resume and desired pass
In some cases, sinking instructions can significantly extend register lifetime. Added option -opt-disable sink in the same vein as -opt-disable "gvn" so shader authors can have some degree of control over this behaviour.