| 229 | } |
| 230 | |
| 231 | bool 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 | |
| 243 | bool Function::IsRecursive() const { |
| 244 | IRContext* ctx = blocks_.front()->GetLabel()->context(); |