summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-05-03 17:49:57 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-05-03 17:49:57 +0000
commit013a4ac4aa5da577fff807c44846eb6cfd6d32f4 (patch)
treeb12245f4e4f190e9575819371fcb24689cf0a98e /llvm/lib/Analysis/ScalarEvolution.cpp
parent1dd2b3d1d0f89bf2bbb92342c648acf701dec8d0 (diff)
downloadbcm5719-llvm-013a4ac4aa5da577fff807c44846eb6cfd6d32f4.tar.gz
bcm5719-llvm-013a4ac4aa5da577fff807c44846eb6cfd6d32f4.zip
[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
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 69541247d47..d1a330d0948 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";
OpenPOWER on IntegriCloud