Skip to content

Commit de3d1de

Browse files
lukaszgotszaldintelgfxbot
authored andcommitted
Khronos commit 0f4c772.
KhronosGroup/SPIRV-Tools@0f4c772 Change-Id: I694186e7231385ac0e39ac907a4da70e478e15d5
1 parent dd4da9a commit de3d1de

File tree

152 files changed

+10510
-10786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+10510
-10786
lines changed

IGC/AdaptorOCL/SPIRV/SPIRV-Tools/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
Language: Cpp
33
BasedOnStyle: Google
44
DerivePointerAlignment: false
5+
SortIncludes: true
56
...

IGC/AdaptorOCL/SPIRV/SPIRV-Tools/Android.mk

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ SPVTOOLS_SRC_FILES := \
1919
source/print.cpp \
2020
source/software_version.cpp \
2121
source/spirv_endian.cpp \
22+
source/spirv_optimizer_options.cpp \
2223
source/spirv_target_env.cpp \
2324
source/spirv_validator_options.cpp \
2425
source/table.cpp \
2526
source/text.cpp \
2627
source/text_handler.cpp \
27-
source/util/bit_stream.cpp \
2828
source/util/bit_vector.cpp \
2929
source/util/parse_number.cpp \
3030
source/util/string_utils.cpp \
@@ -34,30 +34,38 @@ SPVTOOLS_SRC_FILES := \
3434
source/val/function.cpp \
3535
source/val/instruction.cpp \
3636
source/val/validation_state.cpp \
37-
source/validate.cpp \
38-
source/validate_adjacency.cpp \
39-
source/validate_arithmetics.cpp \
40-
source/validate_atomics.cpp \
41-
source/validate_barriers.cpp \
42-
source/validate_bitwise.cpp \
43-
source/validate_builtins.cpp \
44-
source/validate_capability.cpp \
45-
source/validate_cfg.cpp \
46-
source/validate_composites.cpp \
47-
source/validate_conversion.cpp \
48-
source/validate_datarules.cpp \
49-
source/validate_decorations.cpp \
50-
source/validate_derivatives.cpp \
51-
source/validate_ext_inst.cpp \
52-
source/validate_id.cpp \
53-
source/validate_image.cpp \
54-
source/validate_instruction.cpp \
55-
source/validate_layout.cpp \
56-
source/validate_literals.cpp \
57-
source/validate_logicals.cpp \
58-
source/validate_non_uniform.cpp \
59-
source/validate_primitives.cpp \
60-
source/validate_type_unique.cpp
37+
source/val/validate.cpp \
38+
source/val/validate_adjacency.cpp \
39+
source/val/validate_annotation.cpp \
40+
source/val/validate_arithmetics.cpp \
41+
source/val/validate_atomics.cpp \
42+
source/val/validate_barriers.cpp \
43+
source/val/validate_bitwise.cpp \
44+
source/val/validate_builtins.cpp \
45+
source/val/validate_capability.cpp \
46+
source/val/validate_cfg.cpp \
47+
source/val/validate_composites.cpp \
48+
source/val/validate_constants.cpp \
49+
source/val/validate_conversion.cpp \
50+
source/val/validate_datarules.cpp \
51+
source/val/validate_debug.cpp \
52+
source/val/validate_decorations.cpp \
53+
source/val/validate_derivatives.cpp \
54+
source/val/validate_ext_inst.cpp \
55+
source/val/validate_execution_limitations.cpp \
56+
source/val/validate_function.cpp \
57+
source/val/validate_id.cpp \
58+
source/val/validate_image.cpp \
59+
source/val/validate_interfaces.cpp \
60+
source/val/validate_instruction.cpp \
61+
source/val/validate_memory.cpp \
62+
source/val/validate_mode_setting.cpp \
63+
source/val/validate_layout.cpp \
64+
source/val/validate_literals.cpp \
65+
source/val/validate_logicals.cpp \
66+
source/val/validate_non_uniform.cpp \
67+
source/val/validate_primitives.cpp \
68+
source/val/validate_type.cpp
6169

