mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Change MemDep::getNonLocalDependency to return its results as
a smallvector instead of a DenseMap. This speeds up GVN by 5% on 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -104,8 +104,10 @@ getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt,
|
||||
/// This method assumes the instruction returns a "nonlocal" dependency
|
||||
/// within its own block.
|
||||
///
|
||||
void MemoryDependenceAnalysis::getNonLocalDependency(Instruction *QueryInst,
|
||||
DenseMap<BasicBlock*, MemDepResult> &Result) {
|
||||
void MemoryDependenceAnalysis::
|
||||
getNonLocalDependency(Instruction *QueryInst,
|
||||
SmallVectorImpl<std::pair<BasicBlock*,
|
||||
MemDepResult> > &Result) {
|
||||
assert(getDependency(QueryInst).isNonLocal() &&
|
||||
"getNonLocalDependency should only be used on insts with non-local deps!");
|
||||
DenseMap<BasicBlock*, DepResultTy> &Cache = NonLocalDeps[QueryInst];
|
||||
@@ -128,10 +130,7 @@ void MemoryDependenceAnalysis::getNonLocalDependency(Instruction *QueryInst,
|
||||
} else {
|
||||
// Seed DirtyBlocks with each of the preds of QueryInst's block.
|
||||
BasicBlock *QueryBB = QueryInst->getParent();
|
||||
// FIXME: use range insertion/append.
|
||||
for (pred_iterator PI = pred_begin(QueryBB), E = pred_end(QueryBB);
|
||||
PI != E; ++PI)
|
||||
DirtyBlocks.push_back(*PI);
|
||||
DirtyBlocks.append(pred_begin(QueryBB), pred_end(QueryBB));
|
||||
NumUncacheNonlocal++;
|
||||
}
|
||||
|
||||
@@ -173,7 +172,7 @@ void MemoryDependenceAnalysis::getNonLocalDependency(Instruction *QueryInst,
|
||||
// Copy the result into the output set.
|
||||
for (DenseMap<BasicBlock*, DepResultTy>::iterator I = Cache.begin(),
|
||||
E = Cache.end(); I != E; ++I)
|
||||
Result[I->first] = ConvToResult(I->second);
|
||||
Result.push_back(std::make_pair(I->first, ConvToResult(I->second)));
|
||||
}
|
||||
|
||||
/// getDependency - Return the instruction on which a memory operation
|
||||
|
Reference in New Issue
Block a user