diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-01 16:42:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-01 16:42:16 +0000 |
commit | aa9214524d5935dd9b1b264d99d90f8b3086c106 (patch) | |
tree | 44cc54749aa3a6ae87f9741ca9caf34c18924627 /lib/Analysis/DataStructure | |
parent | 01112bd08adde19947c538bd3d70c9e33cc0e81f (diff) | |
download | external_llvm-aa9214524d5935dd9b1b264d99d90f8b3086c106.zip external_llvm-aa9214524d5935dd9b1b264d99d90f8b3086c106.tar.gz external_llvm-aa9214524d5935dd9b1b264d99d90f8b3086c106.tar.bz2 |
Minor cleanups
Do not #include Parallelize.h, it's just a subset of Cilkifier.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8285 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r-- | lib/Analysis/DataStructure/Parallelize.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/lib/Analysis/DataStructure/Parallelize.cpp b/lib/Analysis/DataStructure/Parallelize.cpp index 81a5252..35adbe2 100644 --- a/lib/Analysis/DataStructure/Parallelize.cpp +++ b/lib/Analysis/DataStructure/Parallelize.cpp @@ -1,4 +1,4 @@ -//===- Parallelize.cpp - Auto parallelization using DS Graphs ---*- C++ -*-===// +//===- Parallelize.cpp - Auto parallelization using DS Graphs -------------===// // // This file implements a pass that automatically parallelizes a program, // using the Cilk multi-threaded runtime system to execute parallel code. @@ -28,19 +28,16 @@ // -- Excessive overhead at "spawned" function calls, which has no benefit // once all threads are busy (especially common when the degree of // parallelism is low). +// //===----------------------------------------------------------------------===// - -#include "llvm/Transforms/Parallelize.h" #include "llvm/Transforms/Utils/DemoteRegToStack.h" #include "llvm/Analysis/PgmDependenceGraph.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/DataStructure.h" #include "llvm/Analysis/DSGraph.h" #include "llvm/Module.h" -#include "llvm/Function.h" -#include "llvm/iOther.h" -#include "llvm/iPHINode.h" +#include "llvm/Instructions.h" #include "llvm/iTerminators.h" #include "llvm/DerivedTypes.h" #include "llvm/Support/InstVisitor.h" @@ -49,8 +46,6 @@ #include "Support/STLExtras.h" #include "Support/hash_set" #include "Support/hash_map" -#include <vector> -#include <stack> #include <functional> #include <algorithm> @@ -221,14 +216,14 @@ void Cilkifier::visitCallInst(CallInst& CI) // Now find all outgoing SSA dependences to the eventual non-Phi users of // the call value (i.e., direct users that are not phis, and for any // user that is a Phi, direct non-Phi users of that Phi, and recursively). - std::stack<const PHINode*> phiUsers; + std::vector<const PHINode*> phiUsers; hash_set<const PHINode*> phisSeen; // ensures we don't visit a phi twice for (Value::use_iterator UI=CI.use_begin(), UE=CI.use_end(); UI != UE; ++UI) if (const PHINode* phiUser = dyn_cast<PHINode>(*UI)) { if (phisSeen.find(phiUser) == phisSeen.end()) { - phiUsers.push(phiUser); + phiUsers.push_back(phiUser); phisSeen.insert(phiUser); } } @@ -237,16 +232,16 @@ void Cilkifier::visitCallInst(CallInst& CI) // Now we've found the non-Phi users and immediate phi users. // Recursively walk the phi users and add their non-phi users. - for (const PHINode* phiUser; !phiUsers.empty(); phiUsers.pop()) + for (const PHINode* phiUser; !phiUsers.empty(); phiUsers.pop_back()) { - phiUser = phiUsers.top(); + phiUser = phiUsers.back(); for (Value::use_const_iterator UI=phiUser->use_begin(), UE=phiUser->use_end(); UI != UE; ++UI) if (const PHINode* pn = dyn_cast<PHINode>(*UI)) { if (phisSeen.find(pn) == phisSeen.end()) { - phiUsers.push(pn); + phiUsers.push_back(pn); phisSeen.insert(pn); } } |