Make ScalarEvolution::print print getSCEVAtScope values for
authorDan Gohman <gohman@apple.com>
Fri, 19 Jun 2009 17:49:54 +0000 (17:49 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 19 Jun 2009 17:49:54 +0000 (17:49 +0000)
expressions, when interesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73776 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index 94b75baeee0451db8f07a09d58db92823ab2e7d6..049f886c5ab3af42a51e8789e79d78a98eaea691 100644 (file)
@@ -4048,9 +4048,17 @@ void ScalarEvolution::print(raw_ostream &OS, const Module* ) const {
       SCEVHandle SV = SE.getSCEV(&*I);
       SV->print(OS);
 
-      if (const Loop *L = LI->getLoopFor((*I).getParent())) {
+      const Loop *L = LI->getLoopFor((*I).getParent());
+
+      SCEVHandle AtUse = SE.getSCEVAtScope(SV, L);
+      if (AtUse != SV) {
+        OS << "  -->  ";
+        AtUse->print(OS);
+      }
+
+      if (L) {
         OS << "\t\t" "Exits: ";
-        SCEVHandle ExitValue = SE.getSCEVAtScope(&*I, L->getParentLoop());
+        SCEVHandle ExitValue = SE.getSCEVAtScope(SV, L->getParentLoop());
         if (!ExitValue->isLoopInvariant(L)) {
           OS << "<<Unknown>>";
         } else {