#include "polly/Support/ScopHelper.h"
#include "polly/Options.h"
#include "polly/ScopInfo.h"
#include "polly/Support/SCEVValidator.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <optional>
usingnamespacellvm;
usingnamespacepolly;
#define DEBUG_TYPE …
static cl::list<std::string> DebugFunctions(
"polly-debug-func",
cl::desc("Allow calls to the specified functions in SCoPs even if their "
"side-effects are unknown. This can be used to do debug output in "
"Polly-transformed code."),
cl::Hidden, cl::CommaSeparated, cl::cat(PollyCategory));
static void simplifyRegionEntry(Region *R, DominatorTree *DT, LoopInfo *LI,
RegionInfo *RI) { … }
static void simplifyRegionExit(Region *R, DominatorTree *DT, LoopInfo *LI,
RegionInfo *RI) { … }
void polly::simplifyRegion(Region *R, DominatorTree *DT, LoopInfo *LI,
RegionInfo *RI) { … }
static BasicBlock *splitBlock(BasicBlock *Old, Instruction *SplitPt,
DominatorTree *DT, llvm::LoopInfo *LI,
RegionInfo *RI) { … }
void polly::splitEntryBlockForAlloca(BasicBlock *EntryBlock, DominatorTree *DT,
LoopInfo *LI, RegionInfo *RI) { … }
void polly::splitEntryBlockForAlloca(BasicBlock *EntryBlock, Pass *P) { … }
void polly::recordAssumption(polly::RecordedAssumptionsTy *RecordedAssumptions,
polly::AssumptionKind Kind, isl::set Set,
DebugLoc Loc, polly::AssumptionSign Sign,
BasicBlock *BB, bool RTC) { … }
struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> { … };
Value *polly::expandCodeFor(Scop &S, llvm::ScalarEvolution &SE,
llvm::Function *GenFn, ScalarEvolution &GenSE,
const DataLayout &DL, const char *Name,
const SCEV *E, Type *Ty, Instruction *IP,
ValueMapT *VMap, LoopToScevMapT *LoopMap,
BasicBlock *RTCBB) { … }
Value *polly::getConditionFromTerminator(Instruction *TI) { … }
Loop *polly::getLoopSurroundingScop(Scop &S, LoopInfo &LI) { … }
unsigned polly::getNumBlocksInLoop(Loop *L) { … }
unsigned polly::getNumBlocksInRegionNode(RegionNode *RN) { … }
Loop *polly::getRegionNodeLoop(RegionNode *RN, LoopInfo &LI) { … }
static bool hasVariantIndex(GetElementPtrInst *Gep, Loop *L, Region &R,
ScalarEvolution &SE) { … }
bool polly::isHoistableLoad(LoadInst *LInst, Region &R, LoopInfo &LI,
ScalarEvolution &SE, const DominatorTree &DT,
const InvariantLoadsSetTy &KnownInvariantLoads) { … }
bool polly::isIgnoredIntrinsic(const Value *V) { … }
bool polly::canSynthesize(const Value *V, const Scop &S, ScalarEvolution *SE,
Loop *Scope) { … }
llvm::BasicBlock *polly::getUseBlock(const llvm::Use &U) { … }
llvm::Loop *polly::getFirstNonBoxedLoopFor(llvm::Loop *L, llvm::LoopInfo &LI,
const BoxedLoopsSetTy &BoxedLoops) { … }
llvm::Loop *polly::getFirstNonBoxedLoopFor(llvm::BasicBlock *BB,
llvm::LoopInfo &LI,
const BoxedLoopsSetTy &BoxedLoops) { … }
bool polly::isDebugCall(Instruction *Inst) { … }
static bool hasDebugCall(BasicBlock *BB) { … }
bool polly::hasDebugCall(ScopStmt *Stmt) { … }
static MDNode *findNamedMetadataNode(MDNode *LoopMD, StringRef Name) { … }
static std::optional<const MDOperand *> findNamedMetadataArg(MDNode *LoopID,
StringRef Name) { … }
std::optional<Metadata *> polly::findMetadataOperand(MDNode *LoopMD,
StringRef Name) { … }
static std::optional<bool> getOptionalBoolLoopAttribute(MDNode *LoopID,
StringRef Name) { … }
bool polly::getBooleanLoopAttribute(MDNode *LoopID, StringRef Name) { … }
std::optional<int> polly::getOptionalIntLoopAttribute(MDNode *LoopID,
StringRef Name) { … }
bool polly::hasDisableAllTransformsHint(Loop *L) { … }
bool polly::hasDisableAllTransformsHint(llvm::MDNode *LoopID) { … }
isl::id polly::getIslLoopAttr(isl::ctx Ctx, BandAttr *Attr) { … }
isl::id polly::createIslLoopAttr(isl::ctx Ctx, Loop *L) { … }
bool polly::isLoopAttr(const isl::id &Id) { … }
BandAttr *polly::getLoopAttr(const isl::id &Id) { … }