mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-28 02:31:04 +00:00
4ba9dcc8a0
This implements the conditional constant propagation pass proposed in Constant propagation with conditional branches, Wegman and Zadeck, ACM TOPLAS 13(2):181-210. The main logic resides in CCPPass::VisitInstruction. Instruction that may produce a constant value are evaluated with the constant folder. If they produce a new constant, the instruction is considered interesting. Otherwise, it's considered varying (for unfoldable instructions) or just not interesting (when not enough operands have a constant value). The other main piece of logic is in CCPPass::VisitBranch. This evaluates the selector of the branch. When it's found to be a known value, it computes the destination basic block and sets it. This tells the propagator which branches to follow. The patch required extensions to the constant manager as well. Instead of hashing the Constant pointers, this patch changes the constant pool to hash the contents of the Constant. This allows the lookups to be done using the actual values of the Constant, preventing duplicate definitions. |
||
---|---|---|
.. | ||
dominator_tree | ||
aggressive_dead_code_elim_test.cpp | ||
assembly_builder_test.cpp | ||
assembly_builder.h | ||
block_merge_test.cpp | ||
ccp_test.cpp | ||
cfg_cleanup_test.cpp | ||
CMakeLists.txt | ||
common_uniform_elim_test.cpp | ||
compact_ids_test.cpp | ||
dead_branch_elim_test.cpp | ||
dead_variable_elim_test.cpp | ||
decoration_manager_test.cpp | ||
def_use_test.cpp | ||
eliminate_dead_const_test.cpp | ||
eliminate_dead_functions_test.cpp | ||
feature_manager_test.cpp | ||
flatten_decoration_test.cpp | ||
fold_spec_const_op_composite_test.cpp | ||
freeze_spec_const_test.cpp | ||
function_utils.h | ||
inline_opaque_test.cpp | ||
inline_test.cpp | ||
insert_extract_elim_test.cpp | ||
instruction_list_test.cpp | ||
instruction_test.cpp | ||
ir_context_test.cpp | ||
ir_loader_test.cpp | ||
iterator_test.cpp | ||
line_debug_info_test.cpp | ||
local_access_chain_convert_test.cpp | ||
local_redundancy_elimination_test.cpp | ||
local_single_block_elim.cpp | ||
local_single_store_elim_test.cpp | ||
local_ssa_elim_test.cpp | ||
module_test.cpp | ||
module_utils.h | ||
optimizer_test.cpp | ||
pass_fixture.h | ||
pass_manager_test.cpp | ||
pass_merge_return_test.cpp | ||
pass_remove_duplicates_test.cpp | ||
pass_test.cpp | ||
pass_utils.cpp | ||
pass_utils.h | ||
private_to_local_test.cpp | ||
propagator_test.cpp | ||
redundancy_elimination_test.cpp | ||
scalar_replacement_test.cpp | ||
set_spec_const_default_value_test.cpp | ||
strength_reduction_test.cpp | ||
strip_debug_info_test.cpp | ||
type_manager_test.cpp | ||
types_test.cpp | ||
unify_const_test.cpp | ||
utils_test.cpp | ||
value_table_test.cpp |