#include "source/reduce/structured_loop_to_selection_reduction_opportunity.h"
#include "source/opt/aggressive_dead_code_elim_pass.h"
#include "source/opt/ir_context.h"
#include "source/reduce/reduction_util.h"
namespace spvtools {
namespace reduce {
namespace {
const uint32_t kMergeNodeIndex = …;
}
bool StructuredLoopToSelectionReductionOpportunity::PreconditionHolds() { … }
void StructuredLoopToSelectionReductionOpportunity::Apply() { … }
void StructuredLoopToSelectionReductionOpportunity::RedirectToClosestMergeBlock(
uint32_t original_target_id) { … }
void StructuredLoopToSelectionReductionOpportunity::RedirectEdge(
uint32_t source_id, uint32_t original_target_id, uint32_t new_target_id) { … }
void StructuredLoopToSelectionReductionOpportunity::
AdaptPhiInstructionsForAddedEdge(uint32_t from_id,
opt::BasicBlock* to_block) { … }
void StructuredLoopToSelectionReductionOpportunity::ChangeLoopToSelection() { … }
void StructuredLoopToSelectionReductionOpportunity::FixNonDominatedIdUses() { … }
bool StructuredLoopToSelectionReductionOpportunity::
DefinitionSufficientlyDominatesUse(opt::Instruction* def,
opt::Instruction* use,
uint32_t use_index,
opt::BasicBlock& def_block) { … }
}
}