mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-05 14:34:55 +00:00
introduce a typedef, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60272 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f68f310386
commit
25f4b2b7a3
@ -127,10 +127,13 @@ namespace llvm {
|
|||||||
typedef DenseMap<Instruction*, DepResultTy> LocalDepMapType;
|
typedef DenseMap<Instruction*, DepResultTy> LocalDepMapType;
|
||||||
LocalDepMapType LocalDeps;
|
LocalDepMapType LocalDeps;
|
||||||
|
|
||||||
|
typedef DenseMap<BasicBlock*, DepResultTy> NonLocalDepInfo;
|
||||||
|
|
||||||
|
|
||||||
// A map from instructions to their non-local dependencies.
|
// A map from instructions to their non-local dependencies.
|
||||||
typedef DenseMap<Instruction*,
|
typedef DenseMap<Instruction*,
|
||||||
// This is an owning pointer.
|
// This is an owning pointer.
|
||||||
DenseMap<BasicBlock*, DepResultTy>*> NonLocalDepMapType;
|
NonLocalDepInfo*> NonLocalDepMapType;
|
||||||
NonLocalDepMapType NonLocalDeps;
|
NonLocalDepMapType NonLocalDeps;
|
||||||
|
|
||||||
// A reverse mapping from dependencies to the dependees. This is
|
// A reverse mapping from dependencies to the dependees. This is
|
||||||
|
@ -227,10 +227,10 @@ getNonLocalDependency(Instruction *QueryInst,
|
|||||||
MemDepResult> > &Result) {
|
MemDepResult> > &Result) {
|
||||||
assert(getDependency(QueryInst).isNonLocal() &&
|
assert(getDependency(QueryInst).isNonLocal() &&
|
||||||
"getNonLocalDependency should only be used on insts with non-local deps!");
|
"getNonLocalDependency should only be used on insts with non-local deps!");
|
||||||
DenseMap<BasicBlock*, DepResultTy>* &CacheP = NonLocalDeps[QueryInst];
|
NonLocalDepInfo *&CacheP = NonLocalDeps[QueryInst];
|
||||||
if (CacheP == 0) CacheP = new DenseMap<BasicBlock*, DepResultTy>();
|
if (CacheP == 0) CacheP = new NonLocalDepInfo();
|
||||||
|
|
||||||
DenseMap<BasicBlock*, DepResultTy> &Cache = *CacheP;
|
NonLocalDepInfo &Cache = *CacheP;
|
||||||
|
|
||||||
/// DirtyBlocks - This is the set of blocks that need to be recomputed. In
|
/// DirtyBlocks - This is the set of blocks that need to be recomputed. In
|
||||||
/// the cached case, this can happen due to instructions being deleted etc. In
|
/// the cached case, this can happen due to instructions being deleted etc. In
|
||||||
@ -243,8 +243,8 @@ getNonLocalDependency(Instruction *QueryInst,
|
|||||||
// determine what is dirty, seeding our initial DirtyBlocks worklist.
|
// determine what is dirty, seeding our initial DirtyBlocks worklist.
|
||||||
// FIXME: In the "don't need to be updated" case, this is expensive, why not
|
// FIXME: In the "don't need to be updated" case, this is expensive, why not
|
||||||
// have a per-"cache" flag saying it is undirty?
|
// have a per-"cache" flag saying it is undirty?
|
||||||
for (DenseMap<BasicBlock*, DepResultTy>::iterator I = Cache.begin(),
|
for (NonLocalDepInfo::iterator I = Cache.begin(), E = Cache.end();
|
||||||
E = Cache.end(); I != E; ++I)
|
I != E; ++I)
|
||||||
if (I->second.getInt() == Dirty)
|
if (I->second.getInt() == Dirty)
|
||||||
DirtyBlocks.push_back(I->first);
|
DirtyBlocks.push_back(I->first);
|
||||||
|
|
||||||
@ -303,8 +303,7 @@ getNonLocalDependency(Instruction *QueryInst,
|
|||||||
|
|
||||||
|
|
||||||
// Copy the result into the output set.
|
// Copy the result into the output set.
|
||||||
for (DenseMap<BasicBlock*, DepResultTy>::iterator I = Cache.begin(),
|
for (NonLocalDepInfo::iterator I = Cache.begin(), E = Cache.end(); I != E;++I)
|
||||||
E = Cache.end(); I != E; ++I)
|
|
||||||
Result.push_back(std::make_pair(I->first, ConvToResult(I->second)));
|
Result.push_back(std::make_pair(I->first, ConvToResult(I->second)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,9 +315,9 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction *RemInst) {
|
|||||||
// for any cached queries.
|
// for any cached queries.
|
||||||
NonLocalDepMapType::iterator NLDI = NonLocalDeps.find(RemInst);
|
NonLocalDepMapType::iterator NLDI = NonLocalDeps.find(RemInst);
|
||||||
if (NLDI != NonLocalDeps.end()) {
|
if (NLDI != NonLocalDeps.end()) {
|
||||||
DenseMap<BasicBlock*, DepResultTy> &BlockMap = *NLDI->second;
|
NonLocalDepInfo &BlockMap = *NLDI->second;
|
||||||
for (DenseMap<BasicBlock*, DepResultTy>::iterator DI =
|
for (NonLocalDepInfo::iterator DI = BlockMap.begin(), DE = BlockMap.end();
|
||||||
BlockMap.begin(), DE = BlockMap.end(); DI != DE; ++DI)
|
DI != DE; ++DI)
|
||||||
if (Instruction *Inst = DI->second.getPointer())
|
if (Instruction *Inst = DI->second.getPointer())
|
||||||
ReverseNonLocalDeps[Inst].erase(RemInst);
|
ReverseNonLocalDeps[Inst].erase(RemInst);
|
||||||
delete &BlockMap;
|
delete &BlockMap;
|
||||||
@ -389,11 +388,11 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction *RemInst) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
assert(*I != RemInst && "Already removed NonLocalDep info for RemInst");
|
assert(*I != RemInst && "Already removed NonLocalDep info for RemInst");
|
||||||
|
|
||||||
DenseMap<BasicBlock*, DepResultTy> &INLD = *NonLocalDeps[*I];
|
NonLocalDepInfo &INLD = *NonLocalDeps[*I];
|
||||||
assert(&INLD != 0 && "Reverse mapping out of date?");
|
assert(&INLD != 0 && "Reverse mapping out of date?");
|
||||||
|
|
||||||
for (DenseMap<BasicBlock*, DepResultTy>::iterator
|
for (NonLocalDepInfo::iterator DI = INLD.begin(), DE = INLD.end();
|
||||||
DI = INLD.begin(), DE = INLD.end(); DI != DE; ++DI) {
|
DI != DE; ++DI) {
|
||||||
if (DI->second.getPointer() != RemInst) continue;
|
if (DI->second.getPointer() != RemInst) continue;
|
||||||
|
|
||||||
// Convert to a dirty entry for the subsequent instruction.
|
// Convert to a dirty entry for the subsequent instruction.
|
||||||
@ -436,9 +435,9 @@ void MemoryDependenceAnalysis::verifyRemoved(Instruction *D) const {
|
|||||||
for (NonLocalDepMapType::const_iterator I = NonLocalDeps.begin(),
|
for (NonLocalDepMapType::const_iterator I = NonLocalDeps.begin(),
|
||||||
E = NonLocalDeps.end(); I != E; ++I) {
|
E = NonLocalDeps.end(); I != E; ++I) {
|
||||||
assert(I->first != D && "Inst occurs in data structures");
|
assert(I->first != D && "Inst occurs in data structures");
|
||||||
DenseMap<BasicBlock*, DepResultTy> &INLD = *I->second;
|
NonLocalDepInfo &INLD = *I->second;
|
||||||
for (DenseMap<BasicBlock*, DepResultTy>::iterator II = INLD.begin(),
|
for (NonLocalDepInfo::iterator II = INLD.begin(), EE = INLD.end();
|
||||||
EE = INLD.end(); II != EE; ++II)
|
II != EE; ++II)
|
||||||
assert(II->second.getPointer() != D && "Inst occurs in data structures");
|
assert(II->second.getPointer() != D && "Inst occurs in data structures");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user