forked from OSchip/llvm-project
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
This commit is contained in:
parent
9ebab7bc30
commit
17022b1bc5
mlir/include/mlir/IR
|
@ -101,7 +101,7 @@ struct constant_int_op_binder {
|
|||
if (type.isa<IntegerType>()) {
|
||||
return attr_value_binder<IntegerAttr>(bind_value).match(attr);
|
||||
}
|
||||
if (type.isa<ShapedType>()) {
|
||||
if (type.isa<VectorType>() || type.isa<RankedTensorType>()) {
|
||||
if (auto splatAttr = attr.dyn_cast<SplatElementsAttr>()) {
|
||||
return attr_value_binder<IntegerAttr>(bind_value)
|
||||
.match(splatAttr.getValue());
|
||||
|
|
Loading…
Reference in New Issue