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

Function BlockIsInLoopContinueConstruct

source/fuzz/fuzzer_util.cpp:262–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262bool BlockIsInLoopContinueConstruct(opt::IRContext* context, uint32_t block_id,
263 uint32_t maybe_loop_header_id) {
264 // We deem a block to be part of a loop's continue construct if the loop's
265 // continue target dominates the block.
266 auto containing_construct_block = context->cfg()->block(maybe_loop_header_id);
267 if (containing_construct_block->IsLoopHeader()) {
268 auto continue_target = containing_construct_block->ContinueBlockId();
269 if (context->GetDominatorAnalysis(containing_construct_block->GetParent())
270 ->Dominates(continue_target, block_id)) {
271 return true;
272 }
273 }
274 return false;
275}
276
277opt::BasicBlock::iterator GetIteratorForInstruction(
278 opt::BasicBlock* block, const opt::Instruction* inst) {

Callers 2

IsApplicableMethod · 0.85

Calls 7

IsLoopHeaderMethod · 0.80
ContinueBlockIdMethod · 0.80
GetDominatorAnalysisMethod · 0.80
blockMethod · 0.45
cfgMethod · 0.45
DominatesMethod · 0.45
GetParentMethod · 0.45

Tested by

no test coverage detected