diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 015c67a0d22..54e5fc0f28e 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -92,7 +92,7 @@ class SCCP : public FunctionPass, public InstVisitor { std::set BBExecutable;// The basic blocks that are executable std::map ValueState; // The state each value is in... - std::set InstWorkList;// The instruction work list + std::vector InstWorkList;// The instruction work list std::vector BBWorkList; // The BasicBlock work list public: @@ -124,7 +124,7 @@ private: DEBUG_SCCP(cerr << "markConstant: " << V << " = " << I); if (ValueState[I].markConstant(V)) { - InstWorkList.insert(I); + InstWorkList.push_back(I); return true; } return false; @@ -138,7 +138,7 @@ private: if (ValueState[V].markOverdefined()) { if (Instruction *I = dyn_cast(V)) { DEBUG_SCCP(cerr << "markOverdefined: " << V); - InstWorkList.insert(I); // Only instructions go on the work list + InstWorkList.push_back(I); // Only instructions go on the work list } return true; } @@ -251,8 +251,8 @@ bool SCCP::runOnFunction(Function *F) { while (!BBWorkList.empty() || !InstWorkList.empty()) { // Process the instruction work list... while (!InstWorkList.empty()) { - Instruction *I = *InstWorkList.begin(); - InstWorkList.erase(InstWorkList.begin()); + Instruction *I = InstWorkList.back(); + InstWorkList.pop_back(); DEBUG_SCCP(cerr << "\nPopped off I-WL: " << I);