[llvm] [offload][SYCL] Add Module splitting by categories. (PR #131347)

Maksim Sabianin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 07:07:25 PDT 2025


================
@@ -0,0 +1,101 @@
+//===------------ SYCLUtils.h - SYCL utility functions --------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+// Utility functions for SYCL.
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_FRONTEND_SYCL_UTILS_H
+#define LLVM_FRONTEND_SYCL_UTILS_H
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Hashing.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+
+#include <optional>
+#include <string>
+
+namespace llvm {
+
+class Module;
+class Function;
+class raw_ostream;
+
+namespace sycl {
+
+enum class IRSplitMode {
+  IRSM_PER_TU,     // one module per translation unit
+  IRSM_PER_KERNEL, // one module per kernel
+  IRSM_NONE        // no splitting
+};
+
+/// \returns IRSplitMode value if \p S is recognized. Otherwise, std::nullopt is
+/// returned.
+std::optional<IRSplitMode> convertStringToSplitMode(StringRef S);
+
+/// FunctionCategorizer used for splitting in SYCL compilation flow.
----------------
maksimsab wrote:

Removed.

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


More information about the llvm-commits mailing list