|
Polly 22.0.0git
|
#include "polly/JSONExporter.h"#include "polly/DependenceInfo.h"#include "polly/Options.h"#include "polly/ScopInfo.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>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "polly-import-jscop" |
Typedefs | |
| typedef Dependences::StatementToIslMapTy | StatementToIslMapTy |
Functions | |
| static cl::opt< bool > | PollyPrintImportJscop ("polly-print-import-jscop", cl::desc("Polly - Print Scop import result"), cl::cat(PollyCategory)) |
| 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. | |
| #define DEBUG_TYPE "polly-import-jscop" |
Definition at line 35 of file JSONExporter.cpp.
Definition at line 177 of file JSONExporter.cpp.
|
static |
Check whether SAI and Array represent the same array.
Definition at line 520 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 73 of file JSONExporter.cpp.
References polly::Array, and S.
Referenced by getJSON().
|
static |
Definition at line 150 of file JSONExporter.cpp.
References getFileName(), getJSON(), and S.
Referenced by polly::runExportJSON().
|
static |
Definition at line 58 of file JSONExporter.cpp.
References S.
Referenced by exportScop(), and importScop().
|
static |
Definition at line 104 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 322 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 604 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 185 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 239 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 669 of file JSONExporter.cpp.
References getFileName(), importAccesses(), importArrays(), importContext(), importSchedule(), and S.
Referenced by polly::runImportJSON().
|
static |
Get the accepted primitive type from its textual representation TypeTextRepresentation.
| TypeTextRepresentation | The textual representation of the type. |
Definition at line 572 of file JSONExporter.cpp.
Referenced by importArrays().
|
static |
References PollyCategory.
Referenced by polly::runImportJSON().
| STATISTIC | ( | NewAccessMapFound | , |
| "Number of updated access functions" | ) |
References PollyCategory.