6270
SPVTOOLS_OPT_SRC_FILES := \
6371
source/opt/aggressive_dead_code_elim_pass.cpp \
@@ -67,6 +75,7 @@ SPVTOOLS_OPT_SRC_FILES := \
6775
source/opt/cfg.cpp \
6876
source/opt/cfg_cleanup_pass.cpp \
6977
source/opt/ccp_pass.cpp \
78+
source/opt/combine_access_chains.cpp \
7079
source/opt/common_uniform_elim_pass.cpp \
7180
source/opt/compact_ids_pass.cpp \
7281
source/opt/composite.cpp \
@@ -93,7 +102,6 @@ SPVTOOLS_OPT_SRC_FILES := \
93102
source/opt/inline_pass.cpp \
94103
source/opt/inline_exhaustive_pass.cpp \
95104
source/opt/inline_opaque_pass.cpp \
96-
source/opt/insert_extract_elim.cpp \
97105
source/opt/instruction.cpp \
98106
source/opt/instruction_list.cpp \
99107
source/opt/ir_context.cpp \
@@ -122,6 +130,7 @@ SPVTOOLS_OPT_SRC_FILES := \
122130
source/opt/pass_manager.cpp \
123131
source/opt/private_to_local_pass.cpp \
124132
source/opt/propagator.cpp \
133+
source/opt/reduce_load_size.cpp \
125134
source/opt/redundancy_elimination.cpp \
126135
source/opt/register_pressure.cpp \
127136
source/opt/remove_duplicates_pass.cpp \
@@ -302,7 +311,6 @@ include $(CLEAR_VARS)
302311
LOCAL_MODULE := SPIRV-Tools
303312
LOCAL_C_INCLUDES := \
304313
$(LOCAL_PATH)/include \
305-
$(LOCAL_PATH)/source \
306314
$(LOCAL_PATH)/external/spirv-headers/include \
307315
$(SPVTOOLS_OUT_PATH)
308316
LOCAL_EXPORT_C_INCLUDES := \

IGC/AdaptorOCL/SPIRV/SPIRV-Tools/CHANGES

Lines changed: 157 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,120 @@
11
Revision history for SPIRV-Tools
22

