diff options
author | Alina Sbirlea <asbirlea@google.com> | 2019-10-01 19:09:50 +0000 |
---|---|---|
committer | Alina Sbirlea <asbirlea@google.com> | 2019-10-01 19:09:50 +0000 |
commit | 890090f7f58e780f1b81f553cc933f3f4e36013a (patch) | |
tree | 85bd4646ba59c00af82fbfd9205dd6de3b5b261d /llvm/lib/Analysis | |
parent | 7ed4fb389bab1b93e6b7f49b84271a1dab8ed866 (diff) | |
download | bcm5719-llvm-890090f7f58e780f1b81f553cc933f3f4e36013a.tar.gz bcm5719-llvm-890090f7f58e780f1b81f553cc933f3f4e36013a.zip |
[MemorySSA] Check for unreachable blocks when getting last definition.
If a single predecessor is found, still check if the block is
unreachable. The test that found this had a self loop unreachable block.
Resolves PR43493.
llvm-svn: 373383
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/MemorySSAUpdater.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/MemorySSAUpdater.cpp b/llvm/lib/Analysis/MemorySSAUpdater.cpp index 315037bcc04..e0b27f1d501 100644 --- a/llvm/lib/Analysis/MemorySSAUpdater.cpp +++ b/llvm/lib/Analysis/MemorySSAUpdater.cpp @@ -839,6 +839,9 @@ void MemorySSAUpdater::applyInsertUpdates(ArrayRef<CFGUpdate> Updates, } else { // Single predecessor, BB cannot be dead. GetLastDef of Pred. assert(Count == 1 && Pred && "Single predecessor expected."); + // BB can be unreachable though, return LoE if that is the case. + if (!DT.getNode(BB)) + return MSSA->getLiveOnEntryDef(); BB = Pred; } }; |