MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / UsedInContinueOrConditionBlock

Method UsedInContinueOrConditionBlock

source/opt/loop_fusion.cpp:83–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81} // namespace
82
83bool LoopFusion::UsedInContinueOrConditionBlock(Instruction* phi_instruction,
84 Loop* loop) {
85 auto condition_block = loop->FindConditionBlock()->id();
86 auto continue_block = loop->GetContinueBlock()->id();
87 auto not_used = context_->get_def_use_mgr()->WhileEachUser(
88 phi_instruction,
89 [this, condition_block, continue_block](Instruction* instruction) {
90 auto block_id = context_->get_instr_block(instruction)->id();
91 return block_id != condition_block && block_id != continue_block;
92 });
93
94 return !not_used;
95}
96
97void LoopFusion::RemoveIfNotUsedContinueOrConditionBlock(
98 std::vector<Instruction*>* instructions, Loop* loop) {

Callers

nothing calls this directly

Calls 6

FindConditionBlockMethod · 0.80
GetContinueBlockMethod · 0.80
WhileEachUserMethod · 0.80
get_instr_blockMethod · 0.80
idMethod · 0.45
get_def_use_mgrMethod · 0.45

Tested by

no test coverage detected