SPIRV-Tools/test/opt
Steven Perron 2cb589cc14 Remove uses DCEInst and call ADCE
The algorithm used in DCEInst to remove dead code is very slow.  It is
fine if you only want to remove a small number of instructions, but, if
you need to remove a large number of instructions, then the algorithm in
ADCE is much faster.

This PR removes the calls to DCEInst in the load-store removal passes
and adds a pass of ADCE afterwards.

A number of different iterations of the order of optimization, and I
believe this is the best I could find.

The results I have on 3 sets of shaders are:

Legalization:

Set 1: 5.39 -> 5.01
Set 2: 13.98 -> 8.38
Set 3: 98.00 -> 96.26

Performance passes:

Set 1: 6.90 -> 5.23
Set 2: 10.11 -> 6.62
Set 3: 253.69 -> 253.74

Size reduction passes:

Set 1: 7.16 -> 7.25
Set 2: 17.17 -> 16.81
Set 3: 112.06 -> 107.71

Note that the third set's compile time is large because of the large
number of basic blocks, not so much because of the number of
instructions.  That is why we don't see much gain there.
2018-02-27 21:06:08 -05:00
..
dominator_tree Initial implementation of if conversion 2018-01-25 09:42:00 -08:00
loop_optimizations Add loop unswitch pass. 2018-02-27 08:52:46 -05:00
aggressive_dead_code_elim_test.cpp Fixes infinite loop in ADCE 2018-01-19 11:08:46 -05:00
assembly_builder_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
assembly_builder.h Adding additional functionality to ADCE. 2018-01-10 08:35:48 -05:00
block_merge_test.cpp Enhancements to block merging 2018-01-30 16:05:51 -05:00
ccp_test.cpp Fixes #1338. Handle OpConstantNull in branch/switch conditions 2018-02-21 10:22:39 -05:00
cfg_cleanup_test.cpp Add adjacency validation pass 2018-02-01 14:10:55 -05:00
CMakeLists.txt Make use of the instruction folder. 2018-02-07 23:01:47 -05:00
common_uniform_elim_test.cpp Fixes missing increment in common uniform elim 2018-01-16 14:47:35 -05:00
compact_ids_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
dead_branch_elim_test.cpp Simplify OpPhi instructions referencing unreachable continues 2018-02-16 18:58:03 -05:00
dead_insert_elim_test.cpp InsertExtractElim: Split out DeadInsertElim as separate pass 2018-01-30 08:52:14 -05:00
dead_variable_elim_test.cpp Add pass to remove dead variables at the module level. 2017-10-23 13:57:05 -04:00
decoration_manager_test.cpp Opt: Make DecorationManager::HaveTheSameDecorations symmetric 2018-01-04 14:07:25 -05:00
def_use_test.cpp Preserve analysies in the simplification pass 2018-02-22 16:06:30 -05:00
eliminate_dead_const_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
eliminate_dead_functions_test.cpp Add scalar replacement 2017-12-11 10:51:13 -05:00
feature_manager_test.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
flatten_decoration_test.cpp Add FlattenDecoration transform 2017-04-06 11:19:56 -04:00
fold_spec_const_op_composite_test.cpp Implement SSA CCP (SSA Conditional Constant Propagation). 2017-12-21 14:29:45 -05:00
fold_test.cpp Merge arithmetic with non-trivial constant operands 2018-02-27 13:02:13 -05:00
freeze_spec_const_test.cpp Provide friendly names for true and false 2017-01-11 16:33:45 -05:00
function_utils.h Dominator Tree Analysis (#3) 2017-12-05 22:59:43 -05:00
if_conversion_test.cpp Initial implementation of if conversion 2018-01-25 09:42:00 -08:00
inline_opaque_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
inline_test.cpp Set the parent for basic blocks during inlining. 2017-12-12 13:39:08 -05:00
insert_extract_elim_test.cpp InsertExtractElim: Split out DeadInsertElim as separate pass 2018-01-30 08:52:14 -05:00
instruction_list_test.cpp Change the sections in the module to use the InstructionList class. 2017-10-25 15:52:06 -04:00
instruction_test.cpp Allow getting the base pointer of an image load/store. 2018-01-05 13:26:10 -05:00
ir_builder.cpp Make IR builder use the type manager for constants 2018-02-27 12:59:26 -05:00
ir_context_test.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
ir_loader_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
iterator_test.cpp Renaming test files to comply with Google style guide. 2016-11-07 14:41:51 -05:00
line_debug_info_test.cpp Add the IRContext (part 1) 2017-10-31 13:46:05 -04:00
local_access_chain_convert_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
local_redundancy_elimination_test.cpp Add scalar replacement 2017-12-11 10:51:13 -05:00
local_single_block_elim.cpp Remove uses DCEInst and call ADCE 2018-02-27 21:06:08 -05:00
local_single_store_elim_test.cpp Remove uses DCEInst and call ADCE 2018-02-27 21:06:08 -05:00
local_ssa_elim_test.cpp Remove uses DCEInst and call ADCE 2018-02-27 21:06:08 -05:00
module_test.cpp Adding ostream operators for IR structures 2018-01-12 11:19:58 -05:00
module_utils.h Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
optimizer_test.cpp Fix optimizer on when to write the binary 2017-04-03 15:48:50 -04:00
pass_fixture.h Add pass to reaplce invalid opcodes 2018-02-01 15:25:09 -05:00
pass_manager_test.cpp Store all enabled capabilities in the feature manger. 2017-12-21 11:14:53 -05:00
pass_merge_return_test.cpp Initial implementation of merge return pass. 2017-11-15 10:27:04 -05:00
pass_remove_duplicates_test.cpp Opt: Fix implementation and comment of AreDecorationsTheSame 2017-12-19 15:36:47 -05:00
pass_test.cpp Adding an unique id to Instruction generated by IRContext 2017-11-20 17:49:10 -05:00
pass_utils.cpp Relicense SPIRV-Tools under Apache 2.0 2016-09-02 10:00:29 -04:00
pass_utils.h Add strength reduction; for now replace multiply by power of 2 2017-09-18 17:01:36 -04:00
private_to_local_test.cpp Convert private variables to function scope. 2017-12-19 14:21:04 -05:00
propagator_test.cpp Remove cfg_ field from SSAPropagator class - NFC. 2017-12-04 15:28:21 -05:00
redundancy_elimination_test.cpp Add scalar replacement 2017-12-11 10:51:13 -05:00
replace_invalid_opc_test.cpp Add pass to reaplce invalid opcodes 2018-02-01 15:25:09 -05:00
scalar_replacement_test.cpp SROA: Do replacement on structs with no partial references. 2018-02-08 15:20:02 -05:00
set_spec_const_default_value_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
simplification_test.cpp Add folding of OpCompositeExtract and OpConstantComposite constant instructions. 2018-02-09 17:52:33 -05:00
strength_reduction_test.cpp Add scalar replacement 2017-12-11 10:51:13 -05:00
strip_debug_info_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
type_manager_test.cpp Fix test inclusion when Effcee is absent 2018-02-06 12:10:50 -05:00
types_test.cpp Improving the usability of the type manager. The type manager hashes 2017-12-18 08:20:56 -05:00
unify_const_test.cpp Add scalar replacement 2017-12-11 10:51:13 -05:00
utils_test.cpp Re-format source tree - NFC. 2017-11-27 14:31:49 -05:00
value_table_test.cpp Compute value number when the value table is constructed. 2017-12-04 11:02:04 -05:00
workaround1209_test.cpp Create a pass to work around a driver bug related to OpUnreachable. 2018-01-18 20:31:46 -05:00