diff options
| author | Alina Sbirlea <asbirlea@google.com> | 2019-10-15 17:25:36 +0000 |
|---|---|---|
| committer | Alina Sbirlea <asbirlea@google.com> | 2019-10-15 17:25:36 +0000 |
| commit | 3de89f3416bfa78079136ea6566c8f82b1b64292 (patch) | |
| tree | f2aac7c3a405dd4d00b8f9719908e11034337781 /llvm/lib | |
| parent | d69d1aa131b4cf339bfac116e50da33a5f94b861 (diff) | |
| download | bcm5719-llvm-3de89f3416bfa78079136ea6566c8f82b1b64292.tar.gz bcm5719-llvm-3de89f3416bfa78079136ea6566c8f82b1b64292.zip | |
[NewGVN] Check that call has an access.
Check that a call has an attached MemoryAccess before calling
getClobbering on the instruction.
If no access is attached, the instruction does not access memory.
Resolves PR43441.
llvm-svn: 374920
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/NewGVN.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp index f62a5e553f1..b213264de55 100644 --- a/llvm/lib/Transforms/Scalar/NewGVN.cpp +++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp @@ -1639,8 +1639,11 @@ const Expression *NewGVN::performSymbolicCallEvaluation(Instruction *I) const { if (AA->doesNotAccessMemory(CI)) { return createCallExpression(CI, TOPClass->getMemoryLeader()); } else if (AA->onlyReadsMemory(CI)) { - MemoryAccess *DefiningAccess = MSSAWalker->getClobberingMemoryAccess(CI); - return createCallExpression(CI, DefiningAccess); + if (auto *MA = MSSA->getMemoryAccess(CI)) { + auto *DefiningAccess = MSSAWalker->getClobberingMemoryAccess(MA); + return createCallExpression(CI, DefiningAccess); + } else // MSSA determined that CI does not access memory. + return createCallExpression(CI, TOPClass->getMemoryLeader()); } return nullptr; } |

