mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 06:29:59 +00:00
Remove explicit passing of SCC's around as objects.
llvm-svn: 8267
This commit is contained in:
parent
d96c9204b6
commit
05498bc768
@ -15,7 +15,6 @@
|
||||
|
||||
#include "llvm/Analysis/DependenceGraph.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "Support/TarjanSCCIterator.h"
|
||||
#include "Support/hash_map"
|
||||
|
||||
class ModRefTable;
|
||||
@ -43,7 +42,8 @@ class MemoryDepAnalysis : public Pass {
|
||||
const FunctionModRefInfo* funcModRef;
|
||||
|
||||
/// Internal routine that processes each SCC of the CFG.
|
||||
void ProcessSCC(SCC<Function*>& S, ModRefTable& ModRefAfter);
|
||||
void ProcessSCC(std::vector<BasicBlock*> &SCC, ModRefTable& ModRefAfter,
|
||||
bool HasLoop);
|
||||
|
||||
friend class PgmDependenceGraph;
|
||||
|
||||
|
@ -271,14 +271,12 @@ void MemoryDepAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
/// }
|
||||
///
|
||||
///
|
||||
void MemoryDepAnalysis::ProcessSCC(SCC<Function*>& S,
|
||||
ModRefTable& ModRefAfter) {
|
||||
void MemoryDepAnalysis::ProcessSCC(std::vector<BasicBlock*> &S,
|
||||
ModRefTable& ModRefAfter, bool hasLoop) {
|
||||
ModRefTable ModRefCurrent;
|
||||
ModRefTable::ModRefMap& mapCurrent = ModRefCurrent.modRefMap;
|
||||
ModRefTable::ModRefMap& mapAfter = ModRefAfter.modRefMap;
|
||||
|
||||
bool hasLoop = S.HasLoop();
|
||||
|
||||
// Builder class fills out a ModRefTable one instruction at a time.
|
||||
// To use it, we just invoke it's visit function for each basic block:
|
||||
//
|
||||
@ -290,7 +288,8 @@ void MemoryDepAnalysis::ProcessSCC(SCC<Function*>& S,
|
||||
// : Add I to ModRefCurrent.users if it uses any node
|
||||
//
|
||||
ModRefInfoBuilder builder(*funcGraph, *funcModRef, ModRefCurrent);
|
||||
for (SCC<Function*>::iterator BI=S.begin(), BE=S.end(); BI != BE; ++BI)
|
||||
for (std::vector<BasicBlock*>::iterator BI = S.begin(), BE = S.end();
|
||||
BI != BE; ++BI)
|
||||
// Note: BBs in the SCC<> created by TarjanSCCIterator are in postorder.
|
||||
for (BasicBlock::reverse_iterator II=(*BI)->rbegin(), IE=(*BI)->rend();
|
||||
II != IE; ++II)
|
||||
@ -442,7 +441,7 @@ bool MemoryDepAnalysis::runOnFunction(Function &F) {
|
||||
SCC<Function*>* nextSCC;
|
||||
for (TarjanSCC_iterator<Function*> I = tarj_begin(&F), E = tarj_end(&F);
|
||||
I != E; ++I)
|
||||
ProcessSCC(*I, ModRefAfter);
|
||||
ProcessSCC(*I, ModRefAfter, (*I).HasLoop());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user