[obj2yaml] - Fix BB after r373315.
[llvm-complete.git] / lib / Target / NVPTX / NVPTXUtilities.h
blobbf1524194cfb992ec9649c12f542f2ef990938a7
1 //===-- NVPTXUtilities - Utilities -----------------------------*- C++ -*-====//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the NVVM specific utility functions.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
14 #define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
16 #include "llvm/IR/Function.h"
17 #include "llvm/IR/GlobalVariable.h"
18 #include "llvm/IR/IntrinsicInst.h"
19 #include "llvm/IR/Value.h"
20 #include <cstdarg>
21 #include <set>
22 #include <string>
23 #include <vector>
25 namespace llvm {
27 void clearAnnotationCache(const Module *);
29 bool findOneNVVMAnnotation(const GlobalValue *, const std::string &,
30 unsigned &);
31 bool findAllNVVMAnnotation(const GlobalValue *, const std::string &,
32 std::vector<unsigned> &);
34 bool isTexture(const Value &);
35 bool isSurface(const Value &);
36 bool isSampler(const Value &);
37 bool isImage(const Value &);
38 bool isImageReadOnly(const Value &);
39 bool isImageWriteOnly(const Value &);
40 bool isImageReadWrite(const Value &);
41 bool isManaged(const Value &);
43 std::string getTextureName(const Value &);
44 std::string getSurfaceName(const Value &);
45 std::string getSamplerName(const Value &);
47 bool getMaxNTIDx(const Function &, unsigned &);
48 bool getMaxNTIDy(const Function &, unsigned &);
49 bool getMaxNTIDz(const Function &, unsigned &);
51 bool getReqNTIDx(const Function &, unsigned &);
52 bool getReqNTIDy(const Function &, unsigned &);
53 bool getReqNTIDz(const Function &, unsigned &);
55 bool getMinCTASm(const Function &, unsigned &);
56 bool getMaxNReg(const Function &, unsigned &);
57 bool isKernelFunction(const Function &);
59 bool getAlign(const Function &, unsigned index, unsigned &);
60 bool getAlign(const CallInst &, unsigned index, unsigned &);
64 #endif