From 013a4ac4aa5da577fff807c44846eb6cfd6d32f4 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Tue, 3 May 2016 17:49:57 +0000 Subject: [SCEV] Tweak the output format and content of -analyze In the "LoopDispositions:" section: - Instead of printing out a list, print out a "dictionary" to make it obvious by inspection which disposition is for which loop. This is just a cosmetic change. - Print dispositions for parent _and_ sibling loops. I will use this to write a test case. llvm-svn: 268405 --- llvm/lib/Analysis/ScalarEvolution.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp') diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 6954124..d1a330d 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -9628,16 +9628,31 @@ void ScalarEvolution::print(raw_ostream &OS) const { bool First = true; for (auto *Iter = L; Iter; Iter = Iter->getParentLoop()) { if (First) { - OS << "\t\t" "LoopDispositions: [ "; + OS << "\t\t" "LoopDispositions: { "; First = false; } else { OS << ", "; } - OS << loopDispositionToStr(SE.getLoopDisposition(SV, Iter)); + Iter->getHeader()->printAsOperand(OS, /*PrintType=*/false); + OS << ": " << loopDispositionToStr(SE.getLoopDisposition(SV, Iter)); } - OS << " ]"; + for (auto *InnerL : depth_first(L)) { + if (InnerL == L) + continue; + if (First) { + OS << "\t\t" "LoopDispositions: { "; + First = false; + } else { + OS << ", "; + } + + InnerL->getHeader()->printAsOperand(OS, /*PrintType=*/false); + OS << ": " << loopDispositionToStr(SE.getLoopDisposition(SV, InnerL)); + } + + OS << " }"; } OS << "\n"; -- cgit v1.1