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

Method SetLatchBlock

source/opt/loop_descriptor.cpp:293–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void Loop::SetLatchBlock(BasicBlock* latch) {
294#ifndef NDEBUG
295 assert(latch->GetParent() && "The basic block does not belong to a function");
296
297 const auto* const_latch = latch;
298 const_latch->ForEachSuccessorLabel([this](uint32_t id) {
299 assert((!IsInsideLoop(id) || id == GetHeaderBlock()->id()) &&
300 "A predecessor of the continue block does not belong to the loop");
301 });
302#endif // NDEBUG
303 assert(IsInsideLoop(latch) && "The continue block is not in the loop");
304
305 SetLatchBlockImpl(latch);
306}
307
308void Loop::SetMergeBlock(BasicBlock* merge) {
309#ifndef NDEBUG

Callers 2

PopulateLoopDescMethod · 0.80
DuplicateLoopMethod · 0.80

Calls 3

ForEachSuccessorLabelMethod · 0.80
GetParentMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected