diff options
author | Alina Sbirlea <asbirlea@google.com> | 2019-05-02 23:41:58 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2019-05-02 23:41:58 +0000 |
commit | 0363c3b8bbf1c72e7a7da65444a8095cdc63f32d (patch) | |
tree | 07164a49b71070fb5d30a572dd065825985b2f97 /llvm/lib/Analysis/MemorySSA.cpp | |
parent | f7d3048e5b90c9d71ea462a721efce360260fd60 (diff) | |
download | bcm5719-llvm-0363c3b8bbf1c72e7a7da65444a8095cdc63f32d.tar.gz bcm5719-llvm-0363c3b8bbf1c72e7a7da65444a8095cdc63f32d.zip |
[MemorySSA] Check that block is reachable when adding phis.
Summary:
Originally the insertDef method was only used when building MemorySSA, and was limiting the number of Phi nodes that it created.
Now it's used for updates as well, and it can create additional Phis needed for correctness.
Make sure no Phis are created in unreachable blocks (condition met during MSSA build), otherwise the renamePass will find a null DTNode.
Resolves PR41640.
Reviewers: george.burgess.iv
Subscribers: jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61410
llvm-svn: 359845
Diffstat (limited to 'llvm/lib/Analysis/MemorySSA.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemorySSA.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index bdaa26409dd..17f5d9b9f0a 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -1125,6 +1125,8 @@ MemoryAccess *MemorySSA::renameBlock(BasicBlock *BB, MemoryAccess *IncomingVal, void MemorySSA::renamePass(DomTreeNode *Root, MemoryAccess *IncomingVal, SmallPtrSetImpl<BasicBlock *> &Visited, bool SkipVisited, bool RenameAllUses) { + assert(Root && "Trying to rename accesses in an unreachable block"); + SmallVector<RenamePassData, 32> WorkStack; // Skip everything if we already renamed this block and we are skipping. // Note: You can't sink this into the if, because we need it to occur |