Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
Loading...
Searching...
No Matches
LLVMCodeBuilder.h
Go to the documentation of this file.
1#ifndef PROTEUS_FRONTEND_LLVM_CODE_BUILDER_H
2#define PROTEUS_FRONTEND_LLVM_CODE_BUILDER_H
3
5
6#include <cstdint>
7#include <functional>
8#include <memory>
9#include <string>
10#include <tuple>
11#include <vector>
12
13namespace llvm {
14class AllocaInst;
15class ArrayType;
16class BasicBlock;
17class Function;
18class IRBuilderBase;
19class LLVMContext;
20class Module;
21class Type;
22} // namespace llvm
23
24namespace proteus {
25
30public:
32 LLVMCodeBuilder(std::unique_ptr<llvm::LLVMContext> Ctx,
33 std::unique_ptr<llvm::Module> Mod,
35 ~LLVMCodeBuilder() override;
36
37 TargetModelType getTargetModel() const override { return TargetModel; }
40 }
41
44
45 // -----------------------------------------------------------------------
46 // LLVM-specific (non-virtual) accessors.
47 // -----------------------------------------------------------------------
48
50 llvm::IRBuilderBase &getIRBuilder();
51
52 llvm::Function &getFunction();
53 llvm::Module &getModule();
54 llvm::LLVMContext &getContext();
55
57 std::unique_ptr<llvm::LLVMContext> takeLLVMContext();
59 std::unique_ptr<llvm::Module> takeModule();
60
61 // -----------------------------------------------------------------------
62 // Basic block operations.
63 // -----------------------------------------------------------------------
64 std::tuple<llvm::BasicBlock *, llvm::BasicBlock *> splitCurrentBlock();
65 llvm::BasicBlock *createBasicBlock(const std::string &Name = "",
66 llvm::BasicBlock *InsertBefore = nullptr);
67 void eraseTerminator(llvm::BasicBlock *BB);
68 llvm::BasicBlock *getUniqueSuccessor(llvm::BasicBlock *BB);
69
70 // -----------------------------------------------------------------------
71 // Scope management.
72 // -----------------------------------------------------------------------
73 void pushScope(const char *File, int Line, ScopeKind Kind,
74 llvm::BasicBlock *NextBlock);
75
76 // -----------------------------------------------------------------------
77 // Control flow (LLVM-specific overloads / extensions).
78 // -----------------------------------------------------------------------
79 void createBr(llvm::BasicBlock *Dest);
80 void createCondBr(IRValue *Cond, llvm::BasicBlock *True,
81 llvm::BasicBlock *False);
82
83 // -----------------------------------------------------------------------
84 // Type accessors.
85 // -----------------------------------------------------------------------
86 llvm::Type *getPointerType(unsigned AS);
87 llvm::Type *getPointerTypeUnqual();
88 llvm::Type *getInt16Ty();
89 llvm::Type *getInt32Ty();
90 llvm::Type *getInt64Ty();
91 llvm::Type *getFloatTy();
92
93 // -----------------------------------------------------------------------
94 // Type queries.
95 // -----------------------------------------------------------------------
96 unsigned getAddressSpace(llvm::Type *Ty);
97 bool isIntegerTy(llvm::Type *Ty);
98 bool isFloatingPointTy(llvm::Type *Ty);
99
100 // -----------------------------------------------------------------------
101 // Alloca/array emission.
102 // -----------------------------------------------------------------------
103 IRValue *emitAlloca(llvm::Type *Ty, const std::string &Name,
105 IRValue *emitArrayCreate(llvm::Type *Ty, AddressSpace AT,
106 const std::string &Name);
107
108 // -----------------------------------------------------------------------
109 // CodeBuilder overrides — function management.
110 // -----------------------------------------------------------------------
111 IRFunction *addFunction(const std::string &Name, IRType RetTy,
112 const std::vector<IRType> &ArgTys,
113 bool IsKernel = false) override;
114 void setFunctionName(IRFunction *F, const std::string &Name) override;
115 IRValue *getArg(IRFunction *F, size_t Idx) override;
116 void beginFunction(IRFunction *F, const char *File, int Line) override;
117 void endFunction() override;
118
119 // -----------------------------------------------------------------------
120 // CodeBuilder overrides — insertion point management.
121 // -----------------------------------------------------------------------
122 void setInsertPointAtEntry() override;
123 void clearInsertPoint() override;
124
125 // -----------------------------------------------------------------------
126 // CodeBuilder overrides — high-level control flow.
127 // -----------------------------------------------------------------------
128 void beginIf(IRValue *Cond, const char *File, int Line) override;
129 void endIf() override;
130 void beginFor(IRValue *IterSlot, IRType IterTy, IRValue *InitVal,
131 IRValue *UpperBoundVal, IRValue *IncVal, bool IsSigned,
132 const char *File, int Line, LoopHints Hints = {}) override;
133 void endFor() override;
134 void beginWhile(std::function<IRValue *()> CondFn, const char *File,
135 int Line) override;
136 void endWhile() override;
137 void createRetVoid() override;
138 void createRet(IRValue *V) override;
139
140 // -----------------------------------------------------------------------
141 // CodeBuilder overrides — arithmetic.
142 // -----------------------------------------------------------------------
143 IRValue *createArith(ArithOp Op, IRValue *LHS, IRValue *RHS,
144 IRType Ty) override;
145
146 // -----------------------------------------------------------------------
147 // CodeBuilder overrides — atomics.
148 // -----------------------------------------------------------------------
149 IRValue *createAtomicAdd(IRValue *Addr, IRValue *Val) override;
150 IRValue *createAtomicSub(IRValue *Addr, IRValue *Val) override;
151 IRValue *createAtomicMax(IRValue *Addr, IRValue *Val) override;
152 IRValue *createAtomicMin(IRValue *Addr, IRValue *Val) override;
153
154 // -----------------------------------------------------------------------
155 // CodeBuilder overrides — comparisons.
156 // -----------------------------------------------------------------------
157 IRValue *createCmp(CmpOp Op, IRValue *LHS, IRValue *RHS, IRType Ty) override;
158
159 // -----------------------------------------------------------------------
160 // CodeBuilder overrides — logical.
161 // -----------------------------------------------------------------------
162 IRValue *createAnd(IRValue *LHS, IRValue *RHS) override;
163 IRValue *createOr(IRValue *LHS, IRValue *RHS) override;
164 IRValue *createXor(IRValue *LHS, IRValue *RHS) override;
165 IRValue *createNot(IRValue *Val) override;
166
167 // -----------------------------------------------------------------------
168 // CodeBuilder overrides — load/store.
169 // -----------------------------------------------------------------------
171 const std::string &Name = "") override;
172 void createStore(IRValue *Val, IRValue *Ptr) override;
173
174 // -----------------------------------------------------------------------
175 // CodeBuilder overrides — casts.
176 // -----------------------------------------------------------------------
177 IRValue *createCast(IRValue *V, IRType FromTy, IRType ToTy) override;
178 IRValue *createBitCast(IRValue *V, IRType DestTy) override;
179 IRValue *createZExt(IRValue *V, IRType DestTy) override;
180
181 // -----------------------------------------------------------------------
182 // CodeBuilder overrides — constants.
183 // -----------------------------------------------------------------------
184 IRValue *getConstantInt(IRType Ty, uint64_t Val) override;
185 IRValue *getConstantFP(IRType Ty, double Val) override;
186
187 // -----------------------------------------------------------------------
188 // CodeBuilder overrides — GEP.
189 // -----------------------------------------------------------------------
190 VarAlloc getElementPtr(IRValue *Base, IRType BaseTy, IRValue *Index,
191 IRType ElemTy) override;
192 VarAlloc getElementPtr(IRValue *Base, IRType BaseTy, size_t Index,
193 IRType ElemTy) override;
194
195 // -----------------------------------------------------------------------
196 // CodeBuilder overrides — calls.
197 // -----------------------------------------------------------------------
198 IRValue *createCall(const std::string &FName, IRType RetTy,
199 const std::vector<IRType> &ArgTys,
200 const std::vector<IRValue *> &Args) override;
201 IRValue *createCall(const std::string &FName, IRType RetTy) override;
202 IRValue *emitIntrinsic(const std::string &Name, IRType RetTy,
203 const std::vector<IRValue *> &Args) override;
204 IRValue *emitBuiltin(const std::string &Name, IRType RetTy,
205 const std::vector<IRValue *> &Args) override;
206
207 // -----------------------------------------------------------------------
208 // CodeBuilder overrides — storage-aware load/store.
209 // -----------------------------------------------------------------------
210 IRValue *loadScalar(IRValue *Slot, IRType ValueTy) override;
211 void storeScalar(IRValue *Slot, IRValue *Val) override;
212 IRValue *loadAddress(IRValue *Slot, IRType AllocTy) override;
213 void storeAddress(IRValue *Slot, IRValue *Addr) override;
214 IRValue *loadFromPointee(IRValue *Slot, IRType AllocTy,
215 IRType ValueTy) override;
216 void storeToPointee(IRValue *Slot, IRType AllocTy, IRValue *Val) override;
217
218 // -----------------------------------------------------------------------
219 // CodeBuilder overrides — alloc factories.
220 // -----------------------------------------------------------------------
221 VarAlloc allocScalar(const std::string &Name, IRType ValueTy) override;
222 VarAlloc allocPointer(const std::string &Name, IRType ElemTy,
223 unsigned AddrSpace = 0) override;
224 VarAlloc allocArray(const std::string &Name, AddressSpace AS, IRType ElemTy,
225 size_t NElem) override;
226
227 // -----------------------------------------------------------------------
228 // CodeBuilder overrides — GPU kernel support.
229 // -----------------------------------------------------------------------
230#if defined(PROTEUS_ENABLE_CUDA) || defined(PROTEUS_ENABLE_HIP)
231 void setLaunchBoundsForKernel(IRFunction *F, int MaxThreadsPerBlock,
232 int MinBlocksPerSM) override;
233#endif
234
235private:
236 struct Impl;
237 std::unique_ptr<Impl> PImpl;
238 llvm::Function *F;
239 TargetModelType TargetModel;
240
242 llvm::Function *unwrapFunction(IRFunction *IRF);
243
244 // -----------------------------------------------------------------------
245 // Insertion point management (LLVM-specific extensions).
246 // -----------------------------------------------------------------------
247 void setInsertPoint(llvm::BasicBlock *BB);
248 void setInsertPointBegin(llvm::BasicBlock *BB);
249 llvm::BasicBlock *getInsertBlock();
250
251 // -----------------------------------------------------------------------
252 // Private low-level arithmetic dispatch (called by createArith).
253 // -----------------------------------------------------------------------
254 IRValue *createAdd(IRValue *LHS, IRValue *RHS);
255 IRValue *createFAdd(IRValue *LHS, IRValue *RHS);
256 IRValue *createSub(IRValue *LHS, IRValue *RHS);
257 IRValue *createFSub(IRValue *LHS, IRValue *RHS);
258 IRValue *createMul(IRValue *LHS, IRValue *RHS);
259 IRValue *createFMul(IRValue *LHS, IRValue *RHS);
260 IRValue *createUDiv(IRValue *LHS, IRValue *RHS);
261 IRValue *createSDiv(IRValue *LHS, IRValue *RHS);
262 IRValue *createFDiv(IRValue *LHS, IRValue *RHS);
263 IRValue *createURem(IRValue *LHS, IRValue *RHS);
264 IRValue *createSRem(IRValue *LHS, IRValue *RHS);
265 IRValue *createFRem(IRValue *LHS, IRValue *RHS);
266
267 // -----------------------------------------------------------------------
268 // Private low-level comparison dispatch (called by createCmp).
269 // -----------------------------------------------------------------------
270 IRValue *createICmpEQ(IRValue *LHS, IRValue *RHS);
271 IRValue *createICmpNE(IRValue *LHS, IRValue *RHS);
272 IRValue *createICmpSLT(IRValue *LHS, IRValue *RHS);
273 IRValue *createICmpSGT(IRValue *LHS, IRValue *RHS);
274 IRValue *createICmpSGE(IRValue *LHS, IRValue *RHS);
275 IRValue *createICmpSLE(IRValue *LHS, IRValue *RHS);
276 IRValue *createICmpUGT(IRValue *LHS, IRValue *RHS);
277 IRValue *createICmpUGE(IRValue *LHS, IRValue *RHS);
278 IRValue *createICmpULT(IRValue *LHS, IRValue *RHS);
279 IRValue *createICmpULE(IRValue *LHS, IRValue *RHS);
280 IRValue *createFCmpOEQ(IRValue *LHS, IRValue *RHS);
281 IRValue *createFCmpONE(IRValue *LHS, IRValue *RHS);
282 IRValue *createFCmpOLT(IRValue *LHS, IRValue *RHS);
283 IRValue *createFCmpOLE(IRValue *LHS, IRValue *RHS);
284 IRValue *createFCmpOGT(IRValue *LHS, IRValue *RHS);
285 IRValue *createFCmpOGE(IRValue *LHS, IRValue *RHS);
286 IRValue *createFCmpULT(IRValue *LHS, IRValue *RHS);
287 IRValue *createFCmpULE(IRValue *LHS, IRValue *RHS);
288
289 // -----------------------------------------------------------------------
290 // Private low-level cast dispatch (called by createCast).
291 // -----------------------------------------------------------------------
292 IRValue *createIntCast(IRValue *V, IRType DestTy, bool IsSigned);
293 IRValue *createFPCast(IRValue *V, IRType DestTy);
294 IRValue *createSIToFP(IRValue *V, IRType DestTy);
295 IRValue *createUIToFP(IRValue *V, IRType DestTy);
296 IRValue *createFPToSI(IRValue *V, IRType DestTy);
297 IRValue *createFPToUI(IRValue *V, IRType DestTy);
298
299 // -----------------------------------------------------------------------
300 // Private GEP helpers (called by getElementPtr).
301 // -----------------------------------------------------------------------
302 IRValue *createInBoundsGEP(IRType Ty, IRValue *Ptr,
303 const std::vector<IRValue *> &IdxList,
304 const std::string &Name = "");
305 // NOLINTNEXTLINE
306 IRValue *createConstInBoundsGEP1_64(IRType Ty, IRValue *Ptr, size_t Idx);
307 // NOLINTNEXTLINE
308 IRValue *createConstInBoundsGEP2_64(IRType Ty, IRValue *Ptr, size_t Idx0,
309 size_t Idx1);
310 unsigned getAddressSpaceFromValue(IRValue *PtrVal);
311
312 // -----------------------------------------------------------------------
313 // Private GPU kernel support.
314 // -----------------------------------------------------------------------
315#if defined(PROTEUS_ENABLE_CUDA) || defined(PROTEUS_ENABLE_HIP)
316 void setKernel(IRFunction *F);
317#endif
318};
319
320} // namespace proteus
321
322#endif // PROTEUS_FRONTEND_LLVM_CODE_BUILDER_H
char int void ** Args
Definition CompilerInterfaceHost.cpp:23
Definition CodeBuilder.h:70
Definition IRFunction.h:9
Definition IRValue.h:15
Definition LLVMCodeBuilder.h:29
void beginWhile(std::function< IRValue *()> CondFn, const char *File, int Line) override
Definition LLVMCodeBuilder.cpp:559
IRValue * createAtomicSub(IRValue *Addr, IRValue *Val) override
Definition LLVMCodeBuilder.cpp:671
IRValue * createOr(IRValue *LHS, IRValue *RHS) override
Definition LLVMCodeBuilder.cpp:780
llvm::Type * getPointerType(unsigned AS)
Definition LLVMCodeBuilder.cpp:1031
IRValue * createArith(ArithOp Op, IRValue *LHS, IRValue *RHS, IRType Ty) override
Definition LLVMCodeBuilder.cpp:911
IRValue * loadScalar(IRValue *Slot, IRType ValueTy) override
Load the value stored directly in Slot (scalar alloca).
Definition LLVMCodeBuilder.cpp:1246
llvm::LLVMContext & getContext()
Definition LLVMCodeBuilder.cpp:260
unsigned getAddressSpace(llvm::Type *Ty)
Definition LLVMCodeBuilder.cpp:1043
IRValue * createCmp(CmpOp Op, IRValue *LHS, IRValue *RHS, IRType Ty) override
Definition LLVMCodeBuilder.cpp:943
llvm::IRBuilderBase & getIRBuilder()
Get the underlying IRBuilderBase (internal use only).
Definition LLVMCodeBuilder.cpp:244
VarAlloc allocPointer(const std::string &Name, IRType ElemTy, unsigned AddrSpace=0) override
Definition LLVMCodeBuilder.cpp:1289
void beginIf(IRValue *Cond, const char *File, int Line) override
Definition LLVMCodeBuilder.cpp:411
llvm::Module & getModule()
Definition LLVMCodeBuilder.cpp:252
llvm::BasicBlock * createBasicBlock(const std::string &Name="", llvm::BasicBlock *InsertBefore=nullptr)
Definition LLVMCodeBuilder.cpp:342
IRValue * createAtomicMin(IRValue *Addr, IRValue *Val) override
Definition LLVMCodeBuilder.cpp:691
IRFunction * addFunction(const std::string &Name, IRType RetTy, const std::vector< IRType > &ArgTys, bool IsKernel=false) override
Definition LLVMCodeBuilder.cpp:268
llvm::Type * getInt32Ty()
Definition LLVMCodeBuilder.cpp:1038
void storeScalar(IRValue *Slot, IRValue *Val) override
Store Val directly into Slot (scalar alloca).
Definition LLVMCodeBuilder.cpp:1251
void endWhile() override
Definition LLVMCodeBuilder.cpp:593
IRValue * createZExt(IRValue *V, IRType DestTy) override
Definition LLVMCodeBuilder.cpp:870
VarAlloc allocArray(const std::string &Name, AddressSpace AS, IRType ElemTy, size_t NElem) override
Definition LLVMCodeBuilder.cpp:1298
void createBr(llvm::BasicBlock *Dest)
Definition LLVMCodeBuilder.cpp:804
IRValue * emitAlloca(llvm::Type *Ty, const std::string &Name, AddressSpace AS=AddressSpace::DEFAULT)
Definition LLVMCodeBuilder.cpp:1157
void eraseTerminator(llvm::BasicBlock *BB)
Definition LLVMCodeBuilder.cpp:348
IRValue * createBitCast(IRValue *V, IRType DestTy) override
Definition LLVMCodeBuilder.cpp:861
CodeBuilderKind getBackendKind() const override
Definition LLVMCodeBuilder.h:38
LLVMCodeBuilder(const LLVMCodeBuilder &)=delete
IRValue * createXor(IRValue *LHS, IRValue *RHS) override
Definition LLVMCodeBuilder.cpp:784
void createStore(IRValue *Val, IRValue *Ptr) override
Definition LLVMCodeBuilder.cpp:799
IRValue * getConstantInt(IRType Ty, uint64_t Val) override
Definition LLVMCodeBuilder.cpp:876
llvm::Type * getInt16Ty()
Definition LLVMCodeBuilder.cpp:1037
LLVMCodeBuilder(std::unique_ptr< llvm::LLVMContext > Ctx, std::unique_ptr< llvm::Module > Mod, TargetModelType TM=TargetModelType::HOST)
Construct as owner of LLVMContext and Module.
VarAlloc getElementPtr(IRValue *Base, IRType BaseTy, IRValue *Index, IRType ElemTy) override
Definition LLVMCodeBuilder.cpp:991
IRValue * createCast(IRValue *V, IRType FromTy, IRType ToTy) override
Definition LLVMCodeBuilder.cpp:979
llvm::BasicBlock * getUniqueSuccessor(llvm::BasicBlock *BB)
Definition LLVMCodeBuilder.cpp:355
void createRet(IRValue *V) override
Definition LLVMCodeBuilder.cpp:822
llvm::Type * getPointerTypeUnqual()
Definition LLVMCodeBuilder.cpp:1034
void beginFor(IRValue *IterSlot, IRType IterTy, IRValue *InitVal, IRValue *UpperBoundVal, IRValue *IncVal, bool IsSigned, const char *File, int Line, LoopHints Hints={}) override
Definition LLVMCodeBuilder.cpp:462
IRValue * emitIntrinsic(const std::string &Name, IRType RetTy, const std::vector< IRValue * > &Args) override
Lower a frontend intrinsic name to backend IR.
Definition LLVMCodeBuilder.cpp:1088
std::tuple< llvm::BasicBlock *, llvm::BasicBlock * > splitCurrentBlock()
Definition LLVMCodeBuilder.cpp:335
void endFor() override
Definition LLVMCodeBuilder.cpp:542
IRValue * createAtomicAdd(IRValue *Addr, IRValue *Val) override
Definition LLVMCodeBuilder.cpp:661
IRValue * createLoad(IRType Ty, IRValue *Ptr, const std::string &Name="") override
Definition LLVMCodeBuilder.cpp:793
std::unique_ptr< llvm::Module > takeModule()
Transfer ownership of the Module (leaves internal pointer null).
Definition LLVMCodeBuilder.cpp:308
IRValue * loadFromPointee(IRValue *Slot, IRType AllocTy, IRType ValueTy) override
Dereference the pointer stored in Slot, then load the pointee.
Definition LLVMCodeBuilder.cpp:1264
IRValue * createAnd(IRValue *LHS, IRValue *RHS) override
Definition LLVMCodeBuilder.cpp:776
std::unique_ptr< llvm::LLVMContext > takeLLVMContext()
Transfer ownership of the LLVMContext (leaves internal pointer null).
Definition LLVMCodeBuilder.cpp:304
bool isIntegerTy(llvm::Type *Ty)
Definition LLVMCodeBuilder.cpp:1055
TargetModelType getTargetModel() const override
Definition LLVMCodeBuilder.h:37
void storeToPointee(IRValue *Slot, IRType AllocTy, IRValue *Val) override
Dereference the pointer stored in Slot, then store Val to it.
Definition LLVMCodeBuilder.cpp:1272
void endFunction() override
Definition LLVMCodeBuilder.cpp:398
llvm::Type * getInt64Ty()
Definition LLVMCodeBuilder.cpp:1039
LLVMCodeBuilder & operator=(const LLVMCodeBuilder &)=delete
llvm::Function & getFunction()
Definition LLVMCodeBuilder.cpp:246
llvm::Type * getFloatTy()
Definition LLVMCodeBuilder.cpp:1040
IRValue * getConstantFP(IRType Ty, double Val) override
Definition LLVMCodeBuilder.cpp:879
IRValue * createAtomicMax(IRValue *Addr, IRValue *Val) override
Definition LLVMCodeBuilder.cpp:681
IRValue * loadAddress(IRValue *Slot, IRType AllocTy) override
Load the pointer stored in Slot (pointer alloca).
Definition LLVMCodeBuilder.cpp:1255
void storeAddress(IRValue *Slot, IRValue *Addr) override
Store Addr into Slot (pointer alloca).
Definition LLVMCodeBuilder.cpp:1260
void pushScope(const char *File, int Line, ScopeKind Kind, llvm::BasicBlock *NextBlock)
Definition LLVMCodeBuilder.cpp:364
void setInsertPointAtEntry() override
Definition LLVMCodeBuilder.cpp:322
void createRetVoid() override
Definition LLVMCodeBuilder.cpp:811
void createCondBr(IRValue *Cond, llvm::BasicBlock *True, llvm::BasicBlock *False)
Definition LLVMCodeBuilder.cpp:806
IRValue * emitArrayCreate(llvm::Type *Ty, AddressSpace AT, const std::string &Name)
Definition LLVMCodeBuilder.cpp:1170
IRValue * emitBuiltin(const std::string &Name, IRType RetTy, const std::vector< IRValue * > &Args) override
Definition LLVMCodeBuilder.cpp:1142
VarAlloc allocScalar(const std::string &Name, IRType ValueTy) override
Definition LLVMCodeBuilder.cpp:1283
void beginFunction(IRFunction *F, const char *File, int Line) override
Set F as the active function and begin IR emission.
Definition LLVMCodeBuilder.cpp:371
void endIf() override
Definition LLVMCodeBuilder.cpp:446
void clearInsertPoint() override
Definition LLVMCodeBuilder.cpp:328
IRValue * getArg(IRFunction *F, size_t Idx) override
Return the Nth argument of F as an IRValue.
Definition LLVMCodeBuilder.cpp:1308
void setFunctionName(IRFunction *F, const std::string &Name) override
Rename the function identified by F.
Definition LLVMCodeBuilder.cpp:299
IRValue * createNot(IRValue *Val) override
Definition LLVMCodeBuilder.cpp:788
bool isFloatingPointTy(llvm::Type *Ty)
Definition LLVMCodeBuilder.cpp:1056
IRValue * createCall(const std::string &FName, IRType RetTy, const std::vector< IRType > &ArgTys, const std::vector< IRValue * > &Args) override
Definition LLVMCodeBuilder.cpp:1061
Definition CompiledLibrary.h:7
Definition MemoryCache.h:27
AddressSpace
Definition AddressSpace.h:6
TargetModelType
Definition TargetModel.h:8
CodeBuilderKind
Definition CodeBuilder.h:66
ArithOp
Semantic arithmetic operation selector.
Definition CodeBuilder.h:43
CmpOp
Semantic comparison operation selector.
Definition CodeBuilder.h:46
void setLaunchBoundsForKernel(Function &F, int MaxThreadsPerSM, int MinBlocksPerSM=0)
Definition CoreLLVMCUDA.h:87
ScopeKind
Definition CodeBuilder.h:40
Definition IRType.h:34
Definition CodeBuilder.h:21
Definition CodeBuilder.h:29