aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Conversion/VectorToLLVM
diff options
context:
space:
mode:
authorNicolas Vasilache <nicolas.vasilache@gmail.com>2021-11-15 12:19:00 +0000
committerNicolas Vasilache <nicolas.vasilache@gmail.com>2021-11-15 12:41:52 +0000
commitee80ffbf9aa4ceb515233bdd841d3c8eae80c4d0 (patch)
treefa68a3af70897528eddb80cbde065edad306d7ee /mlir/lib/Conversion/VectorToLLVM
parent9b1d90e8ac9c95ba55a0b949118377f31e6703f8 (diff)
[mlir][Linalg] Add bounded recursion declaration to FMAOp -> LLVM conversion.
FMAOp -> LLVM conversion is done progressively by peeling off 1 dimension from FMAOp at each pattern iteration. Add the recursively bounded property declaration to the pattern so that the rewriter can apply it multiple times. Without this, FMAOps with 3+D do not lower to LLVM. Differential Revision: https://reviews.llvm.org/D113886
Diffstat (limited to 'mlir/lib/Conversion/VectorToLLVM')
-rw-r--r--mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
index 966d3f3b8fce..65816a2d0580 100644
--- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
+++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
@@ -752,6 +752,12 @@ class VectorFMAOpNDRewritePattern : public OpRewritePattern<FMAOp> {
public:
using OpRewritePattern<FMAOp>::OpRewritePattern;
+ void initialize() {
+ // This pattern recursively unpacks one dimension at a time. The recursion
+ // bounded as the rank is strictly decreasing.
+ setHasBoundedRewriteRecursion();
+ }
+
LogicalResult matchAndRewrite(FMAOp op,
PatternRewriter &rewriter) const override {
auto vType = op.getVectorType();