//===--------------------------- ISLUtils.h -------------------------------===//
//
//===----------------------------------------------------------------------===//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Copyright (c) 2015 Advanced Micro Devices, Inc.  All rights reserved.
// Developed by: Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// with the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimers.
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimers in the documentation
// and/or other materials provided with the distribution.
// Neither the names of Advanced Micro Devices, Inc., nor the names of its
// contributors may be used to endorse or promote products derived from this
// Software without specific prior written permission.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
// THE SOFTWARE.
//
//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TRANSFORMS_UTILS_ISLUTILS_H
#define LLVM_TRANSFORMS_UTILS_ISLUTILS_H

#include "llvm/IR/Module.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/BasicBlock.h"

// ISL Headers:
#include "isl/ast.h"
#include "isl/ast_build.h"
#include "isl/aff.h"
#include "isl/constraint.h"
#include "isl/ctx.h"
#include "isl/id.h"
#include "isl/isl_space_private.h"
#include "isl/map.h"
#include "isl/options.h"
#include "isl/set.h"
#include "isl/union_set.h"
#include "isl/schedule.h"
#include "isl/schedule_node.h"
#include "isl/val.h"


namespace llvm {

void isl_print_map(isl_map *M);

void isl_print_space(isl_space *Sp);

void isl_print_set(isl_set *S);

void isl_print_aff(isl_aff *Aff);

void isl_print_id(isl_id *Id);

int getParamDim(isl_space *Sp, isl_id *Id);

int getParamDim(isl_map *M, isl_id *Id);

isl_map *getDimlessMap(isl_ctx *Ctx);

// []
isl_set *getDimlessSet(isl_ctx *Ctx);

// [p] -> {[] -> [p]}
isl_map *getParamMap(isl_id *ParamId, isl_ctx *Ctx);

// {[Const]}
isl_set *getConstSet(long Const, isl_ctx *Ctx);

// {[] -> [Const]}
isl_map *getConstMap(long Const, isl_ctx *Ctx);

isl_map *getUniversalMap(isl_ctx *Ctx);

isl_map* getMapForAff(isl_space *MapSp, isl_aff *Aff);

SmallVector<isl_map *, 1> getConstVecMap(Value *V, isl_ctx *Ctx);

unsigned getVecLength(Value *V);

bool isVector(Value *V);

long getConstIntAsLong(ConstantInt *CI);



}

#endif
