Coverage Report

Created: 2018-09-25 00:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/AMDGPU/AMDGPUGenIntrinsicImpl.inc
Line
Count
Source (jump to first uncovered line)
1
519
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
519
|*                                                                            *|
3
519
|* Intrinsic Function Source Fragment                                         *|
4
519
|*                                                                            *|
5
519
|* Automatically generated file, do not edit!                                 *|
6
519
|*                                                                            *|
7
519
\*===----------------------------------------------------------------------===*/
8
519
9
519
// VisualStudio defines setjmp as _setjmp
10
#if defined(_MSC_VER) && defined(setjmp) && \
11
                         !defined(setjmp_undefined_for_msvc)
12
#  pragma push_macro("setjmp")
13
#  undef setjmp
14
#  define setjmp_undefined_for_msvc
15
#endif
16
17
519
// Target mapping
18
#ifdef GET_INTRINSIC_TARGET_DATA
19
struct IntrinsicTargetInfo {
20
  llvm::StringLiteral Name;
21
  size_t Offset;
22
  size_t Count;
23
};
24
static constexpr IntrinsicTargetInfo TargetInfos[] = {
25
  {llvm::StringLiteral(""), 0, 0},
26
  {llvm::StringLiteral("AMDGPU"), 0, 1},
27
  {llvm::StringLiteral("SI"), 1, 3},
28
};
29
#endif
30
31
519
// Intrinsic ID to name table
32
#ifdef GET_INTRINSIC_NAME_TABLE
33
  // Note that entry #0 is the invalid intrinsic!
34
  "llvm.AMDGPU.kill",
35
  "llvm.SI.buffer.load.dword",
36
  "llvm.SI.load.const",
37
  "llvm.SI.tbuffer.store",
38
#endif
39
40
519
// Intrinsic ID to overload bitset
41
519
#ifdef GET_INTRINSIC_OVERLOAD_TABLE
42
519
static const uint8_t OTable[] = {
43
519
  0 | (1<<2) | (1<<3) | (1<<4)
44
519
};
45
519
46
519
return (OTable[id/8] & (1 << (id%8))) != 0;
47
519
#endif
48
519
49
519
// Global intrinsic function declaration type table.
50
#ifdef GET_INTRINSIC_GENERATOR_GLOBAL
51
static const unsigned IIT_Table[] = {
52
  0x70, (1U<<31) | 17, 0x41f7, (1U<<31) | 0, 0
53
};
54
55
static const unsigned char IIT_LongEncodingTable[] = {
56
  /* 0 */ 0, 15, 1, 15, 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,
57
  /* 17 */ 15, 1, 15, 9, 15, 17, 4, 4, 4, 4, 4, 4, 4, 0,
58
  255
59
};
60
61
#endif
62
63
519
// Add parameter attributes that are not common to all intrinsics.
64
#ifdef GET_INTRINSIC_ATTRIBUTES
65
0
static AttributeList getAttributes(LLVMContext &C, AMDGPUIntrinsic::ID id) {
66
0
  static const uint8_t IntrinsicsToAttributesMap[] = {
67
0
    1, // llvm.AMDGPU.kill
68
0
    2, // llvm.SI.buffer.load.dword
69
0
    3, // llvm.SI.load.const
70
0
    1, // llvm.SI.tbuffer.store
71
0
  };
72
0
73
0
  AttributeList AS[1];
74
0
  unsigned NumAttrs = 0;
75
0
  if (id != 0) {
76
0
    switch(IntrinsicsToAttributesMap[id - Intrinsic::num_intrinsics]) {
77
0
    default: llvm_unreachable("Invalid attribute number");
78
0
    case 1: {
79
0
      const Attribute::AttrKind Atts[] = {Attribute::NoUnwind};
80
0
      AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
81
0
      NumAttrs = 1;
82
0
      break;
83
0
      }
84
0
    case 2: {
85
0
      const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::ReadOnly,Attribute::ArgMemOnly};
86
0
      AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
87
0
      NumAttrs = 1;
88
0
      break;
89
0
      }
90
0
    case 3: {
91
0
      const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::ReadNone};
92
0
      AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
93
0
      NumAttrs = 1;
94
0
      break;
95
0
      }
96
0
    }
97
0
  }
98
0
  return AttributeList::get(C, makeArrayRef(AS, NumAttrs));
99
0
}
100
#endif // GET_INTRINSIC_ATTRIBUTES
101
102
519
// Get the LLVM intrinsic that corresponds to a builtin.
103
519
// This is used by the C front-end.  The builtin name is passed
104
519
// in as BuiltinName, and a target prefix (e.g. 'ppc') is passed
105
519
// in as TargetPrefix.  The result is assigned to 'IntrinsicID'.
106
#ifdef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
107
static AMDGPUIntrinsic::ID getIntrinsicForGCCBuiltin(const char *TargetPrefixStr, StringRef BuiltinNameStr) {
108
  return (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
109
}
110
#endif
111
112
519
// Get the LLVM intrinsic that corresponds to a builtin.
113
519
// This is used by the C front-end.  The builtin name is passed
114
519
// in as BuiltinName, and a target prefix (e.g. 'ppc') is passed
115
519
// in as TargetPrefix.  The result is assigned to 'IntrinsicID'.
116
#ifdef GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
117
static AMDGPUIntrinsic::ID getIntrinsicForMSBuiltin(const char *TargetPrefixStr, StringRef BuiltinNameStr) {
118
  return (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
119
}
120
#endif
121
122
#if defined(_MSC_VER) && defined(setjmp_undefined_for_msvc)
123
// let's return it to _setjmp state
124
#  pragma pop_macro("setjmp")
125
#  undef setjmp_undefined_for_msvc
126
#endif
127