From 17022b1bc516f42d8bdb5d0fed9739fb7584e13d Mon Sep 17 00:00:00 2001 From: Geoffrey Martin-Noble Date: Wed, 29 May 2019 16:06:49 -0700 Subject: [PATCH] Check for Vector or Tensor Type rather than ShapedType when matching constant splat Only vectors or tensors can be constant splats (or element attrs). This is in preparation for making MemRef subclass ShapedType -- PiperOrigin-RevId: 250586281 --- mlir/include/mlir/IR/Matchers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/include/mlir/IR/Matchers.h b/mlir/include/mlir/IR/Matchers.h index d1c2f94..61796ff 100644 --- a/mlir/include/mlir/IR/Matchers.h +++ b/mlir/include/mlir/IR/Matchers.h @@ -101,7 +101,7 @@ struct constant_int_op_binder { if (type.isa()) { return attr_value_binder(bind_value).match(attr); } - if (type.isa()) { + if (type.isa() || type.isa()) { if (auto splatAttr = attr.dyn_cast()) { return attr_value_binder(bind_value) .match(splatAttr.getValue()); -- 2.7.4