Index: polly/trunk/include/polly/ScopDetection.h =================================================================== --- polly/trunk/include/polly/ScopDetection.h +++ polly/trunk/include/polly/ScopDetection.h @@ -48,6 +48,7 @@ #define POLLY_SCOP_DETECTION_H #include "llvm/Pass.h" +#include "llvm/ADT/SetVector.h" #include "llvm/Analysis/AliasSetTracker.h" #include "polly/ScopDetectionDiagnostic.h" @@ -118,6 +119,10 @@ /// @brief Pass to detect the maximal static control parts (Scops) of a /// function. class ScopDetection : public FunctionPass { +public: + typedef SetVector RegionSet; + +private: //===--------------------------------------------------------------------===// ScopDetection(const ScopDetection &) LLVM_DELETED_FUNCTION; const ScopDetection &operator=(const ScopDetection &) LLVM_DELETED_FUNCTION; @@ -155,7 +160,6 @@ }; // Remember the valid regions - typedef std::set RegionSet; RegionSet ValidRegions; // Remember a list of errors for every region. Index: polly/trunk/lib/Analysis/ScopDetection.cpp =================================================================== --- polly/trunk/lib/Analysis/ScopDetection.cpp +++ polly/trunk/lib/Analysis/ScopDetection.cpp @@ -691,13 +691,13 @@ // but do not recurse further if the first child has been found. // // Return the number of regions erased from Regs. -static unsigned eraseAllChildren(std::set &Regs, +static unsigned eraseAllChildren(ScopDetection::RegionSet &Regs, const Region &R) { unsigned Count = 0; for (auto &SubRegion : R) { - if (Regs.find(SubRegion.get()) != Regs.end()) { + if (Regs.count(SubRegion.get())) { ++Count; - Regs.erase(SubRegion.get()); + Regs.remove(SubRegion.get()); } else { Count += eraseAllChildren(Regs, *SubRegion); } @@ -740,7 +740,7 @@ // Skip invalid regions. Regions may become invalid, if they are element of // an already expanded region. - if (ValidRegions.find(CurrentRegion) == ValidRegions.end()) + if (!ValidRegions.count(CurrentRegion)) continue; Region *ExpandedR = expandRegion(*CurrentRegion); @@ -750,7 +750,7 @@ R.addSubRegion(ExpandedR, true); ValidRegions.insert(ExpandedR); - ValidRegions.erase(CurrentRegion); + ValidRegions.remove(CurrentRegion); // Erase all (direct and indirect) children of ExpandedR from the valid // regions and update the number of valid regions. Index: polly/trunk/test/ScopInfo/multi-scop.ll =================================================================== --- polly/trunk/test/ScopInfo/multi-scop.ll +++ polly/trunk/test/ScopInfo/multi-scop.ll @@ -33,6 +33,6 @@ ret void } -; CHECK: Valid Region for Scop: for.body81 => for.end170 ; CHECK: Valid Region for Scop: entry.split => for.end +; CHECK: Valid Region for Scop: for.body81 => for.end170