summaryrefslogtreecommitdiff
path: root/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h
blob: 6cb8b9644642d1e7ae93e719ad3b215f0ca5497c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//===- AMDGPUIntrinsicInfo.h - AMDGPU Intrinsic Information ------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//==-----------------------------------------------------------------------===//
//
/// \file
/// \brief Interface for the AMDGPU Implementation of the Intrinsic Info class.
//
//===-----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINTRINSICINFO_H
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUINTRINSICINFO_H

#include "llvm/IR/Intrinsics.h"
#include "llvm/Target/TargetIntrinsicInfo.h"

namespace llvm {
class TargetMachine;

namespace AMDGPUIntrinsic {
enum ID {
  last_non_AMDGPU_intrinsic = Intrinsic::num_intrinsics - 1,
#define GET_INTRINSIC_ENUM_VALUES
#include "AMDGPUGenIntrinsics.inc"
#undef GET_INTRINSIC_ENUM_VALUES
      , num_AMDGPU_intrinsics
};

} // end namespace AMDGPUIntrinsic

class AMDGPUIntrinsicInfo final : public TargetIntrinsicInfo {
public:
  AMDGPUIntrinsicInfo();

  StringRef getName(unsigned IntrId, ArrayRef<Type *> Tys = None) const;

  std::string getName(unsigned IntrId, Type **Tys = nullptr,
                      unsigned NumTys = 0) const override;

  unsigned lookupName(const char *Name, unsigned Len) const override;
  bool isOverloaded(unsigned IID) const override;
  Function *getDeclaration(Module *M, unsigned ID,
                           Type **Tys = nullptr,
                           unsigned NumTys = 0) const override;

  Function *getDeclaration(Module *M, unsigned ID,
                           ArrayRef<Type *> = None) const;

  FunctionType *getType(LLVMContext &Context, unsigned ID,
                        ArrayRef<Type*> Tys = None) const;
};

} // end namespace llvm

#endif