[PATCH] D76889: [MLIR][Vector] Add support for TupleGetOp folding through InsertSlicesOp and ExtractSlicesOp.

Aart Bik via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 16:52:45 PDT 2020


aartbik added inline comments.


================
Comment at: mlir/lib/Dialect/Vector/VectorTransforms.cpp:825
 //   -> User(Producer)
 struct TupleGetFolderOp : public OpRewritePattern<vector::TupleGetOp> {
   using OpRewritePattern<vector::TupleGetOp>::OpRewritePattern;
----------------
just curious, this is part of VectorTransforms explicitly now.

Does it make sense to do this as part of the  TupleGetOp::fold() at some point?


================
Comment at: mlir/test/Dialect/Vector/vector-transforms.mlir:317
+// CHECK-LABEL: func @tuple_get_producer_consumer
+//       CHECK: return %arg2 : vector<2x4xf32>
+
----------------
I noticed I may have introduced this at L308 at some point, but in general it seems a bit cleaner to capture the argument

// CHECK-SAME: %[[A:.*0]]: vector<2x4xf32>,
// CHECK-SAME: %[[A:.*1]]: vector<2x4xf32>,
...

and then check for [[D]] in the return
(note that I use the 0,1 etc. in the end to avoid some ambiguities for same typed arguments)



================
Comment at: mlir/test/Dialect/Vector/vector-transforms.mlir:347
+// CHECK-LABEL: func @tuple_get_producer_consumer_tuple_element_swizzle
+//       CHECK: return %arg2 : vector<2x4xf32>
+
----------------
same request


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76889/new/

https://reviews.llvm.org/D76889





More information about the llvm-commits mailing list