summaryrefslogtreecommitdiffstats
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
commita8ce8fa700f614aa1975b8fd4ca39d2c63a5ea6e (patch)
treea2c8332103bb8e386dcc2d23d734ed1b85b335e8
parent488d1dc0edefb3b9852e1fd1ea579d585f7acec7 (diff)
downloadbcm5719-llvm-a8ce8fa700f614aa1975b8fd4ca39d2c63a5ea6e.tar.gz
bcm5719-llvm-a8ce8fa700f614aa1975b8fd4ca39d2c63a5ea6e.zip
[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). llvm-svn: 298640
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 05820529363..17e781375e4 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud