[llvm-commits] [llvm] r153323 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Duncan Sands baldrick at free.fr
Fri Mar 23 01:45:53 PDT 2012


Author: baldrick
Date: Fri Mar 23 03:45:52 2012
New Revision: 153323

URL: http://llvm.org/viewvc/llvm-project?rev=153323&view=rev
Log:
When propagating equalities, eg replacing A with B in every basic block
dominated by Root, check that B is available throughout the scope.  This
is obviously true (famous last words?) given the current logic, but the
check may be helpful if more complicated reasoning is added one day.

Modified:
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=153323&r1=153322&r2=153323&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Mar 23 03:45:52 2012
@@ -2001,6 +2001,9 @@
       LVN = RVN;
     }
   }
+  assert((!isa<Instruction>(RHS) ||
+          DT->properlyDominates(cast<Instruction>(RHS)->getParent(), Root)) &&
+         "Instruction doesn't dominate scope!");
 
   // If value numbering later deduces that an instruction in the scope is equal
   // to 'LHS' then ensure it will be turned into 'RHS'.





More information about the llvm-commits mailing list