1 //===-- NVPTXUtilities - Utilities -----------------------------*- C++ -*-====//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declaration of the NVVM specific utility functions.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
17 #include "llvm/IR/Function.h"
18 #include "llvm/IR/GlobalVariable.h"
19 #include "llvm/IR/IntrinsicInst.h"
20 #include "llvm/IR/Value.h"
28 void clearAnnotationCache(const Module *);
30 bool findOneNVVMAnnotation(const GlobalValue *, const std::string &,
32 bool findAllNVVMAnnotation(const GlobalValue *, const std::string &,
33 std::vector<unsigned> &);
35 bool isTexture(const Value &);
36 bool isSurface(const Value &);
37 bool isSampler(const Value &);
38 bool isImage(const Value &);
39 bool isImageReadOnly(const Value &);
40 bool isImageWriteOnly(const Value &);
41 bool isImageReadWrite(const Value &);
42 bool isManaged(const Value &);
44 std::string getTextureName(const Value &);
45 std::string getSurfaceName(const Value &);
46 std::string getSamplerName(const Value &);
48 bool getMaxNTIDx(const Function &, unsigned &);
49 bool getMaxNTIDy(const Function &, unsigned &);
50 bool getMaxNTIDz(const Function &, unsigned &);
52 bool getReqNTIDx(const Function &, unsigned &);
53 bool getReqNTIDy(const Function &, unsigned &);
54 bool getReqNTIDz(const Function &, unsigned &);
56 bool getMinCTASm(const Function &, unsigned &);
57 bool getMaxNReg(const Function &, unsigned &);
58 bool isKernelFunction(const Function &);
60 bool getAlign(const Function &, unsigned index, unsigned &);
61 bool getAlign(const CallInst &, unsigned index, unsigned &);