[polly] r220443 - Use stringFromIslObj instead of isl_..._dump to print to dbgs()

Tobias Grosser tobias at grosser.es
Wed Oct 22 16:16:29 PDT 2014


Author: grosser
Date: Wed Oct 22 18:16:28 2014
New Revision: 220443

URL: http://llvm.org/viewvc/llvm-project?rev=220443&view=rev
Log:
Use stringFromIslObj instead of isl_..._dump to print to dbgs()

This makes sure we consistently use dbgs() when printing debug output.
Previously, the code just mixed calls to isl_*_dump() with printing to dbgs()
and was relying for both methods to interact in predictable ways (same output
stream, no unexpected reordering of outputs).

Modified:
    polly/trunk/lib/CodeGen/IslAst.cpp
    polly/trunk/lib/Transform/ScheduleOptimizer.cpp

Modified: polly/trunk/lib/CodeGen/IslAst.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslAst.cpp?rev=220443&r1=220442&r2=220443&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslAst.cpp (original)
+++ polly/trunk/lib/CodeGen/IslAst.cpp Wed Oct 22 18:16:28 2014
@@ -25,6 +25,7 @@
 #include "polly/LinkAllPasses.h"
 #include "polly/Options.h"
 #include "polly/ScopInfo.h"
+#include "polly/Support/GICHelper.h"
 #include "llvm/Support/Debug.h"
 
 #include "isl/union_map.h"
@@ -491,7 +492,10 @@ void IslAstInfo::printScop(raw_ostream &
 
   OS << ":: isl ast :: " << F->getName() << " :: " << S.getRegion().getNameStr()
      << "\n";
-  DEBUG(dbgs() << S.getContextStr() << "\n"; isl_union_map_dump(Schedule));
+  DEBUG({
+    dbgs() << S.getContextStr() << "\n";
+    dbgs() << stringFromIslObj(Schedule);
+  });
   OS << "\nif (" << RtCStr << ")\n\n";
   OS << AstStr << "\n";
   OS << "else\n";

Modified: polly/trunk/lib/Transform/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ScheduleOptimizer.cpp?rev=220443&r1=220442&r2=220443&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/Transform/ScheduleOptimizer.cpp Wed Oct 22 18:16:28 2014
@@ -30,6 +30,7 @@
 #include "polly/LinkAllPasses.h"
 #include "polly/Options.h"
 #include "polly/ScopInfo.h"
+#include "polly/Support/GICHelper.h"
 #include "llvm/Support/Debug.h"
 
 using namespace llvm;
@@ -501,11 +502,9 @@ bool IslScheduleOptimizer::runOnScop(Sco
   }
 
   DEBUG(dbgs() << "\n\nCompute schedule from: ");
-  DEBUG(dbgs() << "Domain := "; isl_union_set_dump(Domain); dbgs() << ";\n");
-  DEBUG(dbgs() << "Proximity := "; isl_union_map_dump(Proximity);
-        dbgs() << ";\n");
-  DEBUG(dbgs() << "Validity := "; isl_union_map_dump(Validity);
-        dbgs() << ";\n");
+  DEBUG(dbgs() << "Domain := " << stringFromIslObj(Domain) << ";\n");
+  DEBUG(dbgs() << "Proximity := " << stringFromIslObj(Proximity) << ";\n");
+  DEBUG(dbgs() << "Validity := " << stringFromIslObj(Validity) << ";\n");
 
   int IslFusionStrategy;
 
@@ -555,7 +554,7 @@ bool IslScheduleOptimizer::runOnScop(Sco
   if (!Schedule)
     return false;
 
-  DEBUG(dbgs() << "Schedule := "; isl_schedule_dump(Schedule); dbgs() << ";\n");
+  DEBUG(dbgs() << "Schedule := " << stringFromIslObj(Schedule) << ";\n");
 
   isl_union_map *ScheduleMap = getScheduleMap(Schedule);
 





More information about the llvm-commits mailing list