diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-08-30 11:49:38 +0000 |
---|---|---|
committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-08-30 11:49:38 +0000 |
commit | cd95b773305c743eb44430a530481e1577bf67ac (patch) | |
tree | 941c19b044885fc9b1b411e5ff752d626ba55a1c /polly/lib/Pocc.cpp | |
parent | 4a7527e0ebdc5d4479103a5d19992375eaf69f98 (diff) | |
download | bcm5719-llvm-cd95b773305c743eb44430a530481e1577bf67ac.tar.gz bcm5719-llvm-cd95b773305c743eb44430a530481e1577bf67ac.zip |
Pocc: Fix some bugs in the PoCC optimizer pass
This includes:
- The isl_id of the domain of the scattering must be copied from the original
domain
- Remove outdated references to a 'FinalRead' statement
- Print of the Pocc output, if -debug is provided.
- Add line breaks to some error messages.
Reported and Debugged by: Dustin Feld <d3.feld@gmail.com>
llvm-svn: 162901
Diffstat (limited to 'polly/lib/Pocc.cpp')
-rw-r--r-- | polly/lib/Pocc.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/polly/lib/Pocc.cpp b/polly/lib/Pocc.cpp index a59c95759e4..df8702a2c87 100644 --- a/polly/lib/Pocc.cpp +++ b/polly/lib/Pocc.cpp @@ -24,6 +24,8 @@ #include "polly/ScheduleOptimizer.h" #include "polly/ScopInfo.h" +#define DEBUG_TYPE "polly-opt-pocc" +#include "llvm/Support/Debug.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" #include "llvm/Support/MemoryBuffer.h" @@ -62,20 +64,17 @@ namespace { virtual bool runOnScop(Scop &S); void printScop(llvm::raw_ostream &OS) const; void getAnalysisUsage(AnalysisUsage &AU) const; + + private: + bool runTransform(Scop &S); }; } char Pocc::ID = 0; -bool Pocc::runOnScop(Scop &S) { +bool Pocc::runTransform(Scop &S) { Dependences *D = &getAnalysis<Dependences>(); - // Only the final read statement in the SCoP. No need to optimize anything. - // (In case we would try, Pocc complains that there is no statement in the - // SCoP). - if (S.begin() + 1 == S.end()) - return false; - // Create the scop file. sys::Path tempDir = sys::Path::GetTemporaryDirectory(); sys::Path scopFile = tempDir; @@ -234,6 +233,12 @@ bool Pocc::runOnScop(Scop &S) { return false; } +bool Pocc::runOnScop(Scop &S) { + bool Result = runTransform(S); + DEBUG(printScop(dbgs())); + + return Result; +} void Pocc::printScop(raw_ostream &OS) const { OwningPtr<MemoryBuffer> stdoutBuffer; @@ -249,14 +254,14 @@ void Pocc::printScop(raw_ostream &OS) const { OS << "\n"; if (error_code ec = MemoryBuffer::getFile(plutoStdout.c_str(), stdoutBuffer)) - OS << "Could not open pocc stdout file: " + ec.message(); + OS << "Could not open pocc stdout file: " + ec.message() << "\n"; else { OS << "pocc stdout: " << stdoutBuffer->getBufferIdentifier() << "\n"; OS << stdoutBuffer->getBuffer() << "\n"; } if (error_code ec = MemoryBuffer::getFile(plutoStderr.c_str(), stderrBuffer)) - OS << "Could not open pocc stderr file: " + ec.message(); + OS << "Could not open pocc stderr file: " + ec.message() << "\n"; else { OS << "pocc stderr: " << plutoStderr.c_str() << "\n"; OS << stderrBuffer->getBuffer() << "\n"; |