diff options
author | Duncan Sands <baldrick@free.fr> | 2012-03-23 08:45:52 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2012-03-23 08:45:52 +0000 |
commit | a11ef6e4ea539d839c4c7791fbeb82753ab9ad38 (patch) | |
tree | 5aa8a321eef526103c7e35431766b5a63092047e /llvm/lib | |
parent | 8f897dc88bc99a3aecbd1f5720a5d1da771d1b67 (diff) | |
download | bcm5719-llvm-a11ef6e4ea539d839c4c7791fbeb82753ab9ad38.tar.gz bcm5719-llvm-a11ef6e4ea539d839c4c7791fbeb82753ab9ad38.zip |
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.
llvm-svn: 153323
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index ac80c489f96..8b79d27b952 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/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'. |