NewGVN: Reverse order of congruence class elimination to maximize trivial deadness

llvm-svn: 294926
This commit is contained in:
Daniel Berlin 2017-02-12 23:24:45 +00:00
parent 508a1dec94
commit 4d54796f87
1 changed files with 2 additions and 2 deletions

View File

@ -2059,7 +2059,7 @@ void NewGVN::convertDenseToLoadsAndStores(
}
static void patchReplacementInstruction(Instruction *I, Value *Repl) {
auto *ReplInst = dyn_cast<Instruction>(Repl);
auto *ReplInst = dyn_cast<Instruction>(Repl);
if (!ReplInst)
return;
@ -2220,7 +2220,7 @@ bool NewGVN::eliminateInstructions(Function &F) {
}
}
for (CongruenceClass *CC : CongruenceClasses) {
for (CongruenceClass *CC : reverse(CongruenceClasses)) {
// Track the equivalent store info so we can decide whether to try
// dead store elimination.
SmallVector<ValueDFS, 8> PossibleDeadStores;