From 524c48536bc3f7148c28978bdeb3d046382cab2c Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Sun, 12 Feb 2017 23:24:45 +0000 Subject: [PATCH] NewGVN: Reverse order of congruence class elimination to maximize trivial deadness git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294926 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/NewGVN.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 25455c75b4e..ab195e4000c 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -2059,7 +2059,7 @@ void NewGVN::convertDenseToLoadsAndStores( } static void patchReplacementInstruction(Instruction *I, Value *Repl) { - auto *ReplInst = dyn_cast(Repl); + auto *ReplInst = dyn_cast(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 PossibleDeadStores; -- 2.50.1