[Mlir-commits] [mlir] [mlir][spirv] Add TOSA graph constant marking (PR #201095)
Igor Wodiany
llvmlistbot at llvm.org
Tue Jun 2 06:42:11 PDT 2026
================
@@ -0,0 +1,92 @@
+//===- TosaToSPIRVTosaConstants.cpp - TOSA graph constants ---------------===//
+//
+// 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 preprocessing that marks TOSA constants that should be
+// lowered to SPIR-V Graph constants.
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Conversion/TosaToSPIRVTosa/TosaToSPIRVTosa.h"
+#include "mlir/Dialect/Func/IR/FuncOps.h"
+#include "mlir/Dialect/Tosa/IR/TosaOps.h"
+#include "mlir/IR/BuiltinAttributes.h"
+#include <optional>
+
+namespace mlir {
+#define GEN_PASS_DEF_TOSATOSPIRVTOSAMARKGRAPHCONSTANTS
+#include "mlir/Conversion/Passes.h.inc"
+
+namespace tosa {
+namespace {
+
+constexpr uint32_t maxInlineConstElements = 16;
+constexpr uint32_t maxInlineConstShapeElements = 32;
----------------
IgWod wrote:
How are those values decided upon?
https://github.com/llvm/llvm-project/pull/201095
More information about the Mlir-commits
mailing list