Skip to content

Commit 1be685a

Browse files
[mlir] Remove unnecessary casts (NFC) (#147097)
Both ptr and alignedPtr are already of T *.
1 parent e2510b1 commit 1be685a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mlir/include/mlir/ExecutionEngine/MemRefUtils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ makeStridedMemRefDescriptor(T *ptr, T *alignedPtr, ArrayRef<int64_t> shape,
6868
assert(shape.size() == N);
6969
assert(shapeAlloc.size() == N);
7070
StridedMemRefType<T, N> descriptor;
71-
descriptor.basePtr = static_cast<T *>(ptr);
72-
descriptor.data = static_cast<T *>(alignedPtr);
71+
descriptor.basePtr = ptr;
72+
descriptor.data = alignedPtr;
7373
descriptor.offset = 0;
7474
std::copy(shape.begin(), shape.end(), descriptor.sizes);
7575
auto strides = makeStrides<N>(shapeAlloc);
@@ -89,8 +89,8 @@ makeStridedMemRefDescriptor(T *ptr, T *alignedPtr, ArrayRef<int64_t> shape = {},
8989
assert(shape.size() == N);
9090
assert(shapeAlloc.size() == N);
9191
StridedMemRefType<T, 0> descriptor;
92-
descriptor.basePtr = static_cast<T *>(ptr);
93-
descriptor.data = static_cast<T *>(alignedPtr);
92+
descriptor.basePtr = ptr;
93+
descriptor.data = alignedPtr;
9494
descriptor.offset = 0;
9595
return descriptor;
9696
}

0 commit comments

Comments
 (0)