13#ifndef POLLY_SUPPORT_GIC_HELPER_H
14#define POLLY_SUPPORT_GIC_HELPER_H
16#include "llvm/ADT/APInt.h"
17#include "llvm/IR/DiagnosticInfo.h"
18#include "llvm/Support/raw_ostream.h"
153#define ISL_CPP_OBJECT_TO_STRING(name) \
154 inline std::string stringFromIslObj(const name &Obj, \
155 std::string DefaultValue = "") { \
156 return stringFromIslObj(Obj.get(), DefaultValue); \
159#define ISL_OBJECT_TO_STRING(name) \
160 std::string stringFromIslObj(__isl_keep isl_##name *Obj, \
161 std::string DefaultValue = ""); \
162 ISL_CPP_OBJECT_TO_STRING(isl::name)
189#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
193#define ISL_DUMP_OBJECT(name) \
194 void dumpIslObj(const isl::name &Obj); \
195 void dumpIslObj(isl_##name *Obj);
246 OS << polly::stringFromIslObj(Map,
"null");
252 OS << polly::stringFromIslObj(Map,
"null");
258 OS << polly::stringFromIslObj(Set,
"null");
264 OS << polly::stringFromIslObj(Map,
"null");
270 OS << polly::stringFromIslObj(PMA,
"null");
276 OS << polly::stringFromIslObj(MA,
"null");
282 OS << polly::stringFromIslObj(UPMA,
"null");
288 OS << polly::stringFromIslObj(Schedule,
"null");
294 OS << polly::stringFromIslObj(Space,
"null");
313 const llvm::Value *Val,
long Number,
314 const std::string &Suffix,
332 const std::string &Middle,
long Number,
333 const std::string &Suffix,
337 const std::string &Middle,
338 const std::string &Suffix);
340inline llvm::DiagnosticInfoOptimizationBase &
341operator<<(llvm::DiagnosticInfoOptimizationBase &OS,
343 OS << stringFromIslObj(Obj);
366 Other.IslCtx =
nullptr;
369 std::swap(this->IslCtx,
Other.IslCtx);
370 std::swap(this->OldOnError,
Other.OldOnError);
381 if (LocalMaxOps == 0) {
382 this->IslCtx =
nullptr;
398 "Incorrect nesting");
450 bool AutoEnter =
true)
454 "Nested max operations not supported");
464 this->IslCtx =
nullptr;
#define ISL_DUMP_OBJECT(name)
C++ wrapper for isl_*_dump() functions.
#define ISL_OBJECT_TO_STRING(name)
struct isl_union_pw_multi_aff isl_union_pw_multi_aff
struct isl_multi_aff isl_multi_aff
__isl_give isl_val * release()
Scoped limit of ISL operations.
isl_ctx * IslCtx
The ISL context to set the operations limit.
bool hasQuotaExceeded() const
Return whether the current quota has exceeded.
IslMaxOperationsGuard(isl_ctx *IslCtx, unsigned long LocalMaxOps, bool AutoEnter=true)
Enter a max operations scope.
IslQuotaScope enter(bool AllowReturnNull=true)
Enter a scope that can handle out-of-quota errors.
unsigned long LocalMaxOps
Maximum number of operations for the scope.
IslQuotaScope TopLevelScope
When AutoEnter is enabled, holds the IslQuotaScope object.
Scope guard for code that allows arbitrary isl function to return an error if the max-operations quot...
const IslQuotaScope & operator=(IslQuotaScope &&Other)
IslQuotaScope(IslQuotaScope &&Other)
IslQuotaScope(const IslQuotaScope &)=delete
IslQuotaScope(isl_ctx *IslCtx, unsigned long LocalMaxOps)
Enter a quota-aware scope.
bool hasQuotaExceeded() const
Return whether the current quota has exceeded.
enum isl_error isl_ctx_last_error(isl_ctx *ctx)
unsigned long isl_ctx_get_max_operations(isl_ctx *ctx)
void isl_ctx_reset_operations(isl_ctx *ctx)
void isl_ctx_reset_error(isl_ctx *ctx)
void isl_ctx_set_max_operations(isl_ctx *ctx, unsigned long max_operations)
__isl_export __isl_give ISL_HMAP __isl_take ISL_KEY __isl_take ISL_VAL * val
These are automatically generated checked C++ bindings for isl.
boolean manage(isl_bool val)
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
std::string getIslCompatibleName(const std::string &Prefix, const llvm::Value *Val, long Number, const std::string &Suffix, bool UseInstructionNames)
Combine Prefix, Val (or Number) and Suffix to an isl-compatible name.
__isl_give isl_val * isl_valFromAPInt(isl_ctx *Ctx, const llvm::APInt Int, bool IsSigned)
Translate an llvm::APInt to an isl_val.
raw_ostream & operator<<(raw_ostream &OS, MemoryAccess::ReductionType RT)
isl::val valFromAPInt(isl_ctx *Ctx, const llvm::APInt Int, bool IsSigned)
Translate an llvm::APInt to an isl::val.
void dumpIslObj(const isl::schedule_node &Node, llvm::raw_ostream &OS)
Emit the equivaltent of the isl_*_dump output into a raw_ostream.
llvm::APInt APIntFromVal(__isl_take isl_val *Val)
Translate isl_val to llvm::APInt.
isl_stat isl_options_set_on_error(isl_ctx *ctx, int val)
int isl_options_get_on_error(isl_ctx *ctx)
#define ISL_ON_ERROR_CONTINUE