diff --git a/mlir/docs/EDSC.md b/mlir/docs/EDSC.md --- a/mlir/docs/EDSC.md +++ b/mlir/docs/EDSC.md @@ -54,11 +54,11 @@ i7(constant_int(7, 32)), i13(constant_int(13, 32)); AffineLoopNestBuilder(&i, lb, ub, 3)([&]{ - lb * index_t(3) + ub; - lb + index_t(3); + lb * index_type(3) + ub; + lb + index_type(3); AffineLoopNestBuilder(&j, lb, ub, 2)([&]{ - ceilDiv(index_t(31) * floorDiv(i + j * index_t(3), index_t(32)), - index_t(32)); + ceilDiv(index_type(31) * floorDiv(i + j * index_type(3), index_type(32)), + index_type(32)); ((f7 + f13) / f7) % f13 - f7 * f13; ((i7 + i13) / i7) % i13 - i7 * i13; }); diff --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h --- a/mlir/include/mlir/EDSC/Builders.h +++ b/mlir/include/mlir/EDSC/Builders.h @@ -24,8 +24,8 @@ namespace edsc { -struct index_t { - explicit index_t(int64_t v) : v(v) {} +struct index_type { + explicit index_type(int64_t v) : v(v) {} explicit operator int64_t() { return v; } int64_t v; }; @@ -320,7 +320,7 @@ /// This implicit constructor is provided to each build an eager Value for a /// constant at the current insertion point in the IR. An implicit constructor /// allows idiomatic expressions mixing ValueHandle and literals. - ValueHandle(index_t cst); + ValueHandle(index_type cst); /// ValueHandle is a value type, use the default copy constructor. ValueHandle(const ValueHandle &other) = default; diff --git a/mlir/include/mlir/EDSC/Intrinsics.h b/mlir/include/mlir/EDSC/Intrinsics.h --- a/mlir/include/mlir/EDSC/Intrinsics.h +++ b/mlir/include/mlir/EDSC/Intrinsics.h @@ -34,7 +34,7 @@ struct IndexHandle : public ValueHandle { explicit IndexHandle() : ValueHandle(ScopedContext::getBuilder().getIndexType()) {} - explicit IndexHandle(index_t v) : ValueHandle(v) {} + explicit IndexHandle(index_type v) : ValueHandle(v) {} explicit IndexHandle(Value v) : ValueHandle(v) { assert(v.getType() == ScopedContext::getBuilder().getIndexType() && "Expected index type"); @@ -96,7 +96,7 @@ ValueHandleArray(ArrayRef vals) { values.append(vals.begin(), vals.end()); } - ValueHandleArray(ArrayRef vals) { + ValueHandleArray(ArrayRef vals) { SmallVector tmp(vals.begin(), vals.end()); values.append(tmp.begin(), tmp.end()); } diff --git a/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp b/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp --- a/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp +++ b/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp @@ -75,7 +75,7 @@ using namespace edsc::op; using edsc::intrinsics::select; - IndexHandle zero(index_t(0)), one(index_t(1)); + IndexHandle zero(index_type(0)), one(index_type(1)); SmallVector memRefAccess(transfer.indices()); SmallVector clippedScalarAccessExprs( memRefAccess.size(), edsc::IndexHandle()); diff --git a/mlir/lib/EDSC/Builders.cpp b/mlir/lib/EDSC/Builders.cpp --- a/mlir/lib/EDSC/Builders.cpp +++ b/mlir/lib/EDSC/Builders.cpp @@ -65,7 +65,7 @@ return getBuilder().getContext(); } -mlir::edsc::ValueHandle::ValueHandle(index_t cst) { +mlir::edsc::ValueHandle::ValueHandle(index_type cst) { auto &b = ScopedContext::getBuilder(); auto loc = ScopedContext::getLocation(); v = b.create(loc, cst.v).getResult(); diff --git a/mlir/lib/EDSC/Helpers.cpp b/mlir/lib/EDSC/Helpers.cpp --- a/mlir/lib/EDSC/Helpers.cpp +++ b/mlir/lib/EDSC/Helpers.cpp @@ -24,7 +24,7 @@ if (shape[idx] == -1) { res.push_back(ValueHandle::create(memRef, idx)); } else { - res.push_back(static_cast(shape[idx])); + res.push_back(static_cast(shape[idx])); } } return res; @@ -35,7 +35,7 @@ auto memrefSizeValues = getMemRefSizes(v); for (auto &size : memrefSizeValues) { - lbs.push_back(static_cast(0)); + lbs.push_back(static_cast(0)); ubs.push_back(size); steps.push_back(1); } @@ -45,8 +45,8 @@ auto vectorType = v.getType().cast(); for (auto s : vectorType.getShape()) { - lbs.push_back(static_cast(0)); - ubs.push_back(static_cast(s)); + lbs.push_back(static_cast(0)); + ubs.push_back(static_cast(s)); steps.push_back(1); } } diff --git a/mlir/test/EDSC/builder-api-test.cpp b/mlir/test/EDSC/builder-api-test.cpp --- a/mlir/test/EDSC/builder-api-test.cpp +++ b/mlir/test/EDSC/builder-api-test.cpp @@ -67,11 +67,11 @@ ValueHandle i7(constant_int(7, 32)); ValueHandle i13(constant_int(13, 32)); AffineLoopNestBuilder(&i, lb, ub, 3)([&] { - lb *index_t(3) + ub; - lb + index_t(3); + lb *index_type(3) + ub; + lb + index_type(3); AffineLoopNestBuilder(&j, lb, ub, 2)([&] { - ceilDiv(index_t(31) * floorDiv(i + j * index_t(3), index_t(32)), - index_t(32)); + ceilDiv(index_type(31) * floorDiv(i + j * index_type(3), index_type(32)), + index_type(32)); ((f7 + f13) / f7) % f13 - f7 *f13; ((i7 + i13) / i7) % i13 - i7 *i13; }); @@ -411,7 +411,7 @@ ValueHandle vh(indexType), vh20(indexType), vh21(indexType); OperationHandle ih0, ih2; IndexHandle m, n, M(f.getArgument(0)), N(f.getArgument(1)); - IndexHandle ten(index_t(10)), twenty(index_t(20)); + IndexHandle ten(index_type(10)), twenty(index_type(20)); AffineLoopNestBuilder({&m, &n}, {M, N}, {M + ten, N + twenty}, {1, 1})([&]{ vh = MY_CUSTOM_OP({m, m + n}, {indexType}, {}); ih0 = MY_CUSTOM_OP_0({m, m + n}, {});