Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/dead_branch_elim_pass.cpp \
source/opt/dead_insert_elim_pass.cpp \
source/opt/dead_variable_elimination.cpp \
source/opt/decompose_initialized_variables_pass.cpp \
source/opt/decoration_manager.cpp \
source/opt/debug_info_manager.cpp \
source/opt/def_use_manager.cpp \
Expand All @@ -112,7 +111,6 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/fold_spec_constant_op_and_composite_pass.cpp \
source/opt/freeze_spec_constant_value_pass.cpp \
source/opt/function.cpp \
source/opt/generate_webgpu_initializers_pass.cpp \
source/opt/graphics_robust_access_pass.cpp \
source/opt/if_conversion.cpp \
source/opt/inline_pass.cpp \
Expand All @@ -126,7 +124,6 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/instrument_pass.cpp \
source/opt/ir_context.cpp \
source/opt/ir_loader.cpp \
source/opt/legalize_vector_shuffle_pass.cpp \
source/opt/licm_pass.cpp \
source/opt/local_access_chain_convert_pass.cpp \
source/opt/local_redundancy_elimination.cpp \
Expand Down Expand Up @@ -161,10 +158,8 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/scalar_replacement_pass.cpp \
source/opt/set_spec_constant_default_value_pass.cpp \
source/opt/simplification_pass.cpp \
source/opt/split_invalid_unreachable_pass.cpp \
source/opt/ssa_rewrite_pass.cpp \
source/opt/strength_reduction_pass.cpp \
source/opt/strip_atomic_counter_memory_pass.cpp \
source/opt/strip_debug_info_pass.cpp \
source/opt/strip_reflect_info_pass.cpp \
source/opt/struct_cfg_analysis.cpp \
Expand Down
10 changes: 0 additions & 10 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,6 @@ static_library("spvtools_opt") {
"source/opt/dead_insert_elim_pass.h",
"source/opt/dead_variable_elimination.cpp",
"source/opt/dead_variable_elimination.h",
"source/opt/decompose_initialized_variables_pass.cpp",
"source/opt/decompose_initialized_variables_pass.h",
"source/opt/decoration_manager.cpp",
"source/opt/decoration_manager.h",
"source/opt/debug_info_manager.cpp",
Expand Down Expand Up @@ -578,8 +576,6 @@ static_library("spvtools_opt") {
"source/opt/freeze_spec_constant_value_pass.h",
"source/opt/function.cpp",
"source/opt/function.h",
"source/opt/generate_webgpu_initializers_pass.cpp",
"source/opt/generate_webgpu_initializers_pass.h",
"source/opt/graphics_robust_access_pass.cpp",
"source/opt/graphics_robust_access_pass.h",
"source/opt/if_conversion.cpp",
Expand Down Expand Up @@ -608,8 +604,6 @@ static_library("spvtools_opt") {
"source/opt/ir_loader.cpp",
"source/opt/ir_loader.h",
"source/opt/iterator.h",
"source/opt/legalize_vector_shuffle_pass.cpp",
"source/opt/legalize_vector_shuffle_pass.h",
"source/opt/licm_pass.cpp",
"source/opt/licm_pass.h",
"source/opt/local_access_chain_convert_pass.cpp",
Expand Down Expand Up @@ -680,14 +674,10 @@ static_library("spvtools_opt") {
"source/opt/set_spec_constant_default_value_pass.h",
"source/opt/simplification_pass.cpp",
"source/opt/simplification_pass.h",
"source/opt/split_invalid_unreachable_pass.cpp",
"source/opt/split_invalid_unreachable_pass.h",
"source/opt/ssa_rewrite_pass.cpp",
"source/opt/ssa_rewrite_pass.h",
"source/opt/strength_reduction_pass.cpp",
"source/opt/strength_reduction_pass.h",
"source/opt/strip_atomic_counter_memory_pass.cpp",
"source/opt/strip_atomic_counter_memory_pass.h",
"source/opt/strip_debug_info_pass.cpp",
"source/opt/strip_debug_info_pass.h",
"source/opt/strip_reflect_info_pass.cpp",
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ As of this writing, there are 67 transforms including examples such as:
* Loop-invariant code motion
* Loop unroll
* Other
* Generate WebGPU initializers
* Graphics robust access
* Upgrade memory model to VulkanKHR

Expand Down
2 changes: 1 addition & 1 deletion include/spirv-tools/libspirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ typedef enum {
SPV_ENV_OPENCL_EMBEDDED_2_2, // OpenCL Embedded Profile 2.2 latest revision.
SPV_ENV_UNIVERSAL_1_3, // SPIR-V 1.3 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_1, // Vulkan 1.1 latest revision.
SPV_ENV_WEBGPU_0, // Work in progress WebGPU 1.0.
SPV_ENV_WEBGPU_0, // DEPRECATED, may be removed in the future.
SPV_ENV_UNIVERSAL_1_4, // SPIR-V 1.4 latest revision, no other restrictions.

// Vulkan 1.1 with VK_KHR_spirv_1_4, i.e. SPIR-V 1.4 binary.
Expand Down
41 changes: 0 additions & 41 deletions include/spirv-tools/optimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ class Optimizer {
// The instance will have an empty message consumer, which ignores all
// messages from the library. Use SetMessageConsumer() to supply a consumer
// if messages are of concern.
//
// For collections of passes that are meant to transform the input into
// another execution environment, then the source environment should be
// supplied. e.g. for VulkanToWebGPUPasses the environment should be
// SPV_ENV_VULKAN_1_1 not SPV_ENV_WEBGPU_0.
explicit Optimizer(spv_target_env env);

// Disables copy/move constructor/assignment operations.
Expand Down Expand Up @@ -106,16 +101,6 @@ class Optimizer {
// from time to time.
Optimizer& RegisterSizePasses();

// Registers passes that have been prescribed for converting from Vulkan to
// WebGPU. This sequence of passes is subject to constant review and will
// change from time to time.
Optimizer& RegisterVulkanToWebGPUPasses();

// Registers passes that have been prescribed for converting from WebGPU to
// Vulkan. This sequence of passes is subject to constant review and will
// change from time to time.
Optimizer& RegisterWebGPUToVulkanPasses();

// Registers passes that attempt to legalize the generated code.
//
// Note: this recipe is specially designed for legalizing SPIR-V. It should be
Expand Down Expand Up @@ -238,13 +223,6 @@ class Optimizer {
// A null pass does nothing to the SPIR-V module to be optimized.
Optimizer::PassToken CreateNullPass();

// Creates a strip-atomic-counter-memory pass.
// A strip-atomic-counter-memory pass removes all usages of the
// AtomicCounterMemory bit in Memory Semantics bitmasks. This bit is a no-op in
// Vulkan, so isn't needed in that env. And the related capability is not
// allowed in WebGPU, so it is not allowed in that env.
Optimizer::PassToken CreateStripAtomicCounterMemoryPass();

// Creates a strip-debug-info pass.
// A strip-debug-info pass removes all debug instructions (as documented in
// Section 3.32.2 of the SPIR-V spec) of the SPIR-V module to be optimized.
Expand Down Expand Up @@ -802,30 +780,11 @@ Optimizer::PassToken CreateUpgradeMemoryModelPass();
// where an instruction is moved into a more deeply nested construct.
Optimizer::PassToken CreateCodeSinkingPass();

// Create a pass to adds initializers for OpVariable calls that require them
// in WebGPU. Currently this pass naively initializes variables that are
// missing an initializer with a null value. In the future it may initialize
// variables to the first value stored in them, if that is a constant.
Optimizer::PassToken CreateGenerateWebGPUInitializersPass();

// Create a pass to fix incorrect storage classes. In order to make code
// generation simpler, DXC may generate code where the storage classes do not
// match up correctly. This pass will fix the errors that it can.
Optimizer::PassToken CreateFixStorageClassPass();

// Create a pass to legalize OpVectorShuffle operands going into WebGPU. WebGPU
// forbids using 0xFFFFFFFF, which indicates an undefined result, so this pass
// converts those literals to 0.
Optimizer::PassToken CreateLegalizeVectorShufflePass();

// Create a pass to decompose initialized variables into a seperate variable
// declaration and an initial store.
Optimizer::PassToken CreateDecomposeInitializedVariablesPass();

// Create a pass to attempt to split up invalid unreachable merge-blocks and
// continue-targets to legalize for WebGPU.
Optimizer::PassToken CreateSplitInvalidUnreachablePass();

// Creates a graphics robust access pass.
//
// This pass injects code to clamp indexed accesses to buffers and internal
Expand Down
1 change: 0 additions & 1 deletion source/ext_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
case SPV_ENV_UNIVERSAL_1_3:
case SPV_ENV_VULKAN_1_1:
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_WEBGPU_0:
case SPV_ENV_UNIVERSAL_1_4:
case SPV_ENV_UNIVERSAL_1_5:
case SPV_ENV_VULKAN_1_2:
Expand Down
6 changes: 4 additions & 2 deletions source/libspirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "spirv-tools/libspirv.hpp"

#include <cassert>
#include <iostream>

#include <string>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -60,7 +60,9 @@ struct SpirvTools::Impl {
spv_context context; // C interface context object.
};

SpirvTools::SpirvTools(spv_target_env env) : impl_(new Impl(env)) {}
SpirvTools::SpirvTools(spv_target_env env) : impl_(new Impl(env)) {
assert(env != SPV_ENV_WEBGPU_0);
}

SpirvTools::~SpirvTools() {}

Expand Down
9 changes: 0 additions & 9 deletions source/opt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ set(SPIRV_TOOLS_OPT_SOURCES
dead_branch_elim_pass.h
dead_insert_elim_pass.h
dead_variable_elimination.h
decompose_initialized_variables_pass.h
decoration_manager.h
debug_info_manager.h
def_use_manager.h
Expand All @@ -52,7 +51,6 @@ set(SPIRV_TOOLS_OPT_SOURCES
fold_spec_constant_op_and_composite_pass.h
freeze_spec_constant_value_pass.h
function.h
generate_webgpu_initializers_pass.h
graphics_robust_access_pass.h
if_conversion.h
inline_exhaustive_pass.h
Expand Down Expand Up @@ -103,10 +101,8 @@ set(SPIRV_TOOLS_OPT_SOURCES
scalar_replacement_pass.h
set_spec_constant_default_value_pass.h
simplification_pass.h
split_invalid_unreachable_pass.h
ssa_rewrite_pass.h
strength_reduction_pass.h
strip_atomic_counter_memory_pass.h
strip_debug_info_pass.h
strip_reflect_info_pass.h
struct_cfg_analysis.h
Expand Down Expand Up @@ -140,7 +136,6 @@ set(SPIRV_TOOLS_OPT_SOURCES
dead_branch_elim_pass.cpp
dead_insert_elim_pass.cpp
dead_variable_elimination.cpp
decompose_initialized_variables_pass.cpp
decoration_manager.cpp
debug_info_manager.cpp
def_use_manager.cpp
Expand All @@ -160,7 +155,6 @@ set(SPIRV_TOOLS_OPT_SOURCES
freeze_spec_constant_value_pass.cpp
function.cpp
graphics_robust_access_pass.cpp
generate_webgpu_initializers_pass.cpp
if_conversion.cpp
inline_exhaustive_pass.cpp
inline_opaque_pass.cpp
Expand All @@ -173,7 +167,6 @@ set(SPIRV_TOOLS_OPT_SOURCES
instrument_pass.cpp
ir_context.cpp
ir_loader.cpp
legalize_vector_shuffle_pass.cpp
licm_pass.cpp
local_access_chain_convert_pass.cpp
local_redundancy_elimination.cpp
Expand Down Expand Up @@ -208,10 +201,8 @@ set(SPIRV_TOOLS_OPT_SOURCES
scalar_replacement_pass.cpp
set_spec_constant_default_value_pass.cpp
simplification_pass.cpp
split_invalid_unreachable_pass.cpp
ssa_rewrite_pass.cpp
strength_reduction_pass.cpp
strip_atomic_counter_memory_pass.cpp
strip_debug_info_pass.cpp
strip_reflect_info_pass.cpp
struct_cfg_analysis.cpp
Expand Down
112 changes: 0 additions & 112 deletions source/opt/decompose_initialized_variables_pass.cpp

This file was deleted.

Loading