NVPTXUtilities.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
  13. #define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H
  14. #include "llvm/IR/Function.h"
  15. #include "llvm/IR/GlobalVariable.h"
  16. #include "llvm/IR/IntrinsicInst.h"
  17. #include "llvm/IR/Value.h"
  18. #include <cstdarg>
  19. #include <set>
  20. #include <string>
  21. #include <vector>
  22. namespace llvm {
  23. void clearAnnotationCache(const Module *);
  24. bool findOneNVVMAnnotation(const GlobalValue *, const std::string &,
  25. unsigned &);
  26. bool findAllNVVMAnnotation(const GlobalValue *, const std::string &,
  27. std::vector<unsigned> &);
  28. bool isTexture(const Value &);
  29. bool isSurface(const Value &);
  30. bool isSampler(const Value &);
  31. bool isImage(const Value &);
  32. bool isImageReadOnly(const Value &);
  33. bool isImageWriteOnly(const Value &);
  34. bool isImageReadWrite(const Value &);
  35. bool isManaged(const Value &);
  36. std::string getTextureName(const Value &);
  37. std::string getSurfaceName(const Value &);
  38. std::string getSamplerName(const Value &);
  39. bool getMaxNTIDx(const Function &, unsigned &);
  40. bool getMaxNTIDy(const Function &, unsigned &);
  41. bool getMaxNTIDz(const Function &, unsigned &);
  42. bool getReqNTIDx(const Function &, unsigned &);
  43. bool getReqNTIDy(const Function &, unsigned &);
  44. bool getReqNTIDz(const Function &, unsigned &);
  45. bool getMinCTASm(const Function &, unsigned &);
  46. bool getMaxNReg(const Function &, unsigned &);
  47. bool isKernelFunction(const Function &);
  48. bool getAlign(const Function &, unsigned index, unsigned &);
  49. bool getAlign(const CallInst &, unsigned index, unsigned &);
  50. }
  51. #endif