Skip to content

Commit c48b49f

Browse files
committed
address review comments
Signed-off-by: James Newling <james.newling@gmail.com>
1 parent 0cbf12a commit c48b49f

File tree

2 files changed

+64
-61
lines changed

2 files changed

+64
-61
lines changed

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7609,20 +7609,24 @@ namespace {
76097609
///
76107610
/// For example, rewrite the 'greater than' comparison below,
76117611
///
7612+
/// ```mlir
76127613
/// %cst = arith.constant dense<7> : vector<3xindex>
76137614
/// %stp = vector.step : vector<3xindex>
76147615
/// %out = arith.cmpi ugt, %stp, %cst : vector<3xindex>
7616+
/// ```
76157617
///
76167618
/// as,
76177619
///
7620+
/// ```mlir
76187621
/// %out = arith.constant dense<false> : vector<3xi1>.
7622+
/// ```
76197623
///
76207624
/// Above [0, 1, 2] > [7, 7, 7] => [false, false, false]. Because the result is
76217625
/// false at ALL indices we fold. If the constant was 1, then
76227626
/// [0, 1, 2] > [1, 1, 1] => [false, false, true] and we do fold, conservatively
76237627
/// preferring the 'compact' vector.step representation.
76247628
struct StepCompareFolder : public OpRewritePattern<StepOp> {
7625-
using OpRewritePattern::OpRewritePattern;
7629+
using Base::Base;
76267630

76277631
LogicalResult matchAndRewrite(StepOp stepOp,
76287632
PatternRewriter &rewriter) const override {
@@ -7680,8 +7684,7 @@ struct StepCompareFolder : public OpRewritePattern<StepOp> {
76807684
if (!type)
76817685
continue;
76827686

7683-
DenseElementsAttr boolAttr =
7684-
DenseElementsAttr::get(type, maybeSplat.value());
7687+
auto boolAttr = DenseElementsAttr::get(type, maybeSplat.value());
76857688
Value splat = mlir::arith::ConstantOp::create(rewriter, cmpiOp.getLoc(),
76867689
type, boolAttr);
76877690

0 commit comments

Comments
 (0)