[Mlir-commits] [mlir] [mlir] Remove unnecessary casts (NFC) (PR #147097)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jul 4 12:30:47 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-mlir-execution-engine
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
Both ptr and alignedPtr are already of T *.
---
Full diff: https://github.com/llvm/llvm-project/pull/147097.diff
1 Files Affected:
- (modified) mlir/include/mlir/ExecutionEngine/MemRefUtils.h (+4-4)
``````````diff
diff --git a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
index f355dfb8648ec..6e72f7c23bdcf 100644
--- a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
@@ -68,8 +68,8 @@ makeStridedMemRefDescriptor(T *ptr, T *alignedPtr, ArrayRef<int64_t> shape,
assert(shape.size() == N);
assert(shapeAlloc.size() == N);
StridedMemRefType<T, N> descriptor;
- descriptor.basePtr = static_cast<T *>(ptr);
- descriptor.data = static_cast<T *>(alignedPtr);
+ descriptor.basePtr = ptr;
+ descriptor.data = alignedPtr;
descriptor.offset = 0;
std::copy(shape.begin(), shape.end(), descriptor.sizes);
auto strides = makeStrides<N>(shapeAlloc);
@@ -89,8 +89,8 @@ makeStridedMemRefDescriptor(T *ptr, T *alignedPtr, ArrayRef<int64_t> shape = {},
assert(shape.size() == N);
assert(shapeAlloc.size() == N);
StridedMemRefType<T, 0> descriptor;
- descriptor.basePtr = static_cast<T *>(ptr);
- descriptor.data = static_cast<T *>(alignedPtr);
+ descriptor.basePtr = ptr;
+ descriptor.data = alignedPtr;
descriptor.offset = 0;
return descriptor;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/147097
More information about the Mlir-commits
mailing list