14#ifndef POLLY_CODEGEN_IRBUILDER_H
15#define POLLY_CODEGEN_IRBUILDER_H
17#include "llvm/ADT/MapVector.h"
18#include "llvm/IR/IRBuilder.h"
53 void pushLoop(llvm::Loop *L,
bool IsParallel);
65 llvm::BranchInst *
B,
bool IsParallel,
66 std::optional<bool> EnableVectorizeMetadata = std::nullopt)
const;
80 llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
81 llvm::AssertingVH<llvm::Value>> &NewMap) {
97 llvm::ScalarEvolution *
SE;
109 llvm::MapVector<llvm::AssertingVH<llvm::Value>, llvm::MDNode *>
AliasScopeMap;
112 llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::MDNode *>
115 llvm::DenseMap<llvm::AssertingVH<llvm::Value>, llvm::AssertingVH<llvm::Value>>
123class IRInserter final :
public llvm::IRBuilderDefaultInserter {
129 llvm::BasicBlock::iterator InsertPt)
const override {
130 llvm::IRBuilderDefaultInserter::InsertHelper(I, Name, InsertPt);
ScopAnnotator * Annotator
void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, llvm::BasicBlock::iterator InsertPt) const override
IRInserter(ScopAnnotator &A)
Helper class to annotate newly generated SCoPs with metadata.
llvm::SmallVector< BandAttr *, 8 > LoopAttrEnv
Stack for surrounding BandAttr annotations.
llvm::SmallVector< llvm::MDNode *, 8 > ParallelLoops
Access groups for the parallel loops currently under construction.
void resetAlternativeAliasBases()
Delete the set of alternative alias bases.
llvm::DenseMap< llvm::AssertingVH< llvm::Value >, llvm::MDNode * > OtherAliasScopeListMap
A map from base pointers to an alias scope list of other pointers.
BandAttr *& getStagingAttrEnv()
void buildAliasScopes(Scop &S)
Build all alias scopes for the given SCoP.
void annotate(llvm::Instruction *I)
Annotate the new instruction I for all parallel loops.
llvm::MapVector< llvm::AssertingVH< llvm::Value >, llvm::MDNode * > AliasScopeMap
A map from base pointers to its alias scope.
llvm::ScalarEvolution * SE
The ScalarEvolution analysis we use to find base pointers.
llvm::DenseMap< llvm::AssertingVH< llvm::Value >, llvm::AssertingVH< llvm::Value > > AlternativeAliasBases
void pushLoop(llvm::Loop *L, bool IsParallel)
Add a new loop L which is parallel if IsParallel is true.
void addAlternativeAliasBases(llvm::DenseMap< llvm::AssertingVH< llvm::Value >, llvm::AssertingVH< llvm::Value > > &NewMap)
Add alternative alias based pointers.
llvm::SmallVector< llvm::Loop *, 8 > ActiveLoops
All loops currently under construction.
void popLoop(bool isParallel)
Remove the last added loop.
void annotateLoopLatch(llvm::BranchInst *B, bool IsParallel, std::optional< bool > EnableVectorizeMetadata=std::nullopt) const
Annotate the loop latch B.
BandAttr * getActiveAttrEnv() const
llvm::MDNode * AliasScopeDomain
The alias scope domain for the current SCoP.
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
llvm::IRBuilder< llvm::ConstantFolder, IRInserter > PollyIRBuilder
Represent the attributes of a loop.