[LoopNest]: Analysis to discover properties of a loop nest.
authorWhitney Tsang <whitneyt@ca.ibm.com>
Mon, 2 Mar 2020 20:23:25 +0000 (20:23 +0000)
committerWhitney Tsang <whitneyt@ca.ibm.com>
Tue, 3 Mar 2020 13:25:28 +0000 (13:25 +0000)
commit3a063d68e3c97136d10a2e770f389e6c13c3b317
treecbbfae161574226b7c811c3b28793a17ded9b6d7
parent876d13378931bee3dcefafff8729c40d5457ff31
[LoopNest]: Analysis to discover properties of a loop nest.

Summary: This patch adds an analysis pass to collect loop nests and
summarize properties of the nest (e.g the nest depth, whether the nest
is perfect, what's the innermost loop, etc...).

The motivation for this patch was discussed at the latest meeting of the
LLVM loop group (https://ibm.box.com/v/llvm-loop-nest-analysis) where we
discussed
the unimodular loop transformation framework ( “A Loop Transformation
Theory and an Algorithm to Maximize Parallelism”, Michael E. Wolf and
Monica S. Lam, IEEE TPDS, October 1991). The unimodular framework
provides a convenient way to unify legality checking and code generation
for several loop nest transformations (e.g. loop reversal, loop
interchange, loop skewing) and their compositions. Given that the
unimodular framework is applicable to perfect loop nests this is one
property of interest we expose in this analysis. Several other utility
functions are also provided. In the future other properties of interest
can be added in a centralized place.
Authored By: etiotto
Reviewer: Meinersbur, bmahjour, kbarton, Whitney, dmgreen, fhahn,
reames, hfinkel, jdoerfert, ppc-slack
Reviewed By: Meinersbur
Subscribers: bryanpkc, ppc-slack, mgorny, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D68789
llvm/include/llvm/Analysis/LoopNestAnalysis.h [new file with mode: 0644]
llvm/lib/Analysis/CMakeLists.txt
llvm/lib/Analysis/LoopNestAnalysis.cpp [new file with mode: 0644]
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/test/Analysis/LoopNestAnalysis/imperfectnest.ll [new file with mode: 0644]
llvm/test/Analysis/LoopNestAnalysis/infinite.ll [new file with mode: 0644]
llvm/test/Analysis/LoopNestAnalysis/perfectnest.ll [new file with mode: 0644]
llvm/unittests/Analysis/CMakeLists.txt
llvm/unittests/Analysis/LoopNestTest.cpp [new file with mode: 0644]