aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-03-23 08:45:52 +0000
committerDuncan Sands <baldrick@free.fr>2012-03-23 08:45:52 +0000
commite959f7e17f0bb999ab032b1567600d39347e983a (patch)
tree6ff5d67d22e43559d62d04ab1a2bfae29fc708ba /lib
parent01b305f94c663d000e2128c7ea8c0c4e02e9eeb4 (diff)
downloadexternal_llvm-e959f7e17f0bb999ab032b1567600d39347e983a.zip
external_llvm-e959f7e17f0bb999ab032b1567600d39347e983a.tar.gz
external_llvm-e959f7e17f0bb999ab032b1567600d39347e983a.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index ac80c48..8b79d27 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -2001,6 +2001,9 @@ bool GVN::propagateEquality(Value *LHS, Value *RHS, BasicBlock *Root) {
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'.