| 292 | } |
| 293 | |
| 294 | bool CodeSinkingPass::IntersectsPath(uint32_t start, uint32_t end, |
| 295 | const std::unordered_set<uint32_t>& set) { |
| 296 | std::vector<uint32_t> worklist; |
| 297 | worklist.push_back(start); |
| 298 | std::unordered_set<uint32_t> already_done; |
| 299 | already_done.insert(start); |
| 300 | |
| 301 | while (!worklist.empty()) { |
| 302 | BasicBlock* bb = context()->get_instr_block(worklist.back()); |
| 303 | worklist.pop_back(); |
| 304 | |
| 305 | if (bb->id() == end) { |
| 306 | continue; |
| 307 | } |
| 308 | |
| 309 | if (set.count(bb->id())) { |
| 310 | return true; |
| 311 | } |
| 312 | |
| 313 | bb->ForEachSuccessorLabel([&already_done, &worklist](uint32_t* succ_bb_id) { |
| 314 | if (already_done.insert(*succ_bb_id).second) { |
| 315 | worklist.push_back(*succ_bb_id); |
| 316 | } |
| 317 | }); |
| 318 | } |
| 319 | return false; |
| 320 | } |
| 321 | |
| 322 | // namespace opt |
| 323 |
nothing calls this directly
no test coverage detected