#include "source/reduce/reducer.h"
#include <cassert>
#include <sstream>
#include "source/reduce/conditional_branch_to_simple_conditional_branch_opportunity_finder.h"
#include "source/reduce/merge_blocks_reduction_opportunity_finder.h"
#include "source/reduce/operand_to_const_reduction_opportunity_finder.h"
#include "source/reduce/operand_to_dominating_id_reduction_opportunity_finder.h"
#include "source/reduce/operand_to_undef_reduction_opportunity_finder.h"
#include "source/reduce/remove_block_reduction_opportunity_finder.h"
#include "source/reduce/remove_function_reduction_opportunity_finder.h"
#include "source/reduce/remove_selection_reduction_opportunity_finder.h"
#include "source/reduce/remove_unused_instruction_reduction_opportunity_finder.h"
#include "source/reduce/remove_unused_struct_member_reduction_opportunity_finder.h"
#include "source/reduce/simple_conditional_branch_to_branch_opportunity_finder.h"
#include "source/reduce/structured_construct_to_block_reduction_opportunity_finder.h"
#include "source/reduce/structured_loop_to_selection_reduction_opportunity_finder.h"
#include "source/spirv_reducer_options.h"
namespace spvtools {
namespace reduce {
Reducer::Reducer(spv_target_env target_env) : … { … }
Reducer::~Reducer() = default;
void Reducer::SetMessageConsumer(MessageConsumer c) { … }
void Reducer::SetInterestingnessFunction(
Reducer::InterestingnessFunction interestingness_function) { … }
Reducer::ReductionResultStatus Reducer::Run(
const std::vector<uint32_t>& binary_in, std::vector<uint32_t>* binary_out,
spv_const_reducer_options options,
spv_validator_options validator_options) { … }
void Reducer::AddDefaultReductionPasses() { … }
void Reducer::AddReductionPass(
std::unique_ptr<ReductionOpportunityFinder> finder) { … }
void Reducer::AddCleanupReductionPass(
std::unique_ptr<ReductionOpportunityFinder> finder) { … }
bool Reducer::ReachedStepLimit(uint32_t current_step,
spv_const_reducer_options options) { … }
Reducer::ReductionResultStatus Reducer::RunPasses(
std::vector<std::unique_ptr<ReductionPass>>* passes,
spv_const_reducer_options options, spv_validator_options validator_options,
const SpirvTools& tools, std::vector<uint32_t>* current_binary,
uint32_t* const reductions_applied) { … }
}
}