[llvm] r299566 - MemorySSA: Fix and use optimized_def_chain
Daniel Berlin via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 10:26:25 PDT 2017
Author: dannyb
Date: Wed Apr 5 12:26:25 2017
New Revision: 299566
URL: http://llvm.org/viewvc/llvm-project?rev=299566&view=rev
Log:
MemorySSA: Fix and use optimized_def_chain
Modified:
llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
Modified: llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h?rev=299566&r1=299565&r2=299566&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h Wed Apr 5 12:26:25 2017
@@ -1108,7 +1108,7 @@ upward_defs(const MemoryAccessPair &Pair
/// thing that would clobber the same memory is, you want the optimized chain.
template <class T, bool UseOptimizedChain = false>
struct def_chain_iterator
- : public iterator_facade_base<def_chain_iterator<T>,
+ : public iterator_facade_base<def_chain_iterator<T, UseOptimizedChain>,
std::forward_iterator_tag, MemoryAccess *> {
def_chain_iterator() : MA(nullptr) {}
def_chain_iterator(T MA) : MA(MA) {}
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=299566&r1=299565&r2=299566&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Wed Apr 5 12:26:25 2017
@@ -1986,7 +1986,7 @@ bool NewGVN::singleReachablePHIPath(cons
if (MSSA->isLiveOnEntryDef(First))
return false;
const auto *EndDef = First;
- for (auto *ChainDef : def_chain(First)) {
+ for (auto *ChainDef : optimized_def_chain(First)) {
if (ChainDef == Second)
return true;
if (MSSA->isLiveOnEntryDef(ChainDef))
More information about the llvm-commits
mailing list