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

Method HasEarlyReturn

source/opt/function.cpp:231–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231bool Function::HasEarlyReturn() const {
232 auto post_dominator_analysis =
233 blocks_.front()->GetLabel()->context()->GetPostDominatorAnalysis(this);
234 for (auto& block : blocks_) {
235 if (spvOpcodeIsReturn(block->tail()->opcode()) &&
236 !post_dominator_analysis->Dominates(block.get(), entry().get())) {
237 return true;
238 }
239 }
240 return false;
241}
242
243bool Function::IsRecursive() const {
244 IRContext* ctx = blocks_.front()->GetLabel()->context();

Callers 3

IsSuitableForInliningMethod · 0.80
ApplyMethod · 0.80
TESTFunction · 0.80

Calls 8

spvOpcodeIsReturnFunction · 0.85
frontMethod · 0.80
getMethod · 0.80
contextMethod · 0.45
opcodeMethod · 0.45
tailMethod · 0.45
DominatesMethod · 0.45

Tested by 1

TESTFunction · 0.64