diff options
author | Roman Gareev <gareevroman@gmail.com> | 2022-05-21 22:40:33 +0300 |
---|---|---|
committer | Roman Gareev <gareevroman@gmail.com> | 2022-08-07 13:10:32 +0300 |
commit | b02c7e2b630a04701d12efd2376f25eff2767279 (patch) | |
tree | 1d57311eb996b0fe9665994a98622030d34efc8b /polly/include | |
parent | 6bb51bf06214af3690af7034f4edeb265732c481 (diff) | |
download | llvm-b02c7e2b630a04701d12efd2376f25eff2767279.tar.gz |
[Polly] Generalize the pattern matching to the case of tensor contractions
The pattern matching optimization of Polly detects and optimizes dense general
matrix-matrix multiplication. The generated code is close to high performance
implementations of matrix-matrix multiplications, which are contained in
manually tuned libraries. The described pattern matching optimization is
a particular case of tensor contraction optimization, which was
introduced in [1].
This patch generalizes the pattern matching to the case of tensor contractions
using the form of data dependencies and memory accesses produced by tensor
contractions [1].
Optimization of tensor contractions will be added in the next patch. Following
the ideas introduced in [2], it will logically represent tensor contraction
operands as matrix multiplication operands and use an approach for
optimization of matrix-matrix multiplications.
[1] - Gareev R., Grosser T., Kruse M. High-Performance Generalized Tensor
Operations: A Compiler-Oriented Approach // ACM Transactions on
Architecture and Code Optimization (TACO). 2018. Vol. 15, no. 3.
P. 34:1–34:27. DOI: 10.1145/3235029.
[2] - Matthews D. High-Performance Tensor Contraction without BLAS // SIAM
Journal on Scientific Computing. 2018. Vol. 40, no. 1. P. C 1—C 24.
DOI: 110.1137/16m108968x.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D114336
Diffstat (limited to 'polly/include')
-rw-r--r-- | polly/include/polly/Support/ISLTools.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/polly/include/polly/Support/ISLTools.h b/polly/include/polly/Support/ISLTools.h index f7bc29495a9c..64f044071b55 100644 --- a/polly/include/polly/Support/ISLTools.h +++ b/polly/include/polly/Support/ISLTools.h @@ -523,6 +523,11 @@ isl::set subtractParams(isl::set Set, isl::set Params); /// value. Otherwise, return NaN. isl::val getConstant(isl::pw_aff PwAff, bool Max, bool Min); +/// If the relation @p PwAff lies on a hyperplane where the given +/// dimension @p Pos with the type @p Dim has a fixed value, then +/// return that value. Otherwise return NaN. +isl::val getConstant(isl::map Map, isl::dim Dim, int Pos); + /// Check that @p End is valid and return an iterator from @p Begin to @p End /// /// Use case example: |