LLVM  8.0.1
NVPTXUtilities.h
Go to the documentation of this file.
1 //===-- NVPTXUtilities - Utilities -----------------------------*- C++ -*-====//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the NVVM specific utility functions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
16 
17 #include "llvm/IR/Function.h"
18 #include "llvm/IR/GlobalVariable.h"
19 #include "llvm/IR/IntrinsicInst.h"
20 #include "llvm/IR/Value.h"
21 #include <cstdarg>
22 #include <set>
23 #include <string>
24 #include <vector>
25 
26 namespace llvm {
27 
28 void clearAnnotationCache(const Module *);
29 
30 bool findOneNVVMAnnotation(const GlobalValue *, const std::string &,
31  unsigned &);
32 bool findAllNVVMAnnotation(const GlobalValue *, const std::string &,
33  std::vector<unsigned> &);
34 
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 &);
43 
44 std::string getTextureName(const Value &);
45 std::string getSurfaceName(const Value &);
46 std::string getSamplerName(const Value &);
47 
48 bool getMaxNTIDx(const Function &, unsigned &);
49 bool getMaxNTIDy(const Function &, unsigned &);
50 bool getMaxNTIDz(const Function &, unsigned &);
51 
52 bool getReqNTIDx(const Function &, unsigned &);
53 bool getReqNTIDy(const Function &, unsigned &);
54 bool getReqNTIDz(const Function &, unsigned &);
55 
56 bool getMinCTASm(const Function &, unsigned &);
57 bool getMaxNReg(const Function &, unsigned &);
58 bool isKernelFunction(const Function &);
59 
60 bool getAlign(const Function &, unsigned index, unsigned &);
61 bool getAlign(const CallInst &, unsigned index, unsigned &);
62 
63 }
64 
65 #endif
bool getAlign(const Function &F, unsigned index, unsigned &align)
This class represents lattice values for constants.
Definition: AllocatorList.h:24
bool getMaxNReg(const Function &F, unsigned &x)
bool findOneNVVMAnnotation(const GlobalValue *gv, const std::string &prop, unsigned &retval)
bool findAllNVVMAnnotation(const GlobalValue *gv, const std::string &prop, std::vector< unsigned > &retval)
bool isTexture(const Value &val)
void clearAnnotationCache(const Module *Mod)
bool getMaxNTIDz(const Function &F, unsigned &z)
bool isKernelFunction(const Function &F)
bool isSurface(const Value &val)
bool getMaxNTIDx(const Function &F, unsigned &x)
std::string getTextureName(const Value &val)
bool isSampler(const Value &val)
bool getMaxNTIDy(const Function &F, unsigned &y)
bool getReqNTIDx(const Function &F, unsigned &x)
bool isImage(const Value &val)
bool getReqNTIDz(const Function &F, unsigned &z)
bool isImageReadWrite(const Value &val)
std::string getSurfaceName(const Value &val)
std::string getSamplerName(const Value &val)
bool isManaged(const Value &val)
bool getReqNTIDy(const Function &F, unsigned &y)
bool isImageReadOnly(const Value &val)
bool getMinCTASm(const Function &F, unsigned &x)
bool isImageWriteOnly(const Value &val)