mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
restructure the top level non-local ptr dep query to handle
the first block of a query specially. This makes the "complete query caching" subsystem more effective, avoiding predecessor queries. This speeds up GVN another 4%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9863c3f507
commit
6563371bad
@ -490,12 +490,8 @@ getNonLocalPointerDependency(Value *Pointer, bool isLoad, BasicBlock *FromBB,
|
|||||||
|
|
||||||
// While we have blocks to analyze, get their values.
|
// While we have blocks to analyze, get their values.
|
||||||
SmallPtrSet<BasicBlock*, 64> Visited;
|
SmallPtrSet<BasicBlock*, 64> Visited;
|
||||||
|
getNonLocalPointerDepFromBB(Pointer, PointeeSize, isLoad, FromBB,
|
||||||
for (BasicBlock **PI = PredCache->GetPreds(FromBB); *PI; ++PI) {
|
Result, Visited);
|
||||||
// TODO: PHI TRANSLATE.
|
|
||||||
getNonLocalPointerDepFromBB(Pointer, PointeeSize, isLoad, *PI,
|
|
||||||
Result, Visited);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// GetNonLocalInfoForBlock - Compute the memdep value for BB with
|
/// GetNonLocalInfoForBlock - Compute the memdep value for BB with
|
||||||
@ -611,23 +607,34 @@ getNonLocalPointerDepFromBB(Value *Pointer, uint64_t PointeeSize,
|
|||||||
// revisit blocks after we insert info for them.
|
// revisit blocks after we insert info for them.
|
||||||
unsigned NumSortedEntries = Cache->size();
|
unsigned NumSortedEntries = Cache->size();
|
||||||
|
|
||||||
|
// SkipFirstBlock - If this is the very first block that we're processing, we
|
||||||
|
// don't want to skip or thing about its body, because the client was supposed
|
||||||
|
// to do a local dependence query. Instead, just start processing it by
|
||||||
|
// adding its predecessors to the worklist and iterating.
|
||||||
|
bool SkipFirstBlock = Visited.empty();
|
||||||
|
|
||||||
while (!Worklist.empty()) {
|
while (!Worklist.empty()) {
|
||||||
BasicBlock *BB = Worklist.pop_back_val();
|
BasicBlock *BB = Worklist.pop_back_val();
|
||||||
|
|
||||||
// Analyze the dependency of *Pointer in FromBB. See if we already have
|
// Skip the first block if we have it.
|
||||||
// been here.
|
if (SkipFirstBlock) {
|
||||||
if (!Visited.insert(BB))
|
SkipFirstBlock = false;
|
||||||
continue;
|
} else {
|
||||||
|
// Analyze the dependency of *Pointer in FromBB. See if we already have
|
||||||
|
// been here.
|
||||||
|
if (!Visited.insert(BB))
|
||||||
|
continue;
|
||||||
|
|
||||||
// Get the dependency info for Pointer in BB. If we have cached
|
// Get the dependency info for Pointer in BB. If we have cached
|
||||||
// information, we will use it, otherwise we compute it.
|
// information, we will use it, otherwise we compute it.
|
||||||
MemDepResult Dep = GetNonLocalInfoForBlock(Pointer, PointeeSize, isLoad,
|
MemDepResult Dep = GetNonLocalInfoForBlock(Pointer, PointeeSize, isLoad,
|
||||||
BB, Cache, NumSortedEntries);
|
BB, Cache, NumSortedEntries);
|
||||||
|
|
||||||
// If we got a Def or Clobber, add this to the list of results.
|
// If we got a Def or Clobber, add this to the list of results.
|
||||||
if (!Dep.isNonLocal()) {
|
if (!Dep.isNonLocal()) {
|
||||||
Result.push_back(NonLocalDepEntry(BB, Dep));
|
Result.push_back(NonLocalDepEntry(BB, Dep));
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, we have to process all the predecessors of this block to scan
|
// Otherwise, we have to process all the predecessors of this block to scan
|
||||||
|
Loading…
x
Reference in New Issue
Block a user