2012-05-05 04:18:50 +08:00
|
|
|
//===-- NVPTXUtilities - Utilities -----------------------------*- C++ -*-====//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the declaration of the NVVM specific utility functions.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
|
|
|
|
#define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2013-01-02 19:36:10 +08:00
|
|
|
#include "llvm/IR/Function.h"
|
|
|
|
#include "llvm/IR/GlobalVariable.h"
|
|
|
|
#include "llvm/IR/IntrinsicInst.h"
|
|
|
|
#include "llvm/IR/Value.h"
|
2012-05-05 04:18:50 +08:00
|
|
|
#include <cstdarg>
|
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2013-03-30 22:29:21 +08:00
|
|
|
namespace llvm {
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
void clearAnnotationCache(const Module *);
|
2014-04-09 23:38:52 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
bool findOneNVVMAnnotation(const GlobalValue *, const std::string &,
|
2016-06-09 03:09:22 +08:00
|
|
|
unsigned &);
|
2016-12-15 06:32:44 +08:00
|
|
|
bool findAllNVVMAnnotation(const GlobalValue *, const std::string &,
|
2012-05-05 04:18:50 +08:00
|
|
|
std::vector<unsigned> &);
|
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
bool isTexture(const Value &);
|
|
|
|
bool isSurface(const Value &);
|
|
|
|
bool isSampler(const Value &);
|
|
|
|
bool isImage(const Value &);
|
|
|
|
bool isImageReadOnly(const Value &);
|
|
|
|
bool isImageWriteOnly(const Value &);
|
|
|
|
bool isImageReadWrite(const Value &);
|
|
|
|
bool isManaged(const Value &);
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
std::string getTextureName(const Value &);
|
|
|
|
std::string getSurfaceName(const Value &);
|
|
|
|
std::string getSamplerName(const Value &);
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
bool getMaxNTIDx(const Function &, unsigned &);
|
|
|
|
bool getMaxNTIDy(const Function &, unsigned &);
|
|
|
|
bool getMaxNTIDz(const Function &, unsigned &);
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
bool getReqNTIDx(const Function &, unsigned &);
|
|
|
|
bool getReqNTIDy(const Function &, unsigned &);
|
|
|
|
bool getReqNTIDz(const Function &, unsigned &);
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
bool getMinCTASm(const Function &, unsigned &);
|
2016-12-15 06:32:50 +08:00
|
|
|
bool getMaxNReg(const Function &, unsigned &);
|
2016-12-15 06:32:44 +08:00
|
|
|
bool isKernelFunction(const Function &);
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2016-12-15 06:32:44 +08:00
|
|
|
bool getAlign(const Function &, unsigned index, unsigned &);
|
|
|
|
bool getAlign(const CallInst &, unsigned index, unsigned &);
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
}
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
#endif
|