diff options
author | Sebastian Pop <spop@codeaurora.org> | 2013-11-12 22:47:20 +0000 |
---|---|---|
committer | Sebastian Pop <spop@codeaurora.org> | 2013-11-12 22:47:20 +0000 |
commit | 5230ad61fd35d3006e7764c3152d28e2e68c288f (patch) | |
tree | d94a4ccc022bb23ad6d24274319f99a85d3ae404 /include | |
parent | b8fc659c8eb36796531d55fa78cbb1957895aa9b (diff) | |
download | external_llvm-5230ad61fd35d3006e7764c3152d28e2e68c288f.zip external_llvm-5230ad61fd35d3006e7764c3152d28e2e68c288f.tar.gz external_llvm-5230ad61fd35d3006e7764c3152d28e2e68c288f.tar.bz2 |
delinearization of arrays
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/DependenceAnalysis.h | 4 | ||||
-rw-r--r-- | include/llvm/Analysis/Passes.h | 7 | ||||
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpressions.h | 8 | ||||
-rw-r--r-- | include/llvm/InitializePasses.h | 1 |
4 files changed, 19 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DependenceAnalysis.h b/include/llvm/Analysis/DependenceAnalysis.h index 8fce2f6..ea8cecf 100644 --- a/include/llvm/Analysis/DependenceAnalysis.h +++ b/include/llvm/Analysis/DependenceAnalysis.h @@ -908,6 +908,10 @@ namespace llvm { /// based on the current constraint. void updateDirection(Dependence::DVEntry &Level, const Constraint &CurConstraint) const; + + bool tryDelinearize(const SCEV *SrcSCEV, const SCEV *DstSCEV, + SmallVectorImpl<Subscript> &Pair) const; + public: static char ID; // Class identification, replacement for typeinfo DependenceAnalysis() : FunctionPass(ID) { diff --git a/include/llvm/Analysis/Passes.h b/include/llvm/Analysis/Passes.h index 0b4e96f..a5d098e 100644 --- a/include/llvm/Analysis/Passes.h +++ b/include/llvm/Analysis/Passes.h @@ -136,6 +136,13 @@ namespace llvm { //===--------------------------------------------------------------------===// // + // createDelinearizationPass - This pass implements attempts to restore + // multidimensional array indices from linearized expressions. + // + FunctionPass *createDelinearizationPass(); + + //===--------------------------------------------------------------------===// + // // Minor pass prototypes, allowing us to expose them through bugpoint and // analyze. FunctionPass *createInstCountPass(); diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h index 1fc03be..9cd902a 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpressions.h +++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h @@ -351,8 +351,14 @@ namespace llvm { static inline bool classof(const SCEV *S) { return S->getSCEVType() == scAddRecExpr; } - }; + /// Splits the SCEV into two vectors of SCEVs representing the subscripts + /// and sizes of an array access. Returns the remainder of the + /// delinearization that is the offset start of the array. + const SCEV *delinearize(ScalarEvolution &SE, + SmallVectorImpl<const SCEV *> &Subscripts, + SmallVectorImpl<const SCEV *> &Sizes) const; + }; //===--------------------------------------------------------------------===// /// SCEVSMaxExpr - This class represents a signed maximum selection. diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h index 68825a3..c650a6d 100644 --- a/include/llvm/InitializePasses.h +++ b/include/llvm/InitializePasses.h @@ -102,6 +102,7 @@ void initializeDSEPass(PassRegistry&); void initializeDebugIRPass(PassRegistry&); void initializeDeadInstEliminationPass(PassRegistry&); void initializeDeadMachineInstructionElimPass(PassRegistry&); +void initializeDelinearizationPass(PassRegistry &); void initializeDependenceAnalysisPass(PassRegistry&); void initializeDomOnlyPrinterPass(PassRegistry&); void initializeDomOnlyViewerPass(PassRegistry&); |