34 #define DL_NAME "delinearize" 35 #define DEBUG_TYPE DL_NAME 40 Delinearization(
const Delinearization &);
59 void Delinearization::getAnalysisUsage(
AnalysisUsage &AU)
const {
67 SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
68 LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
73 O <<
"Delinearization on function " << F->
getName() <<
":\n";
78 if (!isa<StoreInst>(Inst) && !isa<LoadInst>(Inst) &&
79 !isa<GetElementPtrInst>(Inst))
93 AccessFn = SE->getMinusSCEV(AccessFn, BasePointer);
96 O <<
"Inst:" << *Inst <<
"\n";
97 O <<
"In Loop with Header: " << L->getHeader()->getName() <<
"\n";
98 O <<
"AccessFunction: " << *AccessFn <<
"\n";
101 SE->delinearize(AccessFn, Subscripts, Sizes, SE->getElementSize(Inst));
102 if (Subscripts.
size() == 0 || Sizes.
size() == 0 ||
103 Subscripts.
size() != Sizes.
size()) {
104 O <<
"failed to delinearize\n";
108 O <<
"Base offset: " << *BasePointer <<
"\n";
109 O <<
"ArrayDecl[UnknownSize]";
111 for (
int i = 0; i < Size - 1; i++)
112 O <<
"[" << *Sizes[i] <<
"]";
113 O <<
" with elements of " << *Sizes[Size - 1] <<
" bytes.\n";
116 for (
int i = 0; i <
Size; i++)
117 O <<
"[" << *Subscripts[i] <<
"]";
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Value * getPointerOperand(Value *V)
A helper function that returns the pointer operand of a load, store or GEP instruction.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
The main scalar evolution driver.
block Block Frequency true
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
inst_iterator inst_begin(Function *F)
void initializeDelinearizationPass(PassRegistry &)
static bool runOnFunction(Function &F, bool PostInlining)
This means that we are dealing with an entirely unknown SCEV value, and only represent it as its LLVM...
LLVM Basic Block Representation.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
FunctionPass * createDelinearizationPass()
void setPreservesAll()
Set by analyses that do not transform their input at all.
LoopT * getParentLoop() const
static const char delinearization_name[]
This class represents an analyzed expression in the program.
Represents a single loop in the control flow graph.
StringRef getName() const
Return a constant reference to the value's name.
INITIALIZE_PASS_BEGIN(Delinearization, DL_NAME, delinearization_name, true, true) FunctionPass *llvm
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
This class implements an extremely fast bulk output stream that can only output to a stream...
The legacy pass manager's analysis pass to compute loop information.
inst_iterator inst_end(Function *F)
const BasicBlock * getParent() const