Go to the documentation of this file.
30 #ifndef AGVerifyPass_H
31 #define AGVerifyPass_H
33 #include "llvm/IR/PassManager.h"
34 #include "llvm/Passes/PassBuilder.h"
35 #include "llvm/Passes/PassPlugin.h"
36 #include "llvm/Support/raw_ostream.h"
37 #include "llvm/Analysis/LoopAnalysisManager.h"
38 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
39 #include "llvm/Support/Debug.h"
40 #include "llvm/Support/JSON.h"
67 return R->
getKind() == VerificationKind::MemoryAccess;
70 void print(raw_ostream &OS)
const override {}
81 return "Address generator compatibility";
85 return json::Object({});
88 int getDynamicTripCount();
116 Value *base =
nullptr;
122 if (
auto ag_compat = dyn_cast<AGCompatibility>(R)) {
123 return ag_compat->geAGtKind() == AddressGenerator::Kind::Affine;
128 void print(raw_ostream &OS)
const override;
132 invalid_list.emplace_back(I);
138 virtual llvm::json::Value getConfigAsJson(Instruction *I)
const;
155 template <
typename AGCompatibilityTy>
157 public AnalysisInfoMixin<VerifyAGCompatiblePass<AGCompatibilityTy>> {
169 Result run(Loop &L, LoopAnalysisManager &AM,
170 LoopStandardAnalysisResults &AR);
172 friend AnalysisInfoMixin<VerifyAGCompatiblePass<AGCompatibilityTy>>;
177 template <
typename AGCompatibilityTy>
198 #endif //AGVerifyPass_H
Definition: OptionPlugin.cpp:128
int64_t step
Definition: AGVerifyPass.hpp:109
DenseMap< Instruction *, ConfigTy > config
Definition: AGVerifyPass.hpp:141
An abstract class for the verification information.
Definition: VerifyPass.hpp:96
A derived class from VerifyResultBase describing whether the memory access pattern is compatible with...
Definition: AGVerifyPass.hpp:57
SmallVector< Instruction * > invalid_list
Definition: AGVerifyPass.hpp:142
virtual VerificationKind getKind() const
get the kind of derived class
Definition: VerifyPass.hpp:149
A function pass to verify the memory access pattern.
Definition: AGVerifyPass.hpp:156
AddressGenerator::Kind ag_kind
Definition: AGVerifyPass.hpp:91
void verifySCEVAsAffineAG(const SCEV *S, LoopStandardAnalysisResults &AR, AffineAGCompatibility::ConfigTy &C)
Definition: AGVerifyPass.cpp:158
@ MemoryAccess
Checking each memory access meets the allowed access pattern.
AddressGenerator::Kind geAGtKind() const
Get the Kind object.
Definition: AGVerifyPass.hpp:76
void print(raw_ostream &OS) const override
An abstract method to print the verification result.
Definition: AGVerifyPass.hpp:70
A derived class from AGCompatibility for affine AGs.
Definition: AGVerifyPass.hpp:99
Definition: AGVerifyPass.hpp:113
Definition: AGVerifyPass.hpp:50
static bool classof(const VerifyResultBase *R)
Definition: AGVerifyPass.hpp:121
unsigned computeLoopTripCount(const Loop *L, LoopStandardAnalysisResults &AR)
Definition: AGVerifyPass.cpp:281
static bool classof(const VerifyResultBase *R)
Definition: AGVerifyPass.hpp:66
SmallVector< DimEntry_t > config
Definition: AGVerifyPass.hpp:115
bool parseStartSCEV(const SCEV *S, int *offset, Value **base)
Definition: AGVerifyPass.cpp:256
a configration of loop control for a dimention
Definition: AGVerifyPass.hpp:107
An abstract class representing a type of address generator.
Definition: CGRAModel.hpp:215
AGCompatibility(AddressGenerator::Kind AGKind)
Construct a new AGCompatibility object.
Definition: AGVerifyPass.hpp:62
static AnalysisKey Key
Definition: AGVerifyPass.hpp:173
bool valid
Definition: AGVerifyPass.hpp:114
AffineAGCompatibility()
Definition: AGVerifyPass.hpp:101
virtual llvm::json::Value getConfigAsJson(Instruction *I) const
Definition: AGVerifyPass.hpp:84
int64_t start
Definition: AGVerifyPass.hpp:108
int64_t count
Definition: AGVerifyPass.hpp:110
VerificationKind
Kind of verification.
Definition: VerifyPass.hpp:64
Kind
Definition: CGRAModel.hpp:217
int nested_level
Definition: AGVerifyPass.hpp:143
StringRef getName() const
Definition: AGVerifyPass.hpp:80
void add(Instruction *I, ConfigTy C)
Definition: AGVerifyPass.hpp:130