14 #ifndef LLVM_OPENMP_IR_IRBUILDER_H 15 #define LLVM_OPENMP_IR_IRBUILDER_H 70 FinalizationStack.push_back(FI);
115 template <
typename T,
typename U>
117 : IP(IRB.saveIP()), DL(IRB.getCurrentDebugLocation()) {}
139 bool ForceSimpleCall =
false,
140 bool CheckCancelFlag =
true);
176 Builder.restoreIP(Loc.
IP);
177 Builder.SetCurrentDebugLocation(Loc.
DL);
178 return Loc.
IP.getBlock() !=
nullptr;
188 Constant *getOrCreateDefaultSrcLocStr();
201 void emitCancelationCheckImpl(
Value *CancelFlag,
215 bool CheckCancelFlag);
225 return !FinalizationStack.
empty() &&
226 FinalizationStack.
back().IsCancellable &&
227 FinalizationStack.
back().DK ==
DK;
250 #endif // LLVM_IR_IRBUILDER_H
RuntimeFunction
IDs for all omp runtime library (RTL) functions.
void popFinalizationCB()
Pop the last finalization callback from the finalization stack.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
FinalizeCallbackTy FiniCB
The finalization callback provided by the last in-flight invocation of CreateXXXX for the directive o...
An efficient, type-erasing, non-owning reference to a callable.
LocationDescription(const IRBuilder< T, U > &IRB)
IRBuilder<>::InsertPoint InsertPointTy
Type used throughout for insertion points.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Directive
IDs for all OpenMP directives.
ProcBindKind
IDs for the different proc bind kinds.
InsertPointTy CreateCancel(const LocationDescription &Loc, Value *IfCondition, omp::Directive CanceledDirective)
Generator for '#omp cancel'.
LocationDescription(const InsertPointTy &IP, const DebugLoc &DL)
void addAttributes(omp::RuntimeFunction FnID, Function &Fn)
Add attributes known for FnID to Fn.
void pushFinalizationCB(const FinalizationInfo &FI)
Push a finalization callback on the finalization stack.
LocationDescription(const InsertPointTy &IP)
LLVM Basic Block Representation.
bool IsCancellable
Flag to indicate if the directive is cancellable.
This is an important base class in LLVM.
void initialize()
Initialize the internal state, this will put structures types and potentially other helpers into the ...
IRBuilder ::InsertPoint CreateParallel(const LocationDescription &Loc, BodyGenCallbackTy BodyGenCB, PrivatizeCallbackTy PrivCB, FinalizeCallbackTy FiniCB, Value *IfCondition, Value *NumThreads, omp::ProcBindKind ProcBind, bool IsCancellable)
Generator for '#omp parallel'.
This file defines constans and helpers used when dealing with OpenMP.
An interface to create LLVM-IR for OpenMP directives.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
OpenMPIRBuilder(Module &M)
Create a new OpenMPIRBuilder operating on the given module M.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
InsertPointTy CreateBarrier(const LocationDescription &Loc, omp::Directive DK, bool ForceSimpleCall=false, bool CheckCancelFlag=true)
Emitter methods for OpenMP directives.
LLVM_NODISCARD bool empty() const
Description of a LLVM-IR insertion point (IP) and a debug/source location (filename, line, column, ...).
omp::Directive DK
The directive kind of the innermost directive that has an associated region which might require final...
std::function< void(InsertPointTy CodeGenIP)> FinalizeCallbackTy
Callback type for variable finalization (think destructors).
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
IdentFlag
IDs for all omp runtime library ident_t flag encodings (see their defintion in openmp/runtime/src/kmp...