[Mlir-commits] [mlir] [mlir] fix overflow warning when generating embedded libdevice (PR #125801)

Mehdi Amini llvmlistbot at llvm.org
Wed Feb 5 01:09:17 PST 2025


================
@@ -159,8 +159,9 @@ LogicalResult SerializeGPUModuleBase::appendStandardLibs() {
 
   // Allocate a resource using one of the UnManagedResourceBlob method to wrap
   // the embedded data.
-  auto unmanagedBlob = UnmanagedAsmResourceBlob::allocateInferAlign(
-      ArrayRef<char>{_mlir_embedded_libdevice, _mlir_embedded_libdevice_size});
+  auto unmanagedBlob =
+      UnmanagedAsmResourceBlob::allocateInferAlign(ArrayRef<char>{
+          (char *)_mlir_embedded_libdevice, _mlir_embedded_libdevice_size});
----------------
joker-eph wrote:

```suggestion
          (const char *)_mlir_embedded_libdevice, _mlir_embedded_libdevice_size});
```

https://github.com/llvm/llvm-project/pull/125801


More information about the Mlir-commits mailing list