13#ifndef POLLY_LOOP_GENERATORS_H
14#define POLLY_LOOP_GENERATORS_H
18#include "llvm/ADT/SetVector.h"
21using llvm::AllocaInst;
22using llvm::BasicBlock;
23using llvm::DataLayout;
24using llvm::DominatorTree;
75Value *
createLoop(Value *LowerBound, Value *UpperBound, Value *Stride,
77 BasicBlock *&ExitBlock, ICmpInst::Predicate Predicate,
78 ScopAnnotator *Annotator =
nullptr,
bool Parallel =
false,
79 bool UseGuard =
true,
bool LoopVectDisabled =
false);
133 DL.getPointerSizeInBits())),
134 M(
Builder.GetInsertBlock()->getParent()->getParent()),
136 Builder.GetInsertBlock()->getParent())) {}
158 SetVector<Value *> &Values,
ValueMapT &VMap,
159 BasicBlock::iterator *LoopBody);
222 Value *LB, Value *UB, Value *Stride) = 0;
243 virtual std::tuple<Value *, Function *>
244 createSubFn(Value *Stride, AllocaInst *Struct, SetVector<Value *> UsedValues,
polly dump Polly Dump Function
polly dump Polly Dump Module
The ParallelLoopGenerator allows to create parallelized loops.
LoopInfo * getCalleeLoopInfo() const
Returns the LoopInfo for the generated subfunction.
PollyIRBuilder & Builder
The IR builder we use to create instructions.
Function * createSubFnDefinition()
Create the definition of the parallel subfunction.
std::unique_ptr< DominatorTree > SubFnDT
The dominance tree for the generated subfunction.
virtual ~ParallelLoopGenerator()
virtual void deployParallelExecution(Function *SubFn, Value *SubFnParam, Value *LB, Value *UB, Value *Stride)=0
Create the runtime library calls for spawn and join of the worker threads.
Value * createParallelLoop(Value *LB, Value *UB, Value *Stride, SetVector< Value * > &Values, ValueMapT &VMap, BasicBlock::iterator *LoopBody)
Create a parallel loop.
virtual std::tuple< Value *, Function * > createSubFn(Value *Stride, AllocaInst *Struct, SetVector< Value * > UsedValues, ValueMapT &VMap)=0
Create the parallel subfunction.
Module * M
The current module.
DominatorTree * getCalleeDominatorTree() const
Returns the DominatorTree for the generated subfunction.
llvm::DebugLoc DLGenerated
Debug location for generated code without direct link to any specific line.
ParallelLoopGenerator(PollyIRBuilder &Builder, const DataLayout &DL)
Create a parallel loop generator for the current function.
Type * LongType
The type of a "long" on this hardware used for backend calls.
void extractValuesFromStruct(SetVector< Value * > Values, Type *Ty, Value *Struct, ValueMapT &VMap)
Extract all values from the Struct and construct the mapping.
virtual Function * prepareSubFnDefinition(Function *F) const =0
Prepare the definition of the parallel subfunction.
std::unique_ptr< LoopInfo > SubFnLI
The loop info for the generated subfunction.
AllocaInst * storeValuesIntoStruct(SetVector< Value * > &Values)
Create a struct for all Values and store them in there.
OMPGeneralSchedulingType PollyScheduling
llvm::DebugLoc createDebugLocForGeneratedCode(Function *F)
Create a DebugLoc representing generated instructions.
@ Value
MemoryKind::Value: Models an llvm::Value.
Value * createLoop(Value *LowerBound, Value *UpperBound, Value *Stride, PollyIRBuilder &Builder, LoopInfo &LI, DominatorTree &DT, BasicBlock *&ExitBlock, ICmpInst::Predicate Predicate, ScopAnnotator *Annotator=nullptr, bool Parallel=false, bool UseGuard=true, bool LoopVectDisabled=false)
Create a scalar do/for-style loop.
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.