[MemorySSA] Pass DT to the upward iterator for proper PhiTranslation.
authorAlina Sbirlea <asbirlea@google.com>
Wed, 29 Apr 2020 05:57:19 +0000 (22:57 -0700)
committerAlina Sbirlea <asbirlea@google.com>
Wed, 29 Apr 2020 21:28:31 +0000 (14:28 -0700)
commit161ccfe5bad52aba7518034cea4814aea0906c69
treec5ec70ad88825547057534e2cbdf844c4072c2de
parent7ef15c869a551084a111a718e897954cad6ddcde
[MemorySSA] Pass DT to the upward iterator for proper PhiTranslation.

Summary:
A valid DominatorTree is needed to do PhiTranslation.
Before this patch, a MemoryUse could be optimized to an access outside a loop, while the address it loads from is modified in the loop.
This can lead to a miscompile.

Reviewers: george.burgess.iv

Subscribers: Prazek, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79068
llvm/include/llvm/Analysis/MemorySSA.h
llvm/lib/Analysis/MemorySSA.cpp
llvm/test/Analysis/MemorySSA/phi-translation.ll