diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-06-14 19:55:53 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-06-14 19:55:53 +0000 |
commit | aa283d80fe7aaa9460e510f20a732f9fbff69ac4 (patch) | |
tree | 6e98abb444fed226d46bfae97eed66259bd6747a /llvm/lib/Analysis/MemorySSA.cpp | |
parent | f85ca6abee7351aa5d059d7ec241e1ac016c59fb (diff) | |
download | bcm5719-llvm-aa283d80fe7aaa9460e510f20a732f9fbff69ac4.tar.gz bcm5719-llvm-aa283d80fe7aaa9460e510f20a732f9fbff69ac4.zip |
[MSSA] Print more optimization information
In particular, when asked to print a MemoryAccess, we'll now print where
defs are optimized to, and we'll print optimized access types.
This patch also introduces an operator<< to make printing AliasResults
easier.
Patch by Juneyoung Lee!
Differential Revision: https://reviews.llvm.org/D47860
llvm-svn: 334760
Diffstat (limited to 'llvm/lib/Analysis/MemorySSA.cpp')
-rw-r--r-- | llvm/lib/Analysis/MemorySSA.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index 43fc7d40d78..dda42274fdc 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -1857,12 +1857,24 @@ void MemoryAccess::print(raw_ostream &OS) const { void MemoryDef::print(raw_ostream &OS) const { MemoryAccess *UO = getDefiningAccess(); + auto printID = [&OS](MemoryAccess *A) { + if (A && A->getID()) + OS << A->getID(); + else + OS << LiveOnEntryStr; + }; + OS << getID() << " = MemoryDef("; - if (UO && UO->getID()) - OS << UO->getID(); - else - OS << LiveOnEntryStr; - OS << ')'; + printID(UO); + OS << ")"; + + if (isOptimized()) { + OS << "->"; + printID(getOptimized()); + + if (Optional<AliasResult> AR = getOptimizedAccessType()) + OS << " " << *AR; + } } void MemoryPhi::print(raw_ostream &OS) const { @@ -1899,6 +1911,9 @@ void MemoryUse::print(raw_ostream &OS) const { else OS << LiveOnEntryStr; OS << ')'; + + if (Optional<AliasResult> AR = getOptimizedAccessType()) + OS << " " << *AR; } void MemoryAccess::dump() const { |