MemorySSA: Fix and use optimized_def_chain

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299566 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Berlin 2017-04-05 17:26:25 +00:00
parent 3282f4edba
commit 5def10a6fc
2 changed files with 2 additions and 2 deletions

View File

@ -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) {}

View File

@ -1986,7 +1986,7 @@ bool NewGVN::singleReachablePHIPath(const MemoryAccess *First,
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))