Index: lib/Exchange/JSONExporter.cpp =================================================================== --- lib/Exchange/JSONExporter.cpp +++ lib/Exchange/JSONExporter.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "polly/JSONExporter.h" #include "polly/DependenceInfo.h" #include "polly/LinkAllPasses.h" #include "polly/Options.h" @@ -59,9 +60,6 @@ static char ID; explicit JSONExporter() : ScopPass(ID) {} - std::string getFileName(Scop &S) const; - Json::Value getJSON(Scop &S) const; - /// Export the SCoP @p S to a JSON file. bool runOnScop(Scop &S) override; @@ -76,46 +74,6 @@ static char ID; std::vector NewAccessStrings; explicit JSONImporter() : ScopPass(ID) {} - - /// Import a new context from JScop. - /// - /// @param S The scop to update. - /// @param JScop The JScop file describing the new schedule. - /// - /// @returns True if the import succeeded, otherwise False. - bool importContext(Scop &S, Json::Value &JScop); - - /// Import a new schedule from JScop. - /// - /// ... and verify that the new schedule does preserve existing data - /// dependences. - /// - /// @param S The scop to update. - /// @param JScop The JScop file describing the new schedule. - /// @param D The data dependences of the @p S. - /// - /// @returns True if the import succeeded, otherwise False. - bool importSchedule(Scop &S, Json::Value &JScop, const Dependences &D); - - /// Import new arrays from JScop. - /// - /// @param S The scop to update. - /// @param JScop The JScop file describing new arrays. - /// - /// @returns True if the import succeeded, otherwise False. - bool importArrays(Scop &S, Json::Value &JScop); - - /// Import new memory accesses from JScop. - /// - /// @param S The scop to update. - /// @param JScop The JScop file describing the new schedule. - /// @param DL The data layout to assume. - /// - /// @returns True if the import succeeded, otherwise False. - bool importAccesses(Scop &S, Json::Value &JScop, const DataLayout &DL); - - std::string getFileName(Scop &S) const; - /// Import new access functions for SCoP @p S from a JSON file. bool runOnScop(Scop &S) override; @@ -127,21 +85,22 @@ }; } // namespace -char JSONExporter::ID = 0; -std::string JSONExporter::getFileName(Scop &S) const { +static std::string getFileName(Scop &S, StringRef Suffix = "") { std::string FunctionName = S.getFunction().getName(); std::string FileName = FunctionName + "___" + S.getNameStr() + ".jscop"; + + if (Suffix != "") + FileName += "." + Suffix.str(); + return FileName; } -void JSONExporter::printScop(raw_ostream &OS, Scop &S) const { OS << S; } - /// Export all arrays from the Scop. /// /// @param S The Scop containing the arrays. /// /// @returns Json::Value containing the arrays. -Json::Value exportArrays(const Scop &S) { +static Json::Value exportArrays(const Scop &S) { Json::Value Arrays; std::string Buffer; llvm::raw_string_ostream RawStringOstream(Buffer); @@ -170,7 +129,7 @@ return Arrays; } -Json::Value JSONExporter::getJSON(Scop &S) const { +static Json::Value getJSON(Scop &S) { Json::Value root; unsigned LineBegin, LineEnd; std::string FileName; @@ -213,7 +172,7 @@ return root; } -bool JSONExporter::runOnScop(Scop &S) { +static void exportScop(Scop &S) { std::string FileName = ImportDir + "/" + getFileName(S); Json::Value jscop = getJSON(S); @@ -234,45 +193,23 @@ if (!F.os().has_error()) { errs() << "\n"; F.keep(); - return false; + return; } } errs() << " error opening file for writing!\n"; F.os().clear_error(); - - return false; -} - -void JSONExporter::getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - AU.addRequired(); -} - -Pass *polly::createJSONExporterPass() { return new JSONExporter(); } - -char JSONImporter::ID = 0; -std::string JSONImporter::getFileName(Scop &S) const { - std::string FunctionName = S.getFunction().getName(); - std::string FileName = FunctionName + "___" + S.getNameStr() + ".jscop"; - - if (ImportPostfix != "") - FileName += "." + ImportPostfix; - - return FileName; -} - -void JSONImporter::printScop(raw_ostream &OS, Scop &S) const { - OS << S; - for (std::vector::const_iterator I = NewAccessStrings.begin(), - E = NewAccessStrings.end(); - I != E; I++) - OS << "New access function '" << *I << "' detected in JSCOP file\n"; } typedef Dependences::StatementToIslMapTy StatementToIslMapTy; -bool JSONImporter::importContext(Scop &S, Json::Value &JScop) { +/// Import a new context from JScop. +/// +/// @param S The scop to update. +/// @param JScop The JScop file describing the new schedule. +/// +/// @returns True if the import succeeded, otherwise False. +bool importContext(Scop &S, Json::Value &JScop) { isl_set *OldContext = S.getContext().release(); // Check if key 'context' is present. @@ -324,8 +261,17 @@ return true; } -bool JSONImporter::importSchedule(Scop &S, Json::Value &JScop, - const Dependences &D) { +/// Import a new schedule from JScop. +/// +/// ... and verify that the new schedule does preserve existing data +/// dependences. +/// +/// @param S The scop to update. +/// @param JScop The JScop file describing the new schedule. +/// @param D The data dependences of the @p S. +/// +/// @returns True if the import succeeded, otherwise False. +static bool importSchedule(Scop &S, Json::Value &JScop, const Dependences &D) { StatementToIslMapTy NewSchedule; // Check if key 'statements' is present. @@ -405,8 +351,17 @@ return true; } -bool JSONImporter::importAccesses(Scop &S, Json::Value &JScop, - const DataLayout &DL) { +/// Import new memory accesses from JScop. +/// +/// @param S The scop to update. +/// @param JScop The JScop file describing the new schedule. +/// @param DL The data layout to assume. +/// @param NewAccessStrings optionally record the imported access strings +/// +/// @returns True if the import succeeded, otherwise False. +static bool +importAccesses(Scop &S, Json::Value &JScop, const DataLayout &DL, + std::vector *NewAccessStrings = nullptr) { int StatementIdx = 0; // Check if key 'statements' is present. @@ -433,7 +388,8 @@ return false; } - // Check whether the number of indices equals the number of memory accesses + // Check whether the number of indices equals the number of memory + // accesses if (Stmt.size() != statements[StatementIdx]["accesses"].size()) { errs() << "The number of memory accesses in the JSop file and the number " "of memory accesses differ for index " @@ -475,8 +431,8 @@ // If the NewAccessMap has zero dimensions, it is the scalar access; it // must be the same as before. - // If it has at least one dimension, it's an array access; search for its - // ScopArrayInfo. + // If it has at least one dimension, it's an array access; search for + // its ScopArrayInfo. if (isl_map_dim(NewAccessMap, isl_dim_out) >= 1) { NewOutId = isl_map_get_tuple_id(NewAccessMap, isl_dim_out); auto *SAI = S.getArrayInfoByName(isl_id_get_name(NewOutId)); @@ -582,7 +538,8 @@ if (!isl_map_is_equal(NewAccessMap, CurrentAccessMap)) { // Statistics. ++NewAccessMapFound; - NewAccessStrings.push_back(Accesses.asCString()); + if (NewAccessStrings) + NewAccessStrings->push_back(Accesses.asCString()); MA->setNewAccessRelation(isl::manage(NewAccessMap)); } else { isl_map_free(NewAccessMap); @@ -597,7 +554,7 @@ } /// Check whether @p SAI and @p Array represent the same array. -bool areArraysEqual(ScopArrayInfo *SAI, Json::Value Array) { +static bool areArraysEqual(ScopArrayInfo *SAI, Json::Value Array) { std::string Buffer; llvm::raw_string_ostream RawStringOstream(Buffer); @@ -648,8 +605,8 @@ /// @param TypeTextRepresentation The textual representation of the type. /// @return The pointer to the primitive type, if this type is accepted /// or nullptr otherwise. -Type *parseTextType(const std::string &TypeTextRepresentation, - LLVMContext &LLVMContext) { +static Type *parseTextType(const std::string &TypeTextRepresentation, + LLVMContext &LLVMContext) { std::map MapStrToType = { {"void", Type::getVoidTy(LLVMContext)}, {"half", Type::getHalfTy(LLVMContext)}, @@ -674,7 +631,13 @@ return nullptr; } -bool JSONImporter::importArrays(Scop &S, Json::Value &JScop) { +/// Import new arrays from JScop. +/// +/// @param S The scop to update. +/// @param JScop The JScop file describing new arrays. +/// +/// @returns True if the import succeeded, otherwise False. +static bool importArrays(Scop &S, Json::Value &JScop) { Json::Value Arrays = JScop["arrays"]; if (Arrays.size() == 0) return true; @@ -726,12 +689,18 @@ return true; } -bool JSONImporter::runOnScop(Scop &S) { - const Dependences &D = - getAnalysis().getDependences(Dependences::AL_Statement); - const DataLayout &DL = S.getFunction().getParent()->getDataLayout(); - - std::string FileName = ImportDir + "/" + getFileName(S); +/// Import a Scop from a JSCOP file +/// @param S The scop to be modified +/// @param D Dependence Info +/// @param DL The DataLayout of the function +/// @param NewAccessStrings Optionally record the imported access strings +/// +/// @returns true on success, false otherwise. Beware that if this returns +/// false, the Scop may still have been modified. In this case the Scop contains +/// invalid information. +static bool importScop(Scop &S, const Dependences &D, const DataLayout &DL, + std::vector *NewAccessStrings = nullptr) { + std::string FileName = ImportDir + "/" + getFileName(S, ImportPostfix); std::string FunctionName = S.getFunction().getName(); errs() << "Reading JScop '" << S.getNameStr() << "' in function '" @@ -770,11 +739,51 @@ if (!Success) return false; - Success = importAccesses(S, jscop, DL); + Success = importAccesses(S, jscop, DL, NewAccessStrings); if (!Success) return false; + return true; +} + +char JSONExporter::ID = 0; +void JSONExporter::printScop(raw_ostream &OS, Scop &S) const { OS << S; } + +bool JSONExporter::runOnScop(Scop &S) { + exportScop(S); + return false; +} + +void JSONExporter::getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); + AU.addRequired(); +} + +Pass *polly::createJSONExporterPass() { return new JSONExporter(); } +PreservedAnalyses JSONExportPass::run(Scop &S, ScopAnalysisManager &SAM, + ScopStandardAnalysisResults &SAR, + SPMUpdater &) { + exportScop(S); + return PreservedAnalyses::all(); +} + +char JSONImporter::ID = 0; + +void JSONImporter::printScop(raw_ostream &OS, Scop &S) const { + OS << S; + for (std::vector::const_iterator I = NewAccessStrings.begin(), + E = NewAccessStrings.end(); + I != E; I++) + OS << "New access function '" << *I << "' detected in JSCOP file\n"; +} + +bool JSONImporter::runOnScop(Scop &S) { + const Dependences &D = + getAnalysis().getDependences(Dependences::AL_Statement); + const DataLayout &DL = S.getFunction().getParent()->getDataLayout(); + if (!importScop(S, D, DL, &NewAccessStrings)) + report_fatal_error("Tried to import a malformed jscop file."); return false; } @@ -785,6 +794,25 @@ Pass *polly::createJSONImporterPass() { return new JSONImporter(); } +PreservedAnalyses JSONImportPass::run(Scop &S, ScopAnalysisManager &SAM, + ScopStandardAnalysisResults &SAR, + SPMUpdater &) { + const Dependences &D = + SAM.getResult(S, SAR).getDependences( + Dependences::AL_Statement); + const DataLayout &DL = S.getFunction().getParent()->getDataLayout(); + + if (!importScop(S, D, DL)) + report_fatal_error("Tried to import a malformed jscop file."); + + // This invalidates all analyses on Scop. + PreservedAnalyses PA; + PA.preserveSet>(); + PA.preserveSet>(); + PA.preserveSet>(); + return PA; +} + INITIALIZE_PASS_BEGIN(JSONExporter, "polly-export-jscop", "Polly - Export Scops as JSON" " (Writes a .jscop file for each Scop)", Index: lib/Support/PollyPasses.def =================================================================== --- lib/Support/PollyPasses.def +++ lib/Support/PollyPasses.def @@ -23,6 +23,8 @@ #ifndef SCOP_PASS #define SCOP_PASS(NAME, CREATE_PASS) #endif +SCOP_PASS("polly-export-jscop", JSONExportPass()) +SCOP_PASS("polly-import-jscop", JSONImportPass()) SCOP_PASS("print", IslAstPrinterPass(outs())) SCOP_PASS("print", DependenceInfoPrinterPass(outs())) SCOP_PASS("polly-codegen", CodeGenerationPass()) Index: lib/Support/RegisterPasses.cpp =================================================================== --- lib/Support/RegisterPasses.cpp +++ lib/Support/RegisterPasses.cpp @@ -30,6 +30,7 @@ #include "polly/DependenceInfo.h" #include "polly/FlattenSchedule.h" #include "polly/ForwardOpTree.h" +#include "polly/JSONExporter.h" #include "polly/LinkAllPasses.h" #include "polly/Options.h" #include "polly/PolyhedralInfo.h" @@ -475,7 +476,8 @@ assert(!EnablePolyhedralInfo && "This option is not implemented"); assert(!EnableDeLICM && "This option is not implemented"); assert(!EnableSimplify && "This option is not implemented"); - assert(!ImportJScop && "This option is not implemented"); + if (ImportJScop) + SPM.addPass(JSONImportPass()); assert(!DeadCodeElim && "This option is not implemented"); assert(!EnablePruneUnprofitable && "This option is not implemented"); if (Target == TARGET_CPU || Target == TARGET_HYBRID) Index: test/Isl/CodeGen/MemAccess/bad_alignment.ll =================================================================== --- test/Isl/CodeGen/MemAccess/bad_alignment.ll +++ test/Isl/CodeGen/MemAccess/bad_alignment.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -analyze 2>&1 < %s | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -analyze 2>&1 < %s | FileCheck %s ; ; Check that we do not allow to access elements not accessed before because the ; alignment information would become invalid. Index: test/JSONExporter/ImportAccesses/ImportAccesses-Bad-relation.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Bad-relation.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Bad-relation.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The access was not parsed successfully by ISL. ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-No-accesses-key.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-No-accesses-key.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-No-accesses-key.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: Statement from JScop file has no key name 'accesses' for index 1. ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-Not-enough-MemAcc.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Not-enough-MemAcc.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Not-enough-MemAcc.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The number of memory accesses in the JSop file and the number of memory accesses differ for index 0. ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-Not-enough-statements.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Not-enough-statements.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Not-enough-statements.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The number of indices and the number of statements differ. ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-Relation-mispelled.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Relation-mispelled.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Relation-mispelled.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: Memory access number 0 has no key name 'relation' for statement number 1. ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-Statements-mispelled.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Statements-mispelled.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Statements-mispelled.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: JScop file has no key name 'statements'. ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-Undeclared-ScopArrayInfo.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Undeclared-ScopArrayInfo.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Undeclared-ScopArrayInfo.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: JScop file contains access function with undeclared ScopArrayInfo ; Index: test/JSONExporter/ImportAccesses/ImportAccesses-Wrong-number-dimensions.ll =================================================================== --- test/JSONExporter/ImportAccesses/ImportAccesses-Wrong-number-dimensions.ll +++ test/JSONExporter/ImportAccesses/ImportAccesses-Wrong-number-dimensions.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: JScop file changes the number of parameter dimensions. ; Index: test/JSONExporter/ImportArrays/ImportArrays-Mispelled-type.ll =================================================================== --- test/JSONExporter/ImportArrays/ImportArrays-Mispelled-type.ll +++ test/JSONExporter/ImportArrays/ImportArrays-Mispelled-type.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s + ; RUN: not opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s ; ; CHECK: Array has not a valid type. ; Index: test/JSONExporter/ImportArrays/ImportArrays-Negative-size.ll =================================================================== --- test/JSONExporter/ImportArrays/ImportArrays-Negative-size.ll +++ test/JSONExporter/ImportArrays/ImportArrays-Negative-size.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s +; RUN: not opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s ; ; #define Ni 1056 ; #define Nj 1056 Index: test/JSONExporter/ImportArrays/ImportArrays-No-name.ll =================================================================== --- test/JSONExporter/ImportArrays/ImportArrays-No-name.ll +++ test/JSONExporter/ImportArrays/ImportArrays-No-name.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s +; RUN: not opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s ; ; CHECK: Array has no key 'name'. ; Index: test/JSONExporter/ImportArrays/ImportArrays-No-sizes-key.ll =================================================================== --- test/JSONExporter/ImportArrays/ImportArrays-No-sizes-key.ll +++ test/JSONExporter/ImportArrays/ImportArrays-No-sizes-key.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s +; RUN: not opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s ; ; CHECK: Array has no key 'sizes'. ; Index: test/JSONExporter/ImportArrays/ImportArrays-No-type-key.ll =================================================================== --- test/JSONExporter/ImportArrays/ImportArrays-No-type-key.ll +++ test/JSONExporter/ImportArrays/ImportArrays-No-type-key.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s +; RUN: not opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s ; ; CHECK: Array has no key 'type'. ; Index: test/JSONExporter/ImportContext/ImportContext-Context-mispelled.ll =================================================================== --- test/JSONExporter/ImportContext/ImportContext-Context-mispelled.ll +++ test/JSONExporter/ImportContext/ImportContext-Context-mispelled.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: JScop file has no key named 'context'. ; Index: test/JSONExporter/ImportContext/ImportContext-Not-parameter-set.ll =================================================================== --- test/JSONExporter/ImportContext/ImportContext-Not-parameter-set.ll +++ test/JSONExporter/ImportContext/ImportContext-Not-parameter-set.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel -analyze < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel -analyze < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The isl_set is not a parameter set. ; Index: test/JSONExporter/ImportContext/ImportContext-Unvalid-Context.ll =================================================================== --- test/JSONExporter/ImportContext/ImportContext-Unvalid-Context.ll +++ test/JSONExporter/ImportContext/ImportContext-Unvalid-Context.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The context was not parsed successfully by ISL. ; Index: test/JSONExporter/ImportContext/ImportContext-Wrong-dimension.ll =================================================================== --- test/JSONExporter/ImportContext/ImportContext-Wrong-dimension.ll +++ test/JSONExporter/ImportContext/ImportContext-Wrong-dimension.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: Imported context has the wrong number of parameters : Found 2 Expected 1 ; Index: test/JSONExporter/ImportSchedule/ImportSchedule-No-schedule-key.ll =================================================================== --- test/JSONExporter/ImportSchedule/ImportSchedule-No-schedule-key.ll +++ test/JSONExporter/ImportSchedule/ImportSchedule-No-schedule-key.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: Statement 0 has no 'schedule' key. ; Index: test/JSONExporter/ImportSchedule/ImportSchedule-Schedule-not-valid.ll =================================================================== --- test/JSONExporter/ImportSchedule/ImportSchedule-Schedule-not-valid.ll +++ test/JSONExporter/ImportSchedule/ImportSchedule-Schedule-not-valid.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The schedule was not parsed successfully (index = 1). ; Index: test/JSONExporter/ImportSchedule/ImportSchedule-Statements-mispelled.ll =================================================================== --- test/JSONExporter/ImportSchedule/ImportSchedule-Statements-mispelled.ll +++ test/JSONExporter/ImportSchedule/ImportSchedule-Statements-mispelled.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: JScop file has no key name 'statements'. ; Index: test/JSONExporter/ImportSchedule/ImportSchedule-Wrong-number-statements.ll =================================================================== --- test/JSONExporter/ImportSchedule/ImportSchedule-Wrong-number-statements.ll +++ test/JSONExporter/ImportSchedule/ImportSchedule-Wrong-number-statements.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s +; RUN: not opt %loadPolly -polly-import-jscop -polly-ast -polly-ast-detect-parallel < %s 2>&1 >/dev/null | FileCheck %s ; ; CHECK: The number of indices and the number of statements differ. ; Index: test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop =================================================================== --- test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop +++ test/ScopDetect/base_pointer_load_is_inst_inside_invariant_1___%for.i---%exit.jscop @@ -17,10 +17,6 @@ { "accesses" : [ { - "kind" : "read", - "relation" : "[n] -> { Stmt_S1[i0] -> MemRef_A[0] }" - }, - { "kind" : "write", "relation" : "[n] -> { Stmt_S1[i0] -> MemRef_ptr[i0+1] }" } Index: test/Simplify/notredundant_region_middle.ll =================================================================== --- test/Simplify/notredundant_region_middle.ll +++ test/Simplify/notredundant_region_middle.ll @@ -1,4 +1,4 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-simplify -analyze < %s | FileCheck %s -match-full-lines +; RUN: opt %loadPolly -polly-simplify -analyze < %s | FileCheck %s -match-full-lines ; ; Do not remove redundant stores in the middle of region statements. ; The store in region_true could be removed, but in practice we do try to