diff --git a/hpvm/projects/hetero-c++/lib/HCCVerifier.cpp b/hpvm/projects/hetero-c++/lib/HCCVerifier.cpp index b06409fabe9a7d69e702a9551ee00732cf72b571..0e4cd756b3853e43f26c82bcb474c6b37a36f89b 100644 --- a/hpvm/projects/hetero-c++/lib/HCCVerifier.cpp +++ b/hpvm/projects/hetero-c++/lib/HCCVerifier.cpp @@ -728,9 +728,14 @@ bool HCCVerifier::verifyUses(RegionTree& region, std::set<Value*> inputs, extraInstructions = true; } else { // Add the basic blocks we can reach from this branch to the - // list to explore (if we haven't already) + // list to explore (if we haven't already). We also don't add + // back-edges since they should already have been processed + // (and if not, only because we skipped over the body because + // it was a parallel loop) for (BasicBlock* succ : branch->successors()) { - if (reached.find(succ) == reached.end()) { + if (reached.find(succ) == reached.end() + && (succ != branch->getParent() + && !DTCache.dominates(succ, branch->getParent()))) { toSearch.insert(succ); } }