|
Polly 22.0.0git
|
#include "polly/JSONExporter.h"#include "polly/DependenceInfo.h"#include "polly/LinkAllPasses.h"#include "polly/Options.h"#include "polly/ScopInfo.h"#include "polly/ScopPass.h"#include "polly/Support/ISLTools.h"#include "polly/Support/ScopLocation.h"#include "llvm/ADT/Statistic.h"#include "llvm/IR/Module.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/JSON.h"#include "llvm/Support/MemoryBuffer.h"#include "llvm/Support/ToolOutputFile.h"#include "llvm/Support/raw_ostream.h"#include "isl/map.h"#include "isl/set.h"#include <memory>#include <string>#include <system_error>import result;import false;Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "polly-import-jscop" |
Typedefs | |
| typedef Dependences::StatementToIslMapTy | StatementToIslMapTy |
Functions | |
| STATISTIC (NewAccessMapFound, "Number of updated access functions") | |
| static std::string | getFileName (Scop &S, StringRef Suffix="") |
| static json::Array | exportArrays (const Scop &S) |
| Export all arrays from the Scop. | |
| static json::Value | getJSON (Scop &S) |
| static void | exportScop (Scop &S) |
| static bool | importContext (Scop &S, const json::Object &JScop) |
| Import a new context from JScop. | |
| static bool | importSchedule (Scop &S, const json::Object &JScop, const Dependences &D) |
| Import a new schedule from JScop. | |
| static bool | importAccesses (Scop &S, const json::Object &JScop, const DataLayout &DL, std::vector< std::string > *NewAccessStrings=nullptr) |
| Import new memory accesses from JScop. | |
| static bool | areArraysEqual (ScopArrayInfo *SAI, const json::Object &Array) |
Check whether SAI and Array represent the same array. | |
| static Type * | parseTextType (const std::string &TypeTextRepresentation, LLVMContext &LLVMContext) |
Get the accepted primitive type from its textual representation TypeTextRepresentation. | |
| static bool | importArrays (Scop &S, const json::Object &JScop) |
| Import new arrays from JScop. | |
| static bool | importScop (Scop &S, const Dependences &D, const DataLayout &DL, std::vector< std::string > *NewAccessStrings=nullptr) |
| Import a Scop from a JSCOP file. | |
| INITIALIZE_PASS_BEGIN (JSONExporter, "polly-export-jscop", "Polly - Export Scops as JSON" " (Writes a .jscop file for each Scop)", false, false) | |
| INITIALIZE_PASS_END (JSONExporter, "polly-export-jscop", "Polly - Export Scops as JSON" " (Writes a .jscop file for each Scop)", false, false) INITIALIZE_PASS_BEGIN(JSONImporter | |
| polly import Polly Import Scops from | JSON (Reads a .jscop file for each Scop)" |
| INITIALIZE_PASS_END (JSONImporter, "polly-import-jscop", "Polly - Import Scops from JSON" " (Reads a .jscop file for each Scop)", false, false) namespace | |
| INITIALIZE_PASS_BEGIN (JSONImporterPrinterLegacyPass, "polly-print-import-jscop", "Polly - Print Scop import result", false, false) INITIALIZE_PASS_END(JSONImporterPrinterLegacyPass | |
Variables | |
| polly import | jscop |
| polly import Polly Import Scops from | false |
| #define DEBUG_TYPE "polly-import-jscop" |
Definition at line 37 of file JSONExporter.cpp.
Definition at line 204 of file JSONExporter.cpp.
|
static |
Check whether SAI and Array represent the same array.
Definition at line 547 of file JSONExporter.cpp.
References polly::Array, polly::ScopArrayInfo::getDimensionSize(), polly::ScopArrayInfo::getElementType(), polly::ScopArrayInfo::getName(), polly::ScopArrayInfo::getNumberOfDimensions(), and size.
Referenced by importArrays().
|
static |
Export all arrays from the Scop.
Definition at line 100 of file JSONExporter.cpp.
References polly::Array, and S.
Referenced by getJSON().
|
static |
Definition at line 177 of file JSONExporter.cpp.
References getFileName(), getJSON(), jscop, and S.
Referenced by polly::JSONExportPass::run().
|
static |
Definition at line 85 of file JSONExporter.cpp.
References S.
Referenced by exportScop(), and importScop().
|
static |
Definition at line 131 of file JSONExporter.cpp.
References exportArrays(), polly::getDebugLocation(), and S.
Referenced by exportScop().
|
static |
Import new memory accesses from JScop.
| S | The scop to update. |
| JScop | The JScop file describing the new schedule. |
| DL | The data layout to assume. |
| NewAccessStrings | optionally record the imported access strings |
Definition at line 349 of file JSONExporter.cpp.
References assert, polly::ScopArrayInfo::getFromId(), isl_bool_false, isl_dim_in, isl_dim_out, isl_dim_param, isl_id_free(), isl_id_get_name(), isl_map_copy(), isl_map_dim(), isl_map_domain(), isl_map_free(), isl_map_get_dim_id(), isl_map_get_tuple_id(), isl_map_is_equal(), isl_map_range(), isl_map_read_from_str(), isl_map_set_dim_id(), isl_map_set_tuple_id(), isl_set, isl_set_free(), isl_set_has_equal_space(), isl_set_intersect(), isl_set_intersect_params(), isl_set_is_subset(), isl::manage(), and S.
Referenced by importScop().
|
static |
Import new arrays from JScop.
| S | The scop to update. |
| JScop | The JScop file describing new arrays. |
Definition at line 631 of file JSONExporter.cpp.
References areArraysEqual(), polly::Array, parseTextType(), S, and str.
Referenced by importScop().
|
static |
Import a new context from JScop.
| S | The scop to update. |
| JScop | The JScop file describing the new schedule. |
Definition at line 212 of file JSONExporter.cpp.
References isl::set::dim(), isl::set::get_dim_id(), isl::set::is_null(), isl::set::is_params(), isl::param, S, isl::set::set_dim_id(), and unsignedFromIslSize().
Referenced by importScop().
|
static |
Import a new schedule from JScop.
... and verify that the new schedule does preserve existing data dependences.
| S | The scop to update. |
| JScop | The JScop file describing the new schedule. |
| D | The data dependences of the S. |
Definition at line 266 of file JSONExporter.cpp.
References assert, isl::union_map::empty(), isl_dim_in, isl_dim_param, isl_dim_set, isl_map_read_from_str(), isl_map_set_dim_id(), isl_map_set_tuple_id(), isl_space_dim(), isl_space_free(), isl_space_get_dim_id(), isl_space_get_tuple_id(), polly::Dependences::isValidSchedule(), isl::manage(), and S.
Referenced by importScop().
|
static |
Import a Scop from a JSCOP file.
| S | The scop to be modified |
| D | Dependence Info |
| DL | The DataLayout of the function |
| NewAccessStrings | Optionally record the imported access strings |
Definition at line 696 of file JSONExporter.cpp.
References getFileName(), importAccesses(), importArrays(), importContext(), importSchedule(), jscop, result, and S.
Referenced by polly::JSONImportPass::run().
| INITIALIZE_PASS_BEGIN | ( | JSONExporter | , |
| "polly-export-jscop" | , | ||
| "Polly - Export Scops as JSON" " (Writes a .jscop file for each Scop)" | , | ||
| false | , | ||
| false | ) |
| INITIALIZE_PASS_BEGIN | ( | JSONImporterPrinterLegacyPass | , |
| "polly-print-import-jscop" | , | ||
| "Polly - Print Scop import result" | , | ||
| false | , | ||
| false | ) |
References INITIALIZE_PASS_DEPENDENCY(), and INITIALIZE_PASS_END().
| INITIALIZE_PASS_END | ( | JSONExporter | , |
| "polly-export-jscop" | , | ||
| "Polly - Export Scops as JSON" " (Writes a .jscop file for each Scop)" | , | ||
| false | , | ||
| false | ) |
References INITIALIZE_PASS_END().
| INITIALIZE_PASS_END | ( | JSONImporter | , |
| "polly-import-jscop" | , | ||
| "Polly - Import Scops from JSON" " (Reads a .jscop file for each Scop)" | , | ||
| false | , | ||
| false | ) |
Print result from JSONImporter.
Definition at line 832 of file JSONExporter.cpp.
References polly::ScopPass::getAnalysisUsage(), INITIALIZE_PASS_END(), and S.
|
static |
Get the accepted primitive type from its textual representation TypeTextRepresentation.
| TypeTextRepresentation | The textual representation of the type. |
Definition at line 599 of file JSONExporter.cpp.
Referenced by importArrays().
| STATISTIC | ( | NewAccessMapFound | , |
| "Number of updated access functions" | ) |
References PollyCategory.
| polly import Polly Import Scops from false |
Definition at line 830 of file JSONExporter.cpp.
| polly print import jscop |
Definition at line 827 of file JSONExporter.cpp.
Referenced by exportScop(), and importScop().