SPIRV-Tools/test/opt
Steven Perron d51dc53d2c
Improve algorithm to reorder blocks in a function (#4911)
* Improve algorithm to reorder blocks in a function

In dead branch elimination, blocks can end up in a the wrong order, so
there is code to reorder the blocks in structured order.  The problem is
that the algorithm to do that is very poor.  It involves many searchs in
the function for the correct position to place the block, as well as
moving many block in the vector.

The solution is to write a specialized function in the function class
that will reorder the blocks in structured order.  After computing the
structured order, reordering the block can be done in linear time, with
very little overhead.
2022-08-31 11:06:15 -04:00
..
dominator_tree Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
loop_optimizations Don't try to unroll loop with step count 0. (#4769) 2022-04-11 10:21:15 -04:00
aggressive_dead_code_elim_test.cpp Fix ADCE to not eliminate top level DebugInfo instructions (#4889) 2022-08-15 15:23:23 -06:00
amd_ext_to_khr.cpp Handle TimeAMD in AmdExtensionToKhrPass. (#3168) 2020-02-03 12:13:32 -05:00
assembly_builder_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
assembly_builder.h Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
block_merge_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
ccp_test.cpp Generalize assert in ccp (#4735) 2022-03-07 19:33:10 +00:00
cfg_cleanup_test.cpp Add validation for execution modes 2018-10-02 10:22:23 -04:00
cfg_test.cpp Build struct order only for the section needed when unrolling. (#4830) 2022-06-29 09:53:26 -04:00
CMakeLists.txt spirv-opt: add pass for interface variable scalar replacement (#4779) 2022-05-09 14:04:52 -04:00
code_sink_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
combine_access_chains_test.cpp Update passes to handle function declarations (#4599) 2021-10-28 11:54:37 -04:00
compact_ids_test.cpp Reset the id bound on the module in compact ids (#4744) 2022-03-07 20:33:01 +00:00
constant_manager_test.cpp Handle id overflow in the constant manager. (#2844) 2019-09-09 15:12:26 -04:00
constants_test.cpp Add pass to inject code for robust-buffer-access semantics (#2771) 2019-07-30 19:52:46 -04:00
control_dependence.cpp spirv-opt: Rename ControlDependenceAnalysis::DoesBlockExist to HasBlock (#4412) 2021-07-29 08:30:48 -04:00
convert_relaxed_to_half_test.cpp Fix handling of OpPhi in convert-relaxed-to-half (#4618) 2021-11-09 10:36:50 -07:00
convert_to_sampled_image_test.cpp Add spirv-opt convert-to-sampled-image pass (#4340) 2021-08-18 08:30:48 -04:00
copy_prop_array_test.cpp spirv-opt: fix copy-propagate-arrays index opti on structs. (#4891) 2022-08-16 16:05:47 +02:00
dataflow.cpp spirv-opt: Add dataflow analysis framework (#4402) 2021-08-09 16:43:36 -04:00
dead_branch_elim_test.cpp Use structural dominance to validate cfg (#4832) 2022-06-29 23:32:20 -04:00
dead_insert_elim_test.cpp Opt passes should apply to the exported functions (#4554) 2021-10-18 13:18:16 -04:00
dead_variable_elim_test.cpp Validate variable initializer type (#2668) 2019-06-15 00:34:18 -04:00
debug_info_manager_test.cpp Generate constants directly in CreateDebugInlinedAt (#4572) 2021-10-19 18:27:16 -06:00
decoration_manager_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
def_use_test.cpp Revert "Optimize DefUseManager allocations (#4709)" (#4846) 2022-07-12 13:14:47 -06:00
desc_sroa_test.cpp Copy OpDecorateStrings in DescriptorScalarReplacementPass (#4649) 2021-11-29 02:11:22 -05:00
eliminate_dead_const_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
eliminate_dead_functions_test.cpp Fix crash when optimizing shaders with DebugPrintf (#4280) 2021-05-13 13:19:56 -04:00
eliminate_dead_input_components_test.cpp Add structs to eliminate dead input components (#4894) 2022-08-16 11:31:04 -04:00
eliminate_dead_member_test.cpp spirv-opt: Don't eliminate dead members from StructuredBuffer (#4553) 2021-10-01 08:31:40 -04:00
feature_manager_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
fix_func_call_arguments_test.cpp spirv-opt : Add FixFuncCallArgumentsPass (#4775) 2022-05-06 10:39:26 -04:00
fix_storage_class_test.cpp spirv-opt: Don't call GenerateCopy for mismatched image types (#4126) 2021-02-19 10:59:14 -05:00
flatten_decoration_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
fold_spec_const_op_composite_test.cpp Support constant-folding UConvert and SConvert (#2960) 2019-10-16 16:29:55 -04:00
fold_test.cpp Fix shuffle feeding shuffle with undef literal (#4883) 2022-08-10 09:04:35 -04:00
freeze_spec_const_test.cpp spirv-opt: Add OpExecutionModeId support (#4719) 2022-02-14 14:33:29 +00:00
function_test.cpp Improve algorithm to reorder blocks in a function (#4911) 2022-08-31 11:06:15 -04:00
function_utils.h Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
graphics_robust_access_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
if_conversion_test.cpp Avoid if-conversion if both predecessors are the same (#4826) 2022-06-24 15:28:06 +00:00
inline_opaque_test.cpp Opt passes should apply to the exported functions (#4554) 2021-10-18 13:18:16 -04:00
inline_test.cpp Use structural dominance to validate cfg (#4832) 2022-06-29 23:32:20 -04:00
insert_extract_elim_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
inst_bindless_check_test.cpp tests: Make InstrumentPass tests use SinglePassRunAndMatch<> and stateful pattern matching (#4897) 2022-08-23 12:28:00 -06:00
inst_buff_addr_check_test.cpp tests: Make InstrumentPass tests use SinglePassRunAndMatch<> and stateful pattern matching (#4897) 2022-08-23 12:28:00 -06:00
inst_debug_printf_test.cpp tests: Make InstrumentPass tests use SinglePassRunAndMatch<> and stateful pattern matching (#4897) 2022-08-23 12:28:00 -06:00
instruction_list_test.cpp Fix -Wextra-semi-stmt -Wsuggest-destructor-override -Wdeprecated-copy-dtor (#4164) 2021-03-09 13:16:43 +00:00
instruction_test.cpp Avoid undefined behaviour when getting debug opcode (#4842) 2022-07-05 14:14:29 -04:00
interface_var_sroa_test.cpp spirv-opt: add pass for interface variable scalar replacement (#4779) 2022-05-09 14:04:52 -04:00
interp_fixup_test.cpp Add interpolate legalization pass (#4220) 2021-03-31 14:26:36 -04:00
ir_builder.cpp Add support for KHR_ray_{query,tracing} extensions (#3235) 2020-03-17 15:30:19 -04:00
ir_context_test.cpp Don't rebuilt valid analyses. (#4733) 2022-03-04 20:16:42 +00:00
ir_loader_test.cpp Update SPIRV-Headers (#4628) 2021-11-10 16:32:09 -05: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 Local access chain convert: check for negative indexes (#4884) 2022-08-09 17:33:04 +00:00
local_redundancy_elimination_test.cpp Fix identification of Vulkan images and buffers (#3253) 2020-03-25 17:38:24 -04:00
local_single_block_elim.cpp Opt passes should apply to the exported functions (#4554) 2021-10-18 13:18:16 -04:00
local_single_store_elim_test.cpp Opt passes should apply to the exported functions (#4554) 2021-10-18 13:18:16 -04:00
local_ssa_elim_test.cpp Update passes to handle function declarations (#4599) 2021-10-28 11:54:37 -04:00
module_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
module_utils.h Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
optimizer_test.cpp Rename strip reflect to strip nonsemantic (#4661) 2021-12-15 09:55:30 -05:00
pass_fixture.h CCP should mark IR changed if it created new constants. (#3732) 2020-08-20 16:48:11 -04:00
pass_manager_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
pass_merge_return_test.cpp Use structural dominance to validate cfg (#4832) 2022-06-29 23:32:20 -04:00
pass_remove_duplicates_test.cpp Fixup readabilty/inheritance warnings (#1805) 2018-08-07 09:10:03 -04:00
pass_utils.cpp Check for unreachable blocks in merge-return. (#1966) 2018-10-10 15:18:15 -04:00
pass_utils.h Fix gtest.h include in test/opt/pass_utils.h 2018-10-12 10:22:25 -04:00
pch_test_opt.cpp Rename PCH macro to spvtools_pch to avoid conflicts with other projects. Also add pch to test/opt. (#2034) 2018-11-07 09:15:04 -05:00
pch_test_opt.h Rename PCH macro to spvtools_pch to avoid conflicts with other projects. Also add pch to test/opt. (#2034) 2018-11-07 09:15:04 -05:00
private_to_local_test.cpp Preserve OpenCL.DebugInfo.100 through private-to-local pass (#3571) 2020-07-27 09:27:47 -04:00
propagator_test.cpp Cleanup includes. (#1795) 2018-08-03 15:06:09 -04:00
reduce_load_size_test.cpp Reduce load size does not work for array with spec const size (#4845) 2022-07-05 16:16:50 -04:00
redundancy_elimination_test.cpp Update passes to handle function declarations (#4599) 2021-10-28 11:54:37 -04:00
register_liveness.cpp Handle unreachable block when computing register pressure (#3070) 2019-11-27 09:45:17 -05:00
relax_float_ops_test.cpp Opt passes should apply to the exported functions (#4554) 2021-10-18 13:18:16 -04:00
remove_dontinline_test.cpp Add pass to remove DontInline function control (#4747) 2022-03-07 12:45:17 -05:00
remove_unused_interface_variables_test.cpp spirv-opt: A pass to removed unused input on OpEntryPoint instructions. (#4275) 2021-06-29 11:33:58 -04:00
replace_desc_array_access_using_var_index_test.cpp Handle chains of OpAccessChain in replacing variable index access for flattened resources. (#4797) 2022-05-10 11:41:43 -04:00
replace_invalid_opc_test.cpp Check for unreachable blocks in merge-return. (#1966) 2018-10-10 15:18:15 -04:00
scalar_analysis.cpp Remove stray output to stdout from tests (#4816) 2022-06-20 10:57:44 -04:00
scalar_replacement_test.cpp Simplify invocation of snprintf (#4815) 2022-06-10 17:55:45 -04:00
set_spec_const_default_value_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
simplification_test.cpp Update passes to handle function declarations (#4599) 2021-10-28 11:54:37 -04:00
spread_volatile_semantics_test.cpp Handle dontinline function in spread-volatile-semantics (#4776) 2022-05-04 10:52:58 -04:00
strength_reduction_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
strip_debug_info_test.cpp Add support for SPV_KHR_non_semantic_info (#3110) 2019-12-18 18:10:29 -05:00
strip_nonsemantic_info_test.cpp reflect debug (#4662) 2021-12-15 11:06:51 -05:00
struct_cfg_analysis_test.cpp spirv-opt: Add function to compute nesting depth of a block (#3771) 2020-09-08 12:01:56 +01:00
type_manager_test.cpp Complete handling of RayQueryKHR type (#4690) 2022-01-31 15:44:32 +00:00
types_test.cpp Avoid replacing access chain with OOB access (#4819) 2022-06-14 13:06:38 -04:00
unify_const_test.cpp Fix various source comment (doxygen) typos (#4680) 2022-01-26 15:13:08 -05:00
upgrade_memory_model_test.cpp Improve decoration validation (#4490) 2021-11-05 13:18:19 -04:00
utils_test.cpp Remove use of deprecated googletest macro (#2286) 2019-01-29 18:56:52 -05:00
value_table_test.cpp Debug info preservation in redundancy-elimination pass (#3839) 2020-10-01 09:22:16 -04:00
vector_dce_test.cpp Handle out-of-bounds accesses in VDCE (#4518) 2021-09-13 09:57:44 -04:00
workaround1209_test.cpp Make EFFCEE required (#1943) 2018-10-04 10:00:11 -04:00
wrap_opkill_test.cpp Propagate OpLine to all applied instructions in spirv-opt (#3951) 2020-10-29 13:06:30 -04:00