| 40 | constexpr uint32_t ControlDependenceAnalysis::kPseudoEntryBlock; |
| 41 | |
| 42 | uint32_t ControlDependence::GetConditionID(const CFG& cfg) const { |
| 43 | if (source_bb_id() == 0) { |
| 44 | // Entry dependence; return 0. |
| 45 | return 0; |
| 46 | } |
| 47 | const BasicBlock* source_bb = cfg.block(source_bb_id()); |
| 48 | const Instruction* branch = source_bb->terminator(); |
| 49 | assert((branch->opcode() == spv::Op::OpBranchConditional || |
| 50 | branch->opcode() == spv::Op::OpSwitch) && |
| 51 | "invalid control dependence; last instruction must be conditional " |
| 52 | "branch or switch"); |
| 53 | return branch->GetSingleWordInOperand(0); |
| 54 | } |
| 55 | |
| 56 | bool ControlDependence::operator<(const ControlDependence& other) const { |
| 57 | return std::tie(source_bb_id_, target_bb_id_, branch_target_bb_id_) < |
no test coverage detected