#include "polly/CodeGen/LoopGenerators.h"
#include "polly/Options.h"
#include "polly/ScopDetection.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
usingnamespacellvm;
usingnamespacepolly;
int polly::PollyNumThreads;
OMPGeneralSchedulingType polly::PollyScheduling;
int polly::PollyChunkSize;
static cl::opt<int, true>
XPollyNumThreads("polly-num-threads",
cl::desc("Number of threads to use (0 = auto)"),
cl::Hidden, cl::location(polly::PollyNumThreads),
cl::init(0), cl::cat(PollyCategory));
static cl::opt<OMPGeneralSchedulingType, true> XPollyScheduling(
"polly-scheduling",
cl::desc("Scheduling type of parallel OpenMP for loops"),
cl::values(clEnumValN(OMPGeneralSchedulingType::StaticChunked, "static",
"Static scheduling"),
clEnumValN(OMPGeneralSchedulingType::Dynamic, "dynamic",
"Dynamic scheduling"),
clEnumValN(OMPGeneralSchedulingType::Guided, "guided",
"Guided scheduling"),
clEnumValN(OMPGeneralSchedulingType::Runtime, "runtime",
"Runtime determined (OMP_SCHEDULE)")),
cl::Hidden, cl::location(polly::PollyScheduling),
cl::init(OMPGeneralSchedulingType::Runtime), cl::Optional,
cl::cat(PollyCategory));
static cl::opt<int, true>
XPollyChunkSize("polly-scheduling-chunksize",
cl::desc("Chunksize to use by the OpenMP runtime calls"),
cl::Hidden, cl::location(polly::PollyChunkSize),
cl::init(0), cl::Optional, cl::cat(PollyCategory));
Value *polly::createLoop(Value *LB, Value *UB, Value *Stride,
PollyIRBuilder &Builder, LoopInfo &LI,
DominatorTree &DT, BasicBlock *&ExitBB,
ICmpInst::Predicate Predicate,
ScopAnnotator *Annotator, bool Parallel, bool UseGuard,
bool LoopVectDisabled) { … }
Value *ParallelLoopGenerator::createParallelLoop(
Value *LB, Value *UB, Value *Stride, SetVector<Value *> &UsedValues,
ValueMapT &Map, BasicBlock::iterator *LoopBody) { … }
Function *ParallelLoopGenerator::createSubFnDefinition() { … }
AllocaInst *
ParallelLoopGenerator::storeValuesIntoStruct(SetVector<Value *> &Values) { … }
void ParallelLoopGenerator::extractValuesFromStruct(
SetVector<Value *> OldValues, Type *Ty, Value *Struct, ValueMapT &Map) { … }
DebugLoc polly::createDebugLocForGeneratedCode(Function *F) { … }