[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
This commit is contained in:
Anna Thomas 2017-03-23 20:00:54 +00:00
parent 488d1dc0ed
commit a8ce8fa700
1 changed files with 12 additions and 0 deletions

View File

@ -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,