3-
v2018.3-dev 2018-04-06
3+
v2018.6-dev 2018-09-07
4+
- Start v2018.6-dev
5+
6+
v2018.5 2018-09-07
7+
- General:
8+
- Support SPV_KHR_vulkan_memory_model
9+
- Update Dim capabilities, to match SPIR-V 1.3 Rev 4
10+
- Automated build bots no run tests for the VS2013 case
11+
- Support Chromium GN build
12+
- Use Kokoro bots:
13+
- Disable Travis-CI bots
14+
- Disable AppVeyor VisualStudio Release builds. Keep VS 2017 Debug build
15+
- Don't check export symbols on OSX (Darwin): some installations don't have 'objdump'
16+
- Reorganize source files and namespaces
17+
- Fixes for ClangTidy, and whitespace (passes 'git cl presumit --all -uf')
18+
- Fix unused param compile warnings/errors when Effcee not present
19+
- Avoid including time headers when timer functionality is disabled
20+
- Avoid too-stringent warnings flags for Clang on Windows
21+
- Internal refactoring
22+
- Add hooks for automated fuzzing
23+
- Add testing of command line executables
24+
- #1688: Use binary mode on stdin; fixes "spirv-dis <foo.spv" on Windows
25+
- Optimizer
26+
- The optimizer validates the module before it begins
27+
- Add API to register passes by string name
28+
- Fold a vector shuffle feeding a vector shuffle
29+
- Add -combine-access-chains transform
30+
- Refactor how IRContext is handled by passes
31+
- Improve bookkeeping for instruction result type and result id
32+
- Fix over-duplication of decorations
33+
- Fix handling of exits from selections in dead-branch elimination, and dead code
34+
elimination.
35+
- Fix handling of certain kinds of flow control in merge-return
36+
Fixes:
37+
- #1721: Fix size bug when folding vector shuffles
38+
- #1722: Fix size infinite loop when folding vector shuffles
39+
- #1724: Fix finding a constant of a specific type
40+
- #1727: Dead branch elim: Reorder blocks if needed to satisfy dominance rule
41+
- #1729: Handle VariablePointers cases in various optimizations
42+
- #1731: Fix vector shuffle with literal id indicating undef value
43+
- #1736: Fix handling of decorations and phis in merge-return
44+
- #1787: Fix handling of decorations related to access chains
45+
- #1865: Avoid leaking memory for SPIR-V constant values
46+
- Validator
47+
- Improve error messages
48+
- Avoid platform-dependent traversal ordering, to ensure consistent messages
49+
- Use libspirv::Instruction where possible
50+
- Add option to skip all block layout checks
51+
- Validate all type IDs
52+
- Validate uses of OpFunction
53+
- Validate uses of OpTypeFunction
54+
- Disallow a struct containing its own type https://crbug.com/874372
55+
- #1685: Vulkan permits non-monotonic offsets for block members
56+
- #1697: Enforce block layout rules even when using relaxed block layout option
57+
- #1719: Fix line number for vector shuffle valiation error
58+
- #1789: Avoid assertion failure when validating some functions
59+
- #1800: Fix validation of OpCopyMemorySized
60+
- #1822: Stop enforcing struct member offset montonicity
61+
- #1831: Disallow void members in structs
62+
63+
v2018.4 2018-07-08
64+
- General:
65+
- Support SPV_KHR_8bit_storage
66+
- Add gclient and presubmit configurations
67+
- Enable Kokoro build bots (#1625)
68+
- Group tests into fewer executables, reduces load on CI
69+
- Port test script to Python 3
70+
- Symbol export tests respect SPIRV_SKIP_TESTS
71+
- #1596: Operand lookup succeeds if enabled by a capability
72+
- #1624: Instruction lookup succeeds if enabled by a capability
73+
- Refactoring namespaces:
74+
- #1678: Change libspirv to spvtools
75+
- Code in source/utils moved into spvtools::utils
76+
- Code in source/comp moved into spvtools::comp
77+
- Optimizer:
78+
- Remove insert-extract-elim pass. Use simplification pass instead.
79+
- Preserve instruction-to-block mapping in most passes, to reduce runtime.
80+
- Small vector optimization for operands
81+
- Add pass to move Private variables to Function. Increase opportunity to optimize.
82+
- Fixes:
83+
#1120: Check static uses of entry point interfaces
84+
#1372: Avoid merging some structs, to preserve names for reflection
85+
#1577: Scalar replacement uses only undecorated types.
86+
#1578: Fix handling of forward-pointer types, and types embedding pointers
87+
to themselves.
88+
#1591: Inliner: Callee variable with initializer should have a store at the call site.
89+
#1634: Fix crash: Use type id in vector type lookup
90+
#1649: Fix assert in compact-ids pass
91+
Fix constant folder: ensure it uses the right type
92+
#1659: Folding rules added to IRContext. Avoids leak.
93+
- Validator
94+
- Add work-in-progress WebGPU environment. Disallows OpUndef
95+
- #670, #1581: Improve error messages; disassemble instruction
96+
- #491: Check structured switches
97+
- #937: Check layout rules for Block and BufferBlock in Uniform, StorageBuffer, PushConstant
98+
- #1281: Check invalid branches into structured constructs
99+
- #1522: Disallow array-of-arrays with DescriptorSets
100+
- #1577: Allow duplicate pointer types.
101+
- #1581: Better messages: output ID names along with numbers in more cases.
102+
- #1597: Check Vulkan 1.1 capabilities
103+
- #1618: Check invalid exit from structured case construct
104+
- #1622: Run IdPass before DataRulesPass
105+
- #1632: Reduce test time by artificially lowering limits in limit test
106+
- #1638: Block-decorated structs member order must respect offset order
107+
- #1657: Improve CFG validation diagnostics
108+
- Khronos SPIR-V #337: GLSL.std.450 Refract instruction Eta param can be any float scalar.
109+
- #1606: PushConstant Blocks follow storage-buffer layout rules
110+
- #1664: Check layout of StorageBuffer variables with Block decoration, using storage buffer
111+
rules
112+
- #1666: Layout validation should permit {vec3; float} packing
113+
- #1637, #1668: Layout validation uses RowMajor, ArrayStride, MatrixStride properly
114+
- Linker
115+
- Avoid buffer overrun when creating OpModuleProcessed
116+
117+
v2018.3 2018-05-25
4118
- General:
5119
- Support SPV_EXT_descriptor_indexing
6120
- Support SPV_GOOGLE_decorate_string
@@ -12,31 +126,69 @@ v2018.3-dev 2018-04-06
12126
attributes in the "unified1" SPIR-V core grammar.
13127
- Disassembler: Emit more digits on floating point, to reliably reproduce all
14128
significand bits. (Use std::max_digits10 instead of std::digits10)
129+
- Fix compilation for old XCode versions: Explicit construction required for std::set.
15130
- Optimizer:
16131
- Add --strip-reflect
17132
- Add --time-report
133+
- Add --loop-fission
134+
- Add lop fusion.
135+
- Add loop peeling pass and internal utility.
136+
- Improve optimizer runtime.
18137
- Merge-return now works with structured control flow.
19138
- New (faster) SSA rewriter to convert local loads and stores to SSA IDs and phis.
20139
Can replace load/store elimination passes.
21140
- Fix instruction folding case: insertion that feeds and extract, when the extract
22141
remains.
142+
- Fold OpDot.
143+
- Fold OpFNegate.
144+
- Fold multply and divide of same value.
145+
- Fold FClamp feeding a compare.
146+
- Fold OpLoad feeding an extract, to reduce excessive copying. (#1547)
147+
- Fold Fmix feeding an extract.
148+
- Use simplification pass instead of insert-extract elimination.
149+
- Constant fold OpVectorTimesScalar.
23150
- Copy propagate arrays, in simple cases.
151+
- Aggressive dead code elimination: Can remove more instructions, e.g. derivatives.
152+
- Aggressive dead code elimination: Remove Workgroup variables that are written but not read.
24153
- Better handling of OpImageTexelPointer
25-
- Add loop peeling internal utility.
26154
- Initial utilities for scalar evolution.
155+
- Add Vector dead code elimination.
156+
- Each pass can only run once.
157+
- Allow code hosting in if-conversion.
158+
- Add external interface for adding a PassToken, so external code can make their own
159+
passes.
160+
- Fixes:
161+
#1404: Don't optimize away the compute compute workgroup size constant.
162+
#1407: Remove a bad assertion
163+
#1456: Fix bug in SSA rewriter related to variables updated in loops.
164+
#1487: Fix long runtime in Dead insertion elimination: Don't revist select phi nodes.
165+
#1492: Aggressive dead code elimination can remove OpDecorateStringGOOGLE.
166+
#1527: Fix inlining of functions having OpKill and OpUnreachable.
167+
#1559: Fix assert failure in reduce-load-size pass.
168+
#1556: Aggressive dead code elimination: Fix handling of OpCopyMemory.
27169
- Validator:
28170
- Check Vulkan built-in variables
29171
- Check Vulkan-specific atomic result type rule.
30172
- Relax control barrier check for SPIR-V 1.3. Fixes #1427
31173
- Check OpPhi.
174+
- Check OpMemoryModel.
32175
- Stop checking sizes derived from spec-constants.
33176
- Re-enable checks for OpUConvert.
177+
- Vulkan: Fix check for PrimitiveId: Permit as Input in fragment shader.
178+
- Validate binary version for the given target environment.
179+
- Add tests for OpBranch checks.
180+
- Vulkan 1.1: Check scope for non-uniform subgroup operations.
181+
- Fix checks for SPV_AMD_gpu_shader_int16.
182+
- Fix logical layout check for OpDecorateId.
183+
- Fix checks for ViewportIndex & Layer for Vulkan and SPV_EXT_shader_viewport_index_layer.
184+
- Fixes:
185+
#1470: Vulkan: Don't restrict WorkgroupSize to Input storage class.
186+
#1469: Vulkan: Permit Subgroup memory scope for Vulkan 1.1.
187+
#1472: Per-vertex variable validation fixes.
188+
#1483: Valdiate barrier execution scopes for Vulkan 1.1.
34189
- Fixes:
35190
#898: Linker properly removes FuncParamAttr from imported symbols.
36191
#924, #1174: Fix handling of decoration groups in optimizer, linker.
37-
#1404: Don't optimize away the compute compute workgroup size constant.
38-
#1407: Remove a bad assertion
39-
#1456: Fix bug in SSA rewriter related to variables updated in loops.
40192

41193
v2018.2 2018-03-07
42194
- General:

IGC/AdaptorOCL/SPIRV/SPIRV-Tools/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ set(IGC_BUILD__PROJ__SPIRV-Tools "${SPIRV_TOOLS}")
3636
set(IGC_BUILD__PROJ__SPIRV-Tools "${IGC_BUILD__PROJ__SPIRV-Tools}" PARENT_SCOPE)
3737

3838
include(GNUInstallDirs)
39+
include(cmake/setup_build.cmake)
3940

4041
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
4142

@@ -74,12 +75,16 @@ endif()
7475
option(SPIRV_BUILD_COMPRESSION "Build SPIR-V compressing codec" OFF)
7576

7677
option(SPIRV_WERROR "Enable error on warning" ON)
77-
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
78+
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
7879
set(COMPILER_IS_LIKE_GNU TRUE)
7980
endif()
8081
if(${COMPILER_IS_LIKE_GNU})
8182
set(SPIRV_WARNINGS -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers)
8283

84+
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
85+
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Wno-self-assign)
86+
endif()
87+
8388
option(SPIRV_WARN_EVERYTHING "Enable -Weverything" ${SPIRV_WARN_EVERYTHING})
8489
if(${SPIRV_WARN_EVERYTHING})
8590
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
@@ -104,7 +109,7 @@ elseif(MSVC)
104109
endif()
105110
endif()
106111

107-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source)
112+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
108113

109114
option(SPIRV_COLOR_TERMINAL "Enable color terminal output" ON)
110115
if(${SPIRV_COLOR_TERMINAL})
@@ -175,6 +180,9 @@ endif()
175180

176181
find_host_package(PythonInterp)
177182

183+
# Check for symbol exports on Linux.
184+
# At the moment, this check will fail on the OSX build machines for the Android NDK.
185+
# It appears they don't have objdump.
178186
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
179187
macro(spvtools_check_symbol_exports TARGET)
180188
add_test(NAME spirv-tools-symbol-exports-${TARGET}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Find nosetests; see spirv_add_nosetests() for opting in to nosetests in a
2+
# specific directory.
3+
find_program(NOSETESTS_EXE NAMES nosetests PATHS $ENV{PYTHON_PACKAGE_PATH})
4+
if (NOT NOSETESTS_EXE)
5+
message(STATUS "SPIRV-Tools: nosetests was not found - python support code will not be tested")
6+
else()
7+
message(STATUS "SPIRV-Tools: nosetests found - python support code will be tested")
8+
endif()
9+
10+
# Run nosetests on file ${PREFIX}_nosetest.py. Nosetests will look for classes
11+
# and functions whose names start with "nosetest". The test name will be
12+
# ${PREFIX}_nosetests.
13+
function(spirv_add_nosetests PREFIX)
14+
if(NOT "${SPIRV_SKIP_TESTS}" AND NOSETESTS_EXE)
15+
add_test(
16+
NAME ${PREFIX}_nosetests
17+
COMMAND ${NOSETESTS_EXE} -m "^[Nn]ose[Tt]est" -v
18+
${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}_nosetest.py)
19+
endif()
20+
endfunction()

IGC/AdaptorOCL/SPIRV/SPIRV-Tools/external/SPIRV-Headers/include/spirv/unified1/OpenCL.std.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
** IN THE MATERIALS.
2525
*/
2626

27+
#ifndef OPENCLstd_H
28+
#define OPENCLstd_H
29+
2730
namespace OpenCLLIB {
2831

2932
enum Entrypoints {
@@ -208,3 +211,5 @@ enum Entrypoints {
208211
};
209212

210213
} // end namespace OpenCLLIB
214+
215+
#endif // #ifndef OPENCLstd_H

0 commit comments

Comments
 (0)