From: aartbik Date: Wed, 3 Jun 2020 23:54:26 +0000 (-0700) Subject: [mlir] [VectorOps] Add missing comments to CreateMaskOp lowering X-Git-Tag: llvmorg-12-init~4095 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c19fae507e311723b40a0cafa17d4e48b1664fb9;p=platform%2Fupstream%2Fllvm.git [mlir] [VectorOps] Add missing comments to CreateMaskOp lowering Summary: Add missing comment to CreateMask. Fixed typo in ConstantMask comment. Reviewers: nicolasvasilache, rriddle, reidtatge, ftynse Reviewed By: ftynse Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul Tags: #mlir Differential Revision: https://reviews.llvm.org/D81125 --- diff --git a/mlir/lib/Dialect/Vector/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/VectorTransforms.cpp index 82c2738..99a3a95 100644 --- a/mlir/lib/Dialect/Vector/VectorTransforms.cpp +++ b/mlir/lib/Dialect/Vector/VectorTransforms.cpp @@ -1304,10 +1304,10 @@ public: /// Progressive lowering of ConstantMaskOp. /// One: -/// %x = vector.constant_mask_op [a,b] +/// %x = vector.constant_mask [a,b] /// is replaced by: /// %z = zero-result -/// %l = vector.constant_mask_op [b] +/// %l = vector.constant_mask [b] /// %4 = vector.insert %l, %z[0] /// .. /// %x = vector.insert %l, %..[a-1] @@ -1351,6 +1351,17 @@ public: } }; +/// Progressive lowering of CreateMaskOp. +/// One: +/// %x = vector.create_mask %a, ... : vector +/// is replaced by: +/// %l = vector.create_mask ... : vector<...> ; one lower rank +/// %0 = cmpi "slt", %ci, %a | +/// %1 = select %0, %l, %zeroes | +/// %r = vector.insert %1, %pr [i] | d-times +/// %x = .... +/// When rank == 1, the selection operator is not needed, +/// and we can assign the true/false value right away. class CreateMaskOpLowering : public OpRewritePattern { public: using OpRewritePattern::OpRewritePattern;