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

Method SetPreHeaderBlock

source/opt/loop_descriptor.cpp:320–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320void Loop::SetPreHeaderBlock(BasicBlock* preheader) {
321 if (preheader) {
322 assert(!IsInsideLoop(preheader) && "The preheader block is in the loop");
323 assert(preheader->tail()->opcode() == spv::Op::OpBranch &&
324 "The preheader block does not unconditionally branch to the header "
325 "block");
326 assert(preheader->tail()->GetSingleWordOperand(0) ==
327 GetHeaderBlock()->id() &&
328 "The preheader block does not unconditionally branch to the header "
329 "block");
330 }
331 loop_preheader_ = preheader;
332}
333
334BasicBlock* Loop::FindLatchBlock() {
335 CFG* cfg = context_->cfg();

Callers 7

ProtectLoopMethod · 0.80
SplitLoopHeaderMethod · 0.80
PopulateLoopDescMethod · 0.80
SplitLoopMethod · 0.80
PerformUnswitchMethod · 0.80

Calls 4

GetSingleWordOperandMethod · 0.80
opcodeMethod · 0.45
tailMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected