summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-02-12 23:24:45 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-02-12 23:24:45 +0000
commit4d54796f87a803b54228eb128c4ac641a37d1e8a (patch)
treebe175b63caf735d2035737ff0ed5c072d0599a59 /llvm
parent508a1dec94584826e0e21eae8e8be5b15e2f8edb (diff)
downloadbcm5719-llvm-4d54796f87a803b54228eb128c4ac641a37d1e8a.tar.gz
bcm5719-llvm-4d54796f87a803b54228eb128c4ac641a37d1e8a.zip
NewGVN: Reverse order of congruence class elimination to maximize trivial deadness
llvm-svn: 294926
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index 25455c75b4e..ab195e4000c 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -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;
OpenPOWER on IntegriCloud