summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Thomas <anna@azul.com>2017-03-23 20:00:54 +0000
committerAnna Thomas <anna@azul.com>2017-03-23 20:00:54 +0000
commit3ae0a79c0d066a57b3755a2634c8cbd5d1c8fdf2 (patch)
treed7d17cc86317760eebecab1e8680ea4c835ab423
parent08d0e94685662f114b3cf1b26b60cf7cdeeb4830 (diff)
[LVIPrinterPass] Print LVI info for function arguments
Using AssemblyAnnotationWriter for LVI printer prints for instructions and basic blocks. So, we explicitly need to print LVI info for the arguments of the function (these are values and not instructions). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298640 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/LazyValueInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index 05820529363..17e781375e4 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -486,6 +486,18 @@ namespace {
OS << "; OverDefined values for block are: \n";
for (auto *V : ODI->second)
OS << ";" << *V << "\n";
+
+ // Find if there are latticevalues defined for arguments of the function.
+ auto *F = const_cast<Function *>(BB->getParent());
+ for (auto &Arg : F->args()) {
+ auto VI = LVICache->ValueCache.find_as(&Arg);
+ if (VI == LVICache->ValueCache.end())
+ continue;
+ auto BBI = VI->second->BlockVals.find(const_cast<BasicBlock *>(BB));
+ if (BBI != VI->second->BlockVals.end())
+ OS << "; CachedLatticeValue for: '" << *VI->first << "' is: '"
+ << BBI->second << "'\n";
+ }
}
virtual void emitInstructionAnnot(const Instruction *I,