SPIRV-Tools/test/opt
Steven Perron 497958d899 Removing HLSLCounterBuffer decorations when not needed. (#1954)
The HlslCounterBufferGOOGLE that was introduced changed the OpDecorateId
so that is can now reference an id other than the target.  If that other
id is used only in the decoration, then the definition of the id will be
removed because decoration do not count as real uses.

However, if the target of the decoration is still live the decoration
will not be removed.  This leaves a reference to an id that is not
defined.

There are two solutions to consider.  The first is that is the decoration
is kept, then the definition of the id should be kept live.  Implementing
this change would be involved because the way ADCE handles decorations
will have to be reimplemented.

The other solution is to remove the decoration the id is otherwise dead.
This works for this specific case.  Also this is the more desirable
behaviour in this case.  The id will always be the id of a variable that
belongs to a descriptor set.  If that variable is not bound and we do
not remove it, the driver will complain.

I chose to implement the second solution.  The first will be left to when
a case for it comes up.

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/1885.
2018-10-05 08:23:09 -04:00
..
dominator_tree Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
loop_optimizations Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
aggressive_dead_code_elim_test.cpp Removing HLSLCounterBuffer decorations when not needed. (#1954) 2018-10-05 08:23:09 -04:00
assembly_builder_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
assembly_builder.h Rewrite include guards (#1793) 2018-08-03 08:05:33 -04:00
block_merge_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
ccp_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
cfg_cleanup_test.cpp Add validation for execution modes 2018-10-02 10:22:23 -04:00
CMakeLists.txt Fix infinite loop in dead-branch-elimination (#1891) 2018-09-17 13:00:24 -04:00
combine_access_chains_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
common_uniform_elim_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
compact_ids_test.cpp Validate the input to Optimizer::Run (#1799) 2018-08-08 11:16:19 -04:00
constant_manager_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
copy_prop_array_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
dead_branch_elim_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
dead_insert_elim_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
dead_variable_elim_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
decoration_manager_test.cpp Handle decoration groups with no decorations. (#1921) 2018-09-28 14:16:04 -04:00
def_use_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
eliminate_dead_const_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
eliminate_dead_functions_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
feature_manager_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
flatten_decoration_test.cpp Add validation for execution modes 2018-10-02 10:22:23 -04:00
fold_spec_const_op_composite_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
fold_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
freeze_spec_const_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
function_utils.h Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
if_conversion_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
inline_opaque_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
inline_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
insert_extract_elim_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
instruction_list_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
instruction_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
ir_builder.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
ir_context_test.cpp Handle decoration groups with no decorations. (#1921) 2018-09-28 14:16:04 -04:00
ir_loader_test.cpp Remove source/message.h (#1838) 2018-08-14 15:41:21 -04:00
iterator_test.cpp Move make_unique to source/util. (#1836) 2018-08-14 12:44:54 -04:00
line_debug_info_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
local_access_chain_convert_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
local_redundancy_elimination_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
local_single_block_elim.cpp Keep decorations when replacing loads in access-chain-convert. (#1829) 2018-08-15 09:14:21 -04:00
local_single_store_elim_test.cpp Keep decorations when replacing loads in access-chain-convert. (#1829) 2018-08-15 09:14:21 -04:00
local_ssa_elim_test.cpp Validator: function scope variable at start of entry block #1923 2018-10-04 15:05:47 -04:00
module_test.cpp Add option for the max id bound. (#1870) 2018-09-10 11:49:41 -04:00
module_utils.h Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
optimizer_test.cpp Validate the input to Optimizer::Run (#1799) 2018-08-08 11:16:19 -04:00
pass_fixture.h Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
pass_manager_test.cpp Move make_unique to source/util. (#1836) 2018-08-14 12:44:54 -04:00
pass_merge_return_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
pass_remove_duplicates_test.cpp Fixup readabilty/inheritance warnings (#1805) 2018-08-07 09:10:03 -04:00
pass_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
pass_utils.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
pass_utils.h Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
private_to_local_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
propagator_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
reduce_load_size_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
redundancy_elimination_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
register_liveness.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
replace_invalid_opc_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
scalar_analysis.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
scalar_replacement_test.cpp Don't scalarize spec constant sized arrays 2018-10-04 11:58:23 -04:00
set_spec_const_default_value_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
simplification_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
strength_reduction_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
strip_debug_info_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
strip_reflect_info_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
struct_cfg_analysis_test.cpp Fix infinite loop in dead-branch-elimination (#1891) 2018-09-17 13:00:24 -04:00
type_manager_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
types_test.cpp Use MakeUnique. (#1837) 2018-08-14 15:01:50 -04:00
unify_const_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
utils_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
value_table_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
vector_dce_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
workaround1209_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00