Polly 20.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>
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 |
polly print import Polly Print Scop import | result |
#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.
S | The Scop containing the arrays. |
Definition at line 100 of file JSONExporter.cpp.
References polly::Array.
Referenced by getJSON().
|
static |
Definition at line 177 of file JSONExporter.cpp.
References getFileName(), getJSON(), and jscop.
Referenced by polly::JSONExportPass::run().
|
static |
Definition at line 85 of file JSONExporter.cpp.
Referenced by exportScop(), and importScop().
|
static |
Definition at line 131 of file JSONExporter.cpp.
References exportArrays(), and polly::getDebugLocation().
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_free(), isl_set_has_equal_space(), isl_set_intersect(), isl_set_intersect_params(), isl_set_is_subset(), and isl::manage().
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(), 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, 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(), and isl::manage().
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, and result.
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 | |||
) |
INITIALIZE_PASS_END | ( | JSONExporter | , |
"polly-export-jscop" | , | ||
"Polly - Export Scops as JSON" " (Writes a .jscop file for each Scop)" | , | ||
false | , | ||
false | |||
) |
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().
|
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" | |||
) |
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().
Definition at line 881 of file JSONExporter.cpp.
Referenced by basic_map_partial_lexopt_base(), basic_map_partial_lexopt_base_pw_multi_aff(), importScop(), int_test_abs(), int_test_add(), int_test_cdiv(), int_test_divexact(), int_test_fdiv(), int_test_fdiv_r(), int_test_gcd(), int_test_lcm(), int_test_mul(), int_test_neg(), int_test_sub(), int_test_tdiv(), isl_basic_map_floordiv(), isl_map_apply_range(), isl_map_deltas(), isl_map_sum(), isl_sioimath_get_d(), isl_sioimath_get_si(), isl_sioimath_get_str(), isl_sioimath_get_ui(), last_later_source(), last_source(), main(), map_intersect_internal(), map_intersect_set(), map_product(), monotonicity(), and test_constructors().