mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-26 07:56:43 +00:00
NewGVN: Change a bunch of densemap find_or_creates to lookups, since they should not be creating new entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d97514d79a
commit
c110f9b676
@ -1038,16 +1038,16 @@ void NewGVN::markUsersTouched(Value *V) {
|
||||
// Now mark the users as touched.
|
||||
for (auto *User : V->users()) {
|
||||
assert(isa<Instruction>(User) && "Use of value not within an instruction?");
|
||||
TouchedInstructions.set(InstrDFS[User]);
|
||||
TouchedInstructions.set(InstrDFS.lookup(User));
|
||||
}
|
||||
}
|
||||
|
||||
void NewGVN::markMemoryUsersTouched(MemoryAccess *MA) {
|
||||
for (auto U : MA->users()) {
|
||||
if (auto *MUD = dyn_cast<MemoryUseOrDef>(U))
|
||||
TouchedInstructions.set(InstrDFS[MUD->getMemoryInst()]);
|
||||
TouchedInstructions.set(InstrDFS.lookup(MUD->getMemoryInst()));
|
||||
else
|
||||
TouchedInstructions.set(InstrDFS[U]);
|
||||
TouchedInstructions.set(InstrDFS.lookup(U));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1056,7 +1056,7 @@ void NewGVN::markMemoryUsersTouched(MemoryAccess *MA) {
|
||||
void NewGVN::markLeaderChangeTouched(CongruenceClass *CC) {
|
||||
for (auto M : CC->Members) {
|
||||
if (auto *I = dyn_cast<Instruction>(M))
|
||||
TouchedInstructions.set(InstrDFS[I]);
|
||||
TouchedInstructions.set(InstrDFS.lookup(I));
|
||||
LeaderChanges.insert(M);
|
||||
}
|
||||
}
|
||||
@ -1260,11 +1260,11 @@ void NewGVN::updateReachableEdge(BasicBlock *From, BasicBlock *To) {
|
||||
// they are the only thing that depend on new edges. Anything using their
|
||||
// values will get propagated to if necessary.
|
||||
if (MemoryAccess *MemPhi = MSSA->getMemoryAccess(To))
|
||||
TouchedInstructions.set(InstrDFS[MemPhi]);
|
||||
TouchedInstructions.set(InstrDFS.lookup(MemPhi));
|
||||
|
||||
auto BI = To->begin();
|
||||
while (isa<PHINode>(BI)) {
|
||||
TouchedInstructions.set(InstrDFS[&*BI]);
|
||||
TouchedInstructions.set(InstrDFS.lookup(&*BI));
|
||||
++BI;
|
||||
}
|
||||
}
|
||||
@ -1891,7 +1891,7 @@ void NewGVN::convertDenseToDFSOrdered(
|
||||
VD.Val = D;
|
||||
// If it's an instruction, use the real local dfs number.
|
||||
if (auto *I = dyn_cast<Instruction>(D))
|
||||
VD.LocalNum = InstrDFS[I];
|
||||
VD.LocalNum = InstrDFS.lookup(I);
|
||||
else
|
||||
llvm_unreachable("Should have been an instruction");
|
||||
|
||||
@ -1910,7 +1910,7 @@ void NewGVN::convertDenseToDFSOrdered(
|
||||
VD.LocalNum = InstrDFS.size() + 1;
|
||||
} else {
|
||||
IBlock = I->getParent();
|
||||
VD.LocalNum = InstrDFS[I];
|
||||
VD.LocalNum = InstrDFS.lookup(I);
|
||||
}
|
||||
DomTreeNode *DomNode = DT->getNode(IBlock);
|
||||
VD.DFSIn = DomNode->getDFSNumIn();
|
||||
|
Loading…
x
Reference in New Issue
Block a user