13#ifndef POLLY_LOOP_GENERATORS_KMP_H
14#define POLLY_LOOP_GENERATORS_KMP_H
19#include "llvm/ADT/SetVector.h"
22using llvm::GlobalValue;
23using llvm::GlobalVariable;
70 Value *UB, Value *Stride);
73 Value *UB, Value *Stride)
override;
77 std::tuple<Value *, Function *>
createSubFn(Value *Stride, AllocaInst *Struct,
78 SetVector<Value *> UsedValues,
102 Value *Inc, Value *ChunkSize);
116 Value *LBPtr, Value *UBPtr, Value *StridePtr);
129 Value *LBPtr, Value *UBPtr, Value *StridePtr,
polly dump Polly Dump Function
This ParallelLoopGenerator subclass handles the generation of parallelized code, utilizing the LLVM O...
ParallelLoopGeneratorKMP(PollyIRBuilder &Builder, const DataLayout &DL)
Create a parallel loop generator for the current function.
void createCallStaticFini(Value *GlobalThreadID)
Create a runtime library call to mark the end of a statically scheduled loop.
Function * prepareSubFnDefinition(Function *F) const override
Prepare the definition of the parallel subfunction.
void createCallSpawnThreads(Value *SubFn, Value *SubFnParam, Value *LB, Value *UB, Value *Stride)
Create a runtime library call to spawn the worker threads.
void createCallDispatchInit(Value *GlobalThreadID, Value *LB, Value *UB, Value *Inc, Value *ChunkSize)
Create a runtime library call to prepare the OpenMP runtime.
std::tuple< Value *, Function * > createSubFn(Value *Stride, AllocaInst *Struct, SetVector< Value * > UsedValues, ValueMapT &VMap) override
Create the parallel subfunction.
void createCallStaticInit(Value *GlobalThreadID, Value *IsLastPtr, Value *LBPtr, Value *UBPtr, Value *StridePtr, Value *ChunkSize)
Create a runtime library call to prepare the OpenMP runtime.
GlobalVariable * createSourceLocation()
Create the current source location.
void deployParallelExecution(Function *SubFn, Value *SubFnParam, Value *LB, Value *UB, Value *Stride) override
Create the runtime library calls for spawn and join of the worker threads.
void createCallPushNumThreads(Value *GlobalThreadID, Value *NumThreads)
Create a runtime library call to request a number of threads.
OMPGeneralSchedulingType getSchedType(int ChunkSize, OMPGeneralSchedulingType Scheduling) const
Convert the combination of given chunk size and scheduling type (which might have been set via the co...
Value * createCallDispatchNext(Value *GlobalThreadID, Value *IsLastPtr, Value *LBPtr, Value *UBPtr, Value *StridePtr)
Create a runtime library call to retrieve the next (dynamically) allocated chunk of work for this thr...
bool is64BitArch()
Returns True if 'LongType' is 64bit wide, otherwise: False.
GlobalValue * SourceLocationInfo
The source location struct of this loop.
Value * createCallGlobalThreadNum()
Create a runtime library call to get the current global thread number.
The ParallelLoopGenerator allows to create parallelized loops.
PollyIRBuilder & Builder
The IR builder we use to create instructions.
@ Value
MemoryKind::Value: Models an llvm::Value.
OMPGeneralSchedulingType
General scheduling types of parallel OpenMP for loops.
llvm::IRBuilder< llvm::ConstantFolder, IRInserter > PollyIRBuilder
llvm::DenseMap< llvm::AssertingVH< llvm::Value >, llvm::AssertingVH< llvm::Value > > ValueMapT
Type to remap values.