Expunge DomSet from LoadValueNumbering. This is part of the continuing

work on PR1171.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35723 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2007-04-07 04:43:07 +00:00
parent 6116fb1035
commit 46b58f7869

View File

@ -98,7 +98,7 @@ void LoadVN::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
AU.addRequiredTransitive<AliasAnalysis>(); AU.addRequiredTransitive<AliasAnalysis>();
AU.addRequired<ValueNumbering>(); AU.addRequired<ValueNumbering>();
AU.addRequiredTransitive<DominatorSet>(); AU.addRequiredTransitive<ETForest>();
AU.addRequiredTransitive<TargetData>(); AU.addRequiredTransitive<TargetData>();
} }
@ -198,20 +198,20 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
// ANY memory. // ANY memory.
// //
if (MRB == AliasAnalysis::OnlyReadsMemory) { if (MRB == AliasAnalysis::OnlyReadsMemory) {
DominatorSet &DomSetInfo = getAnalysis<DominatorSet>(); ETForest &EF = getAnalysis<ETForest>();
BasicBlock *CIBB = CI->getParent(); BasicBlock *CIBB = CI->getParent();
for (unsigned i = 0; i != IdenticalCalls.size(); ++i) { for (unsigned i = 0; i != IdenticalCalls.size(); ++i) {
CallInst *C = IdenticalCalls[i]; CallInst *C = IdenticalCalls[i];
bool CantEqual = false; bool CantEqual = false;
if (DomSetInfo.dominates(CIBB, C->getParent())) { if (EF.dominates(CIBB, C->getParent())) {
// FIXME: we currently only handle the case where both calls are in the // FIXME: we currently only handle the case where both calls are in the
// same basic block. // same basic block.
if (CIBB != C->getParent()) { if (CIBB != C->getParent()) {
CantEqual = true; CantEqual = true;
} else { } else {
Instruction *First = CI, *Second = C; Instruction *First = CI, *Second = C;
if (!DomSetInfo.dominates(CI, C)) if (!EF.dominates(CI, C))
std::swap(First, Second); std::swap(First, Second);
// Scan the instructions between the calls, checking for stores or // Scan the instructions between the calls, checking for stores or
@ -236,7 +236,7 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
} }
} }
} else if (DomSetInfo.dominates(C->getParent(), CIBB)) { } else if (EF.dominates(C->getParent(), CIBB)) {
// FIXME: We could implement this, but we don't for now. // FIXME: We could implement this, but we don't for now.
CantEqual = true; CantEqual = true;
} else { } else {
@ -374,7 +374,7 @@ void LoadVN::getEqualNumberNodes(Value *V,
} }
// Get dominators. // Get dominators.
DominatorSet &DomSetInfo = getAnalysis<DominatorSet>(); ETForest &EF = getAnalysis<ETForest>();
// TransparentBlocks - For each basic block the load/store is alive across, // TransparentBlocks - For each basic block the load/store is alive across,
// figure out if the pointer is invalidated or not. If it is invalidated, the // figure out if the pointer is invalidated or not. If it is invalidated, the
@ -393,12 +393,12 @@ void LoadVN::getEqualNumberNodes(Value *V,
// Right now we only can handle cases where one load dominates the other. // Right now we only can handle cases where one load dominates the other.
// FIXME: generalize this! // FIXME: generalize this!
BasicBlock *BB1 = I->first, *BB2 = LoadBB; BasicBlock *BB1 = I->first, *BB2 = LoadBB;
if (DomSetInfo.dominates(BB1, BB2)) { if (EF.dominates(BB1, BB2)) {
// The other load dominates LI. If the loaded value is killed entering // The other load dominates LI. If the loaded value is killed entering
// the LoadBB block, we know the load is not live. // the LoadBB block, we know the load is not live.
if (LoadInvalidatedInBBBefore) if (LoadInvalidatedInBBBefore)
CantEqual = true; CantEqual = true;
} else if (DomSetInfo.dominates(BB2, BB1)) { } else if (EF.dominates(BB2, BB1)) {
std::swap(BB1, BB2); // Canonicalize std::swap(BB1, BB2); // Canonicalize
// LI dominates the other load. If the loaded value is killed exiting // LI dominates the other load. If the loaded value is killed exiting
// the LoadBB block, we know the load is not live. // the LoadBB block, we know the load is not live.
@ -480,7 +480,7 @@ void LoadVN::getEqualNumberNodes(Value *V,
for (std::set<BasicBlock*>::iterator I = CandidateStores.begin(), for (std::set<BasicBlock*>::iterator I = CandidateStores.begin(),
E = CandidateStores.end(); I != E; ++I) E = CandidateStores.end(); I != E; ++I)
if (DomSetInfo.dominates(*I, LoadBB)) { if (EF.dominates(*I, LoadBB)) {
BasicBlock *StoreBB = *I; BasicBlock *StoreBB = *I;
// Check to see if the path from the store to the load is transparent // Check to see if the path from the store to the load is transparent