diff options
author | River Riddle <riverriddle@google.com> | 2019-12-23 14:45:01 -0800 |
---|---|---|
committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-23 16:36:53 -0800 |
commit | e62a69561fb9d7b1013d2853da68d79a7907fead (patch) | |
tree | 0dd059094cbfb8d904513abcdc1fbe8cfa89bb09 /mlir/lib/Dialect/VectorOps/VectorOps.cpp | |
parent | 5d5bd2e1da29d976cb125dbb3cd097a5e42b2be4 (diff) | |
download | bcm5719-llvm-e62a69561fb9d7b1013d2853da68d79a7907fead.tar.gz bcm5719-llvm-e62a69561fb9d7b1013d2853da68d79a7907fead.zip |
NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.
ValuePtr was a temporary typedef during the transition to a value-typed Value.
PiperOrigin-RevId: 286945714
Diffstat (limited to 'mlir/lib/Dialect/VectorOps/VectorOps.cpp')
-rw-r--r-- | mlir/lib/Dialect/VectorOps/VectorOps.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/mlir/lib/Dialect/VectorOps/VectorOps.cpp b/mlir/lib/Dialect/VectorOps/VectorOps.cpp index 8ceff014029..a3904ef97a2 100644 --- a/mlir/lib/Dialect/VectorOps/VectorOps.cpp +++ b/mlir/lib/Dialect/VectorOps/VectorOps.cpp @@ -63,7 +63,7 @@ ArrayAttr vector::getVectorSubscriptAttr(Builder &builder, //===----------------------------------------------------------------------===// void vector::ContractionOp::build(Builder *builder, OperationState &result, - ValuePtr lhs, ValuePtr rhs, ValuePtr acc, + Value lhs, Value rhs, Value acc, ArrayAttr indexingMaps, ArrayAttr iteratorTypes) { result.addOperands({lhs, rhs, acc}); @@ -395,7 +395,7 @@ static Type inferExtractOpResultType(VectorType vectorType, } void vector::ExtractOp::build(Builder *builder, OperationState &result, - ValuePtr source, ArrayRef<int64_t> position) { + Value source, ArrayRef<int64_t> position) { result.addOperands(source); auto positionAttr = getVectorSubscriptAttr(*builder, position); result.addTypes(inferExtractOpResultType(source->getType().cast<VectorType>(), @@ -462,7 +462,7 @@ static LogicalResult verify(vector::ExtractOp op) { //===----------------------------------------------------------------------===// void ExtractSlicesOp::build(Builder *builder, OperationState &result, - TupleType tupleType, ValuePtr vector, + TupleType tupleType, Value vector, ArrayRef<int64_t> sizes, ArrayRef<int64_t> strides) { result.addOperands(vector); @@ -638,8 +638,8 @@ static ParseResult parseBroadcastOp(OpAsmParser &parser, // ShuffleOp //===----------------------------------------------------------------------===// -void ShuffleOp::build(Builder *builder, OperationState &result, ValuePtr v1, - ValuePtr v2, ArrayRef<int64_t> mask) { +void ShuffleOp::build(Builder *builder, OperationState &result, Value v1, + Value v2, ArrayRef<int64_t> mask) { result.addOperands({v1, v2}); auto maskAttr = getVectorSubscriptAttr(*builder, mask); result.addTypes(v1->getType()); @@ -762,8 +762,8 @@ static LogicalResult verify(InsertElementOp op) { // InsertOp //===----------------------------------------------------------------------===// -void InsertOp::build(Builder *builder, OperationState &result, ValuePtr source, - ValuePtr dest, ArrayRef<int64_t> position) { +void InsertOp::build(Builder *builder, OperationState &result, Value source, + Value dest, ArrayRef<int64_t> position) { result.addOperands({source, dest}); auto positionAttr = getVectorSubscriptAttr(*builder, position); result.addTypes(dest->getType()); @@ -884,7 +884,7 @@ void InsertSlicesOp::getStrides(SmallVectorImpl<int64_t> &results) { //===----------------------------------------------------------------------===// void InsertStridedSliceOp::build(Builder *builder, OperationState &result, - ValuePtr source, ValuePtr dest, + Value source, Value dest, ArrayRef<int64_t> offsets, ArrayRef<int64_t> strides) { result.addOperands({source, dest}); @@ -1192,7 +1192,7 @@ static LogicalResult verify(ReshapeOp op) { // If all shape operands are produced by constant ops, verify that product // of dimensions for input/output shape match. - auto isDefByConstant = [](ValuePtr operand) { + auto isDefByConstant = [](Value operand) { return isa_and_nonnull<ConstantIndexOp>(operand->getDefiningOp()); }; if (llvm::all_of(op.input_shape(), isDefByConstant) && @@ -1238,7 +1238,7 @@ static Type inferStridedSliceOpResultType(VectorType vectorType, } void StridedSliceOp::build(Builder *builder, OperationState &result, - ValuePtr source, ArrayRef<int64_t> offsets, + Value source, ArrayRef<int64_t> offsets, ArrayRef<int64_t> sizes, ArrayRef<int64_t> strides) { result.addOperands(source); auto offsetsAttr = getVectorSubscriptAttr(*builder, offsets); @@ -1593,8 +1593,7 @@ static MemRefType inferVectorTypeCastResultType(MemRefType t) { return MemRefType::get({}, VectorType::get(t.getShape(), t.getElementType())); } -void TypeCastOp::build(Builder *builder, OperationState &result, - ValuePtr source) { +void TypeCastOp::build(Builder *builder, OperationState &result, Value source) { result.addOperands(source); result.addTypes( inferVectorTypeCastResultType(source->getType().cast<MemRefType>())); @@ -1784,7 +1783,7 @@ public: PatternMatchResult matchAndRewrite(CreateMaskOp createMaskOp, PatternRewriter &rewriter) const override { // Return if any of 'createMaskOp' operands are not defined by a constant. - auto is_not_def_by_constant = [](ValuePtr operand) { + auto is_not_def_by_constant = [](Value operand) { return !isa_and_nonnull<ConstantIndexOp>(operand->getDefiningOp()); }; if (llvm::any_of(createMaskOp.operands(), is_not_def_by_constant)) |