[Mlir-commits] [mlir] [mlir][spirv] Lower mapped TOSA custom ops to ExperimentalML.Call (PR #202581)

Igor Wodiany llvmlistbot at llvm.org
Tue Jun 9 05:23:52 PDT 2026


================
@@ -0,0 +1,107 @@
+//===- TosaToSPIRVTosaCustom.cpp - TOSA to SPIR-V Graph/TOSA patterns -----===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements patterns to convert TOSA IR to SPIR-V Graph/TOSA.
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Conversion/TosaToSPIRVTosa/TosaToSPIRVTosa.h"
+#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
+#include "mlir/Dialect/Tosa/IR/TosaOps.h"
+#include "mlir/Transforms/DialectConversion.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/Sequence.h"
+
+#define DEBUG_TYPE "tosa-to-spirv-tosa-custom-pattern"
+
+namespace mlir::tosa {
+namespace {
+
+Value getI8ArrayConstant(StringRef value, Location loc,
+                         ConversionPatternRewriter &rewriter) {
+  auto i8Type = rewriter.getIntegerType(8);
+  // Empty strings are encoded as a single NUL byte because SPIR-V array
----------------
IgWod wrote:

```suggestion
  // Empty strings are encoded as a single NULL byte because SPIR-V array
```

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


More information about the Mlir-commits mailing list