[mlir] [llvm] Shard the public llvm-config.h in multiple files (NFC) (PR #71273)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 4 17:51:31 PDT 2023


https://github.com/joker-eph updated https://github.com/llvm/llvm-project/pull/71273

>From 983956d81f7c492d4859df51e48c343b6043c002 Mon Sep 17 00:00:00 2001
From: Mehdi Amini <joker.eph at gmail.com>
Date: Fri, 3 Nov 2023 21:23:16 -0700
Subject: [PATCH] Shard the public llvm-config.h in three files (NFC)

This will allow for more granular include and improve incremental
rebuild and caching when switching targets or other options independently.

A single change of a target, default triple, or any option is
triggering a monolithic rebuild of any user of a single of these
options. We should make it as granular as possible.

There are also option in llvm-config.h that seems to belong to
config.h instead (that is it's not clear why they are part of the
public LLVM distribution). For example the aspects relative to the
"native" targets have to with the build machine and in a
cross-compiler environment shouldn't be in the install package.

Other candidates includes LLVM_ENABLE_DIA_SDK, HAVE_SYSEXITS_H,
LLVM_ON_UNIX.
---
 llvm/CMakeLists.txt                           |  13 +-
 .../llvm-config-build-llvm-dylib.h.cmake      |  16 ++
 .../llvm-config-build-shared-libs.h.cmake     |  16 ++
 .../Config/llvm-config-enable-curl.h.cmake    |  16 ++
 .../Config/llvm-config-enable-dia-sdk.h.cmake |  16 ++
 .../Config/llvm-config-enable-dump.h.cmake    |  16 ++
 .../Config/llvm-config-enable-httplib.h.cmake |  16 ++
 .../Config/llvm-config-enable-plugins.h.cmake |  16 ++
 .../Config/llvm-config-enable-threads.h.cmake |  16 ++
 .../Config/llvm-config-enable-zlib.h.cmake    |  16 ++
 .../Config/llvm-config-enable-zstd.h.cmake    |  16 ++
 .../llvm-config-force-enable-stats.h.cmake    |  18 ++
 ...lvm-config-force-use-old-toolchain.h.cmake |  16 ++
 .../Config/llvm-config-force-with-z3.h.cmake  |  16 ++
 .../Config/llvm-config-has-atomics.h.cmake    |  16 ++
 .../Config/llvm-config-have-sysexits.h.cmake  |  16 ++
 .../Config/llvm-config-have-tflite.h.cmake    |  16 ++
 .../llvm/Config/llvm-config-on-unix.h.cmake   |  16 ++
 .../Config/llvm-config-target-AArch64.h.cmake |  16 ++
 .../Config/llvm-config-target-AMDGPU.h.cmake  |  16 ++
 .../Config/llvm-config-target-ARC.h.cmake     |  16 ++
 .../Config/llvm-config-target-ARM.h.cmake     |  16 ++
 .../Config/llvm-config-target-AVR.h.cmake     |  16 ++
 .../Config/llvm-config-target-BPF.h.cmake     |  16 ++
 .../Config/llvm-config-target-CSKY.h.cmake    |  16 ++
 .../Config/llvm-config-target-DirectX.h.cmake |  16 ++
 .../Config/llvm-config-target-Hexagon.h.cmake |  16 ++
 .../Config/llvm-config-target-Lanai.h.cmake   |  16 ++
 .../llvm-config-target-LoongArch.h.cmake      |  16 ++
 .../Config/llvm-config-target-M68k.h.cmake    |  16 ++
 .../Config/llvm-config-target-MSP430.h.cmake  |  16 ++
 .../Config/llvm-config-target-Mips.h.cmake    |  16 ++
 .../Config/llvm-config-target-NVPTX.h.cmake   |  16 ++
 .../Config/llvm-config-target-PowerPC.h.cmake |  16 ++
 .../Config/llvm-config-target-RISCV.h.cmake   |  16 ++
 .../Config/llvm-config-target-SPIRV.h.cmake   |  16 ++
 .../Config/llvm-config-target-Sparc.h.cmake   |  16 ++
 .../Config/llvm-config-target-SystemZ.h.cmake |  16 ++
 .../llvm/Config/llvm-config-target-VE.h.cmake |  16 ++
 .../llvm-config-target-WebAssembly.h.cmake    |  16 ++
 .../Config/llvm-config-target-X86.h.cmake     |  16 ++
 .../Config/llvm-config-target-XCore.h.cmake   |  16 ++
 .../Config/llvm-config-target-Xtensa.h.cmake  |  16 ++
 .../Config/llvm-config-target-native.h.cmake  |  39 ++++
 .../Config/llvm-config-target-triple.h.cmake  |  22 ++
 .../llvm-config-unreachable-optimize.h.cmake  |  17 ++
 .../llvm-config-use-intel-jit-events.h.cmake  |  16 ++
 .../Config/llvm-config-use-oprofile.h.cmake   |  16 ++
 .../llvm/Config/llvm-config-use-perf.h.cmake  |  16 ++
 .../llvm/Config/llvm-config-version.h.cmake   |  27 +++
 .../llvm/Config/llvm-config-with-z3.h.cmake   |  16 ++
 llvm/include/llvm/Config/llvm-config.h.cmake  | 217 +++---------------
 .../GPU/Transforms/SerializeToCubin.cpp       |   1 +
 mlir/lib/Target/LLVM/NVVM/Target.cpp          |   1 +
 54 files changed, 884 insertions(+), 191 deletions(-)
 create mode 100644 llvm/include/llvm/Config/llvm-config-build-llvm-dylib.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-build-shared-libs.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-curl.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-dia-sdk.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-dump.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-httplib.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-plugins.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-threads.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-zlib.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-enable-zstd.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-force-enable-stats.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-force-use-old-toolchain.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-force-with-z3.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-has-atomics.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-have-sysexits.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-have-tflite.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-on-unix.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-AArch64.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-AMDGPU.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-ARC.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-ARM.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-AVR.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-BPF.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-CSKY.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-DirectX.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-Hexagon.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-Lanai.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-LoongArch.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-M68k.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-MSP430.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-Mips.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-NVPTX.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-PowerPC.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-RISCV.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-SPIRV.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-Sparc.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-SystemZ.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-VE.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-WebAssembly.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-X86.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-XCore.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-Xtensa.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-native.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-target-triple.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-unreachable-optimize.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-use-intel-jit-events.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-use-oprofile.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-use-perf.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-version.h.cmake
 create mode 100644 llvm/include/llvm/Config/llvm-config-with-z3.h.cmake

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 7ff3acd48304de7..6cadc6ed93c9cc3 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -1063,13 +1063,18 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
 
 endif()
 
-# Configure the three LLVM configuration header files.
+# Configure the LLVM configurations header files.
 configure_file(
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/config.h.cmake
   ${LLVM_INCLUDE_DIR}/llvm/Config/config.h)
-configure_file(
-  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config.h.cmake
-  ${LLVM_INCLUDE_DIR}/llvm/Config/llvm-config.h)
+
+# Configure all the llvm-config*.h.cmake files.
+file(GLOB LLVM_CONFIGS_H_FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config*.cmake)
+foreach(LLVM_CONFIGS_H_FILE ${LLVM_CONFIGS_H_FILES})
+  string( REPLACE ".cmake" "" LLVM_CONFIGS_H_FILE_DEST "${LLVM_CONFIGS_H_FILE}")
+  string( REPLACE "${LLVM_MAIN_INCLUDE_DIR}" "${LLVM_INCLUDE_DIR}" LLVM_CONFIGS_H_FILE_DEST "${LLVM_CONFIGS_H_FILE_DEST}")
+  configure_file(${LLVM_CONFIGS_H_FILE} ${LLVM_CONFIGS_H_FILE_DEST})
+endforeach()
 configure_file(
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/abi-breaking.h.cmake
   ${LLVM_INCLUDE_DIR}/llvm/Config/abi-breaking.h)
diff --git a/llvm/include/llvm/Config/llvm-config-build-llvm-dylib.h.cmake b/llvm/include/llvm/Config/llvm-config-build-llvm-dylib.h.cmake
new file mode 100644
index 000000000000000..bdd2884fec8595c
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-build-llvm-dylib.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-build-llvm-dylib.h.cmake -----*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_BUILD_LLVM_DYLIB_H
+#define LLVM_CONFIG_BUILD_LLVM_DYLIB_H
+
+/* Define if building libLLVM shared library */
+#cmakedefine01 LLVM_BUILD_LLVM_DYLIB
+
+#endif // LLVM_CONFIG_BUILD_LLVM_DYLIB_H
diff --git a/llvm/include/llvm/Config/llvm-config-build-shared-libs.h.cmake b/llvm/include/llvm/Config/llvm-config-build-shared-libs.h.cmake
new file mode 100644
index 000000000000000..09b07d9576fe979
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-build-shared-libs.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-build-shared-libs.h.cmake ----*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_BUILD_SHARED_LIBS_H
+#define LLVM_CONFIG_BUILD_SHARED_LIBS_H
+
+/* Define if building LLVM with BUILD_SHARED_LIBS */
+#cmakedefine01 LLVM_BUILD_SHARED_LIBS
+
+#endif // LLVM_CONFIG_BUILD_SHARED_LIBS_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-curl.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-curl.h.cmake
new file mode 100644
index 000000000000000..34bb26fce0b474a
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-curl.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-enable-curl.h.cmake ----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_CURL_H
+#define LLVM_CONFIG_ENABLE_CURL_H
+
+/* Define if we have curl and want to use it */
+#cmakedefine01 LLVM_ENABLE_CURL
+
+#endif // LLVM_CONFIG_ENABLE_CURL_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-dia-sdk.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-dia-sdk.h.cmake
new file mode 100644
index 000000000000000..daad52881f1e3fa
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-dia-sdk.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-enable-dia-sdk.h.cmake -------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_DIA_SDK_H
+#define LLVM_CONFIG_ENABLE_DIA_SDK_H
+
+/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
+#cmakedefine01 LLVM_ENABLE_DIA_SDK
+
+#endif // LLVM_CONFIG_ENABLE_DIA_SDK_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-dump.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-dump.h.cmake
new file mode 100644
index 000000000000000..a9bfea385d11e33
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-dump.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-enable-dump.h.cmake ----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_DUMP_H
+#define LLVM_CONFIG_ENABLE_DUMP_H
+
+/* Define if LLVM_ENABLE_DUMP is enabled */
+#cmakedefine01 LLVM_ENABLE_DUMP
+
+#endif // LLVM_CONFIG_ENABLE_DUMP_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-httplib.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-httplib.h.cmake
new file mode 100644
index 000000000000000..af9dbbc6604519c
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-httplib.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-httplib.h --------------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_HTTPLIB_H
+#define LLVM_CONFIG_ENABLE_HTTPLIB_H
+
+/* Define if we have cpp-httplib and want to use it */
+#cmakedefine01 LLVM_ENABLE_HTTPLIB
+
+#endif // LLVM_CONFIG_ENABLE_HTTPLIB_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-plugins.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-plugins.h.cmake
new file mode 100644
index 000000000000000..3fb97f1c15ac307
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-plugins.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-enable-plugins.h.cmake -------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_PLUGINS_H
+#define LLVM_CONFIG_ENABLE_PLUGINS_H
+
+/* Define if plugins enabled */
+#cmakedefine01 LLVM_ENABLE_PLUGINS
+
+#endif // LLVM_CONFIG_ENABLE_PLUGINS_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-threads.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-threads.h.cmake
new file mode 100644
index 000000000000000..56926fbcc477756
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-threads.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-threads.h --------------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_THREADS_H
+#define LLVM_CONFIG_ENABLE_THREADS_H
+
+/* Define if threads enabled */
+#cmakedefine01 LLVM_ENABLE_THREADS
+
+#endif // LLVM_CONFIG_ENABLE_THREADS_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-zlib.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-zlib.h.cmake
new file mode 100644
index 000000000000000..e59861714e65f16
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-zlib.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-enable-zlib.h.cmake ----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_ZLIB_H
+#define LLVM_CONFIG_ENABLE_ZLIB_H
+
+/* Define if zlib compression is available */
+#cmakedefine01 LLVM_ENABLE_ZLIB
+
+#endif // LLVM_CONFIG_ENABLE_ZLIB_H
diff --git a/llvm/include/llvm/Config/llvm-config-enable-zstd.h.cmake b/llvm/include/llvm/Config/llvm-config-enable-zstd.h.cmake
new file mode 100644
index 000000000000000..7ffa61bb9e5a0ad
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-enable-zstd.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-enable-zstd.h.cmake ----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ENABLE_ZSTD_H
+#define LLVM_CONFIG_ENABLE_ZSTD_H
+
+/* Define if zstd compression is available */
+#cmakedefine01 LLVM_ENABLE_ZSTD
+
+#endif // LLVM_CONFIG_ENABLE_ZSTD_H
diff --git a/llvm/include/llvm/Config/llvm-config-force-enable-stats.h.cmake b/llvm/include/llvm/Config/llvm-config-force-enable-stats.h.cmake
new file mode 100644
index 000000000000000..191e039f790ab47
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-force-enable-stats.h.cmake
@@ -0,0 +1,18 @@
+/*===------- llvm/Config/llvm-config-force-enable-stats.h.cmake ---*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_FORCE_ENABLE_STATS_H
+#define LLVM_CONFIG_FORCE_ENABLE_STATS_H
+
+/* Whether LLVM records statistics for use with GetStatistics(),
+ * PrintStatistics() or PrintStatisticsJSON()
+ */
+#cmakedefine01 LLVM_FORCE_ENABLE_STATS
+
+#endif // LLVM_CONFIG_FORCE_ENABLE_STATS_H
diff --git a/llvm/include/llvm/Config/llvm-config-force-use-old-toolchain.h.cmake b/llvm/include/llvm/Config/llvm-config-force-use-old-toolchain.h.cmake
new file mode 100644
index 000000000000000..c1b5b4894b572b3
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-force-use-old-toolchain.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-force-use-old-toolchain.h ----*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_FORCE_USE_OLD_TOOLCHAIN_H
+#define LLVM_CONFIG_FORCE_USE_OLD_TOOLCHAIN_H
+
+/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */
+#cmakedefine01 LLVM_FORCE_USE_OLD_TOOLCHAIN
+
+#endif // LLVM_CONFIG_FORCE_USE_OLD_TOOLCHAIN_H
diff --git a/llvm/include/llvm/Config/llvm-config-force-with-z3.h.cmake b/llvm/include/llvm/Config/llvm-config-force-with-z3.h.cmake
new file mode 100644
index 000000000000000..528b97105e6a79d
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-force-with-z3.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-force-with-z3.h.cmake --------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_FORCE_WITH_Z3_H
+#define LLVM_CONFIG_FORCE_WITH_Z3_H
+
+/* Define if we have z3 and want to build it */
+#cmakedefine01 LLVM_FORCE_WITH_Z3
+
+#endif // LLVM_CONFIG_FORCE_WITH_Z3_H
diff --git a/llvm/include/llvm/Config/llvm-config-has-atomics.h.cmake b/llvm/include/llvm/Config/llvm-config-has-atomics.h.cmake
new file mode 100644
index 000000000000000..c6a1a4605e07a48
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-has-atomics.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-has-atomics.h.cmake ----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_HAS_ATOMICS_H
+#define LLVM_CONFIG_HAS_ATOMICS_H
+
+/* Has gcc/MSVC atomic intrinsics */
+#cmakedefine01 LLVM_HAS_ATOMICS
+
+#endif // LLVM_CONFIG_HAS_ATOMICS_H
diff --git a/llvm/include/llvm/Config/llvm-config-have-sysexits.h.cmake b/llvm/include/llvm/Config/llvm-config-have-sysexits.h.cmake
new file mode 100644
index 000000000000000..a886d1caca09e7b
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-have-sysexits.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-have-sysexits.h.cmake --------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_HAVE_SYSEXITS_H_H
+#define LLVM_CONFIG_HAVE_SYSEXITS_H_H
+
+/* Define to 1 if you have the <sysexits.h> header file. */
+#cmakedefine01 HAVE_SYSEXITS_H
+
+#endif // LLVM_CONFIG_HAVE_SYSEXITS_H_H
diff --git a/llvm/include/llvm/Config/llvm-config-have-tflite.h.cmake b/llvm/include/llvm/Config/llvm-config-have-tflite.h.cmake
new file mode 100644
index 000000000000000..7e97ff8bc95fa02
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-have-tflite.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-have-tflite.h.cmake ----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_HAVE_TFLITE_H
+#define LLVM_CONFIG_HAVE_TFLITE_H
+
+/* Define if LLVM is using tflite */
+#cmakedefine01 LLVM_HAVE_TFLITE
+
+#endif // LLVM_CONFIG_HAVE_TFLITE_H
diff --git a/llvm/include/llvm/Config/llvm-config-on-unix.h.cmake b/llvm/include/llvm/Config/llvm-config-on-unix.h.cmake
new file mode 100644
index 000000000000000..da6712c07895035
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-on-unix.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-on-unix.cmake.h --------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_ON_UNIX_H
+#define LLVM_CONFIG_ON_UNIX_H
+
+/* Define if this is Unixish platform */
+#cmakedefine01 LLVM_ON_UNIX
+
+#endif // LLVM_CONFIG_ON_UNIX_H
diff --git a/llvm/include/llvm/Config/llvm-config-target-AArch64.h.cmake b/llvm/include/llvm/Config/llvm-config-target-AArch64.h.cmake
new file mode 100644
index 000000000000000..3f4ff4012bea3ff
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-AArch64.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-AArch64.h -------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_AARCH64_H
+#define LLVM_CONFIG_TARGET_AARCH64_H
+
+/* Define if the AArch64 target is built in */
+#cmakedefine01 LLVM_HAS_AARCH64_TARGET
+
+#endif // LLVM_CONFIG_TARGET_AARCH64_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-AMDGPU.h.cmake b/llvm/include/llvm/Config/llvm-config-target-AMDGPU.h.cmake
new file mode 100644
index 000000000000000..bd1f29181292432
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-AMDGPU.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-AMDGPU.h --------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_AMDGPU_H
+#define LLVM_CONFIG_TARGET_AMDGPU_H
+
+/* Define if the AMDGPU target is built in */
+#cmakedefine01 LLVM_HAS_AMDGPU_TARGET
+
+#endif // LLVM_CONFIG_TARGET_AMDGPU_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-ARC.h.cmake b/llvm/include/llvm/Config/llvm-config-target-ARC.h.cmake
new file mode 100644
index 000000000000000..e0d4199296e567e
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-ARC.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-ARC.h -----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_ARC_H
+#define LLVM_CONFIG_TARGET_ARC_H
+
+/* Define if the ARC target is built in */
+#cmakedefine01 LLVM_HAS_ARC_TARGET
+
+#endif // LLVM_CONFIG_TARGET_ARC_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-ARM.h.cmake b/llvm/include/llvm/Config/llvm-config-target-ARM.h.cmake
new file mode 100644
index 000000000000000..ce8530f2dd8d3e1
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-ARM.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-ARM.h -----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_ARM_H
+#define LLVM_CONFIG_TARGET_ARM_H
+
+/* Define if the ARM target is built in */
+#cmakedefine01 LLVM_HAS_ARM_TARGET
+
+#endif // LLVM_CONFIG_TARGET_ARM_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-AVR.h.cmake b/llvm/include/llvm/Config/llvm-config-target-AVR.h.cmake
new file mode 100644
index 000000000000000..007c5bbc9eec106
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-AVR.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-AVR.h -----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_AVR_H
+#define LLVM_CONFIG_TARGET_AVR_H
+
+/* Define if the AVR target is built in */
+#cmakedefine01 LLVM_HAS_AVR_TARGET
+
+#endif // LLVM_CONFIG_TARGET_AVR_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-BPF.h.cmake b/llvm/include/llvm/Config/llvm-config-target-BPF.h.cmake
new file mode 100644
index 000000000000000..910f3c7f1338554
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-BPF.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-BPF.h -----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_BPF_H
+#define LLVM_CONFIG_TARGET_BPF_H
+
+/* Define if the BPF target is built in */
+#cmakedefine01 LLVM_HAS_BPF_TARGET
+
+#endif // LLVM_CONFIG_TARGET_BPF_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-CSKY.h.cmake b/llvm/include/llvm/Config/llvm-config-target-CSKY.h.cmake
new file mode 100644
index 000000000000000..15c261fca00ca1a
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-CSKY.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-CSKY.h ----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_CSKY_H
+#define LLVM_CONFIG_TARGET_CSKY_H
+
+/* Define if the CSKY target is built in */
+#cmakedefine01 LLVM_HAS_CSKY_TARGET
+
+#endif // LLVM_CONFIG_TARGET_CSKY_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-DirectX.h.cmake b/llvm/include/llvm/Config/llvm-config-target-DirectX.h.cmake
new file mode 100644
index 000000000000000..b1afa8750987ca3
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-DirectX.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-DirectX.h -------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_DIRECTX_H
+#define LLVM_CONFIG_TARGET_DIRECTX_H
+
+/* Define if the DirectX target is built in */
+#cmakedefine01 LLVM_HAS_DIRECTX_TARGET
+
+#endif // LLVM_CONFIG_TARGET_DIRECTX_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-Hexagon.h.cmake b/llvm/include/llvm/Config/llvm-config-target-Hexagon.h.cmake
new file mode 100644
index 000000000000000..798ad1371ebd00d
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-Hexagon.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-Hexagon.h -------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_HEXAGON_H
+#define LLVM_CONFIG_TARGET_HEXAGON_H
+
+/* Define if the Hexagon target is built in */
+#cmakedefine01 LLVM_HAS_HEXAGON_TARGET
+
+#endif // LLVM_CONFIG_TARGET_HEXAGON_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-Lanai.h.cmake b/llvm/include/llvm/Config/llvm-config-target-Lanai.h.cmake
new file mode 100644
index 000000000000000..7dc3c8f58d1ec59
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-Lanai.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-Lanai.h ---------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_LANAI_H
+#define LLVM_CONFIG_TARGET_LANAI_H
+
+/* Define if the Lanai target is built in */
+#cmakedefine01 LLVM_HAS_LANAI_TARGET
+
+#endif // LLVM_CONFIG_TARGET_LANAI_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-LoongArch.h.cmake b/llvm/include/llvm/Config/llvm-config-target-LoongArch.h.cmake
new file mode 100644
index 000000000000000..f7722ac2e33f4bc
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-LoongArch.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-LoongArch.h -----------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_LOONGARCH_H
+#define LLVM_CONFIG_TARGET_LOONGARCH_H
+
+/* Define if the LoongArch target is built in */
+#cmakedefine01 LLVM_HAS_LOONGARCH_TARGET
+
+#endif // LLVM_CONFIG_TARGET_LOONGARCH_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-M68k.h.cmake b/llvm/include/llvm/Config/llvm-config-target-M68k.h.cmake
new file mode 100644
index 000000000000000..5391e436f32e982
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-M68k.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-M68k.h ----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_M68K_H
+#define LLVM_CONFIG_TARGET_M68K_H
+
+/* Define if the M68k target is built in */
+#cmakedefine01 LLVM_HAS_M68K_TARGET
+
+#endif // LLVM_CONFIG_TARGET_M68K_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-MSP430.h.cmake b/llvm/include/llvm/Config/llvm-config-target-MSP430.h.cmake
new file mode 100644
index 000000000000000..b802401b058c8d8
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-MSP430.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-MSP430.h --------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_MSP430_H
+#define LLVM_CONFIG_TARGET_MSP430_H
+
+/* Define if the MSP430 target is built in */
+#cmakedefine01 LLVM_HAS_MSP430_TARGET
+
+#endif // LLVM_CONFIG_TARGET_MSP430_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-Mips.h.cmake b/llvm/include/llvm/Config/llvm-config-target-Mips.h.cmake
new file mode 100644
index 000000000000000..b058b33bae7a4fa
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-Mips.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-Mips.h ----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_MIPS_H
+#define LLVM_CONFIG_TARGET_MIPS_H
+
+/* Define if the Mips target is built in */
+#cmakedefine01 LLVM_HAS_MIPS_TARGET
+
+#endif // LLVM_CONFIG_TARGET_MIPS_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-NVPTX.h.cmake b/llvm/include/llvm/Config/llvm-config-target-NVPTX.h.cmake
new file mode 100644
index 000000000000000..65b15e11cd9ca29
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-NVPTX.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-NVPTX.h ---------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_NVPTX_H
+#define LLVM_CONFIG_TARGET_NVPTX_H
+
+/* Define if the NVPTX target is built in */
+#cmakedefine01 LLVM_HAS_NVPTX_TARGET
+
+#endif // LLVM_CONFIG_TARGET_NVPTX_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-PowerPC.h.cmake b/llvm/include/llvm/Config/llvm-config-target-PowerPC.h.cmake
new file mode 100644
index 000000000000000..166242906231b36
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-PowerPC.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-PowerPC.h -------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_POWERPC_H
+#define LLVM_CONFIG_TARGET_POWERPC_H
+
+/* Define if the PowerPC target is built in */
+#cmakedefine01 LLVM_HAS_POWERPC_TARGET
+
+#endif // LLVM_CONFIG_TARGET_POWERPC_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-RISCV.h.cmake b/llvm/include/llvm/Config/llvm-config-target-RISCV.h.cmake
new file mode 100644
index 000000000000000..d7d66ff6f267a9a
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-RISCV.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-RISCV.h ---------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_RISCV_H
+#define LLVM_CONFIG_TARGET_RISCV_H
+
+/* Define if the RISCV target is built in */
+#cmakedefine01 LLVM_HAS_RISCV_TARGET
+
+#endif // LLVM_CONFIG_TARGET_RISCV_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-SPIRV.h.cmake b/llvm/include/llvm/Config/llvm-config-target-SPIRV.h.cmake
new file mode 100644
index 000000000000000..46ddfb936a3781c
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-SPIRV.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-SPIRV.h ---------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_SPIRV_H
+#define LLVM_CONFIG_TARGET_SPIRV_H
+
+/* Define if the SPIRV target is built in */
+#cmakedefine01 LLVM_HAS_SPIRV_TARGET
+
+#endif // LLVM_CONFIG_TARGET_SPIRV_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-Sparc.h.cmake b/llvm/include/llvm/Config/llvm-config-target-Sparc.h.cmake
new file mode 100644
index 000000000000000..1c3d1f47eb436de
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-Sparc.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-Sparc.h ---------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_SPARC_H
+#define LLVM_CONFIG_TARGET_SPARC_H
+
+/* Define if the Sparc target is built in */
+#cmakedefine01 LLVM_HAS_SPARC_TARGET
+
+#endif // LLVM_CONFIG_TARGET_SPARC_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-SystemZ.h.cmake b/llvm/include/llvm/Config/llvm-config-target-SystemZ.h.cmake
new file mode 100644
index 000000000000000..5b75441d8147630
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-SystemZ.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-SystemZ.h -------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_SYSTEMZ_H
+#define LLVM_CONFIG_TARGET_SYSTEMZ_H
+
+/* Define if the SystemZ target is built in */
+#cmakedefine01 LLVM_HAS_SYSTEMZ_TARGET
+
+#endif // LLVM_CONFIG_TARGET_SYSTEMZ_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-VE.h.cmake b/llvm/include/llvm/Config/llvm-config-target-VE.h.cmake
new file mode 100644
index 000000000000000..4cf6e968e05b1cf
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-VE.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-VE.h ------------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_VE_H
+#define LLVM_CONFIG_TARGET_VE_H
+
+/* Define if the VE target is built in */
+#cmakedefine01 LLVM_HAS_VE_TARGET
+
+#endif // LLVM_CONFIG_TARGET_VE_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-WebAssembly.h.cmake b/llvm/include/llvm/Config/llvm-config-target-WebAssembly.h.cmake
new file mode 100644
index 000000000000000..7de3495030fe3e4
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-WebAssembly.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-WebAssembly.h ---------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_WEBASSEMBLY_H
+#define LLVM_CONFIG_TARGET_WEBASSEMBLY_H
+
+/* Define if the WebAssembly target is built in */
+#cmakedefine01 LLVM_HAS_WEBASSEMBLY_TARGET
+
+#endif // LLVM_CONFIG_TARGET_WEBASSEMBLY_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-X86.h.cmake b/llvm/include/llvm/Config/llvm-config-target-X86.h.cmake
new file mode 100644
index 000000000000000..f6d745c3737b8df
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-X86.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-X86.h -----------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_X86_H
+#define LLVM_CONFIG_TARGET_X86_H
+
+/* Define if the X86 target is built in */
+#cmakedefine01 LLVM_HAS_X86_TARGET
+
+#endif // LLVM_CONFIG_TARGET_X86_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-XCore.h.cmake b/llvm/include/llvm/Config/llvm-config-target-XCore.h.cmake
new file mode 100644
index 000000000000000..880f17b321cfafe
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-XCore.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-XCore.h ---------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_XCORE_H
+#define LLVM_CONFIG_TARGET_XCORE_H
+
+/* Define if the XCore target is built in */
+#cmakedefine01 LLVM_HAS_XCORE_TARGET
+
+#endif // LLVM_CONFIG_TARGET_XCORE_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-Xtensa.h.cmake b/llvm/include/llvm/Config/llvm-config-target-Xtensa.h.cmake
new file mode 100644
index 000000000000000..55c404fe43697ac
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-Xtensa.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-target-Xtensa.h --------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_TARGET_XTENSA_H
+#define LLVM_CONFIG_TARGET_XTENSA_H
+
+/* Define if the Xtensa target is built in */
+#cmakedefine01 LLVM_HAS_XTENSA_TARGET
+
+#endif // LLVM_CONFIG_TARGET_XTENSA_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-native.h.cmake b/llvm/include/llvm/Config/llvm-config-target-native.h.cmake
new file mode 100644
index 000000000000000..2735a779d7595af
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-native.h.cmake
@@ -0,0 +1,39 @@
+/*===------- llvm/Config/llvm-config-target-native.h --------------*- C -*-===*/
+/*                                                                            */
+/* 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 defines macros about the native target configuration. */
+
+#ifndef LLVM_CONFIG_TARGET_NATIVE_H
+#define LLVM_CONFIG_TARGET_NATIVE_H
+
+/* LLVM architecture name for the native architecture, if available */
+#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}
+
+/* LLVM name for the native AsmParser init function, if available */
+#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser
+
+/* LLVM name for the native AsmPrinter init function, if available */
+#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
+
+/* LLVM name for the native Disassembler init function, if available */
+#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
+
+/* LLVM name for the native Target init function, if available */
+#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target
+
+/* LLVM name for the native TargetInfo init function, if available */
+#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo
+
+/* LLVM name for the native target MC init function, if available */
+#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC
+
+/* LLVM name for the native target MCA init function, if available */
+#cmakedefine LLVM_NATIVE_TARGETMCA LLVMInitialize${LLVM_NATIVE_ARCH}TargetMCA
+
+#endif // LLVM_CONFIG_TARGET_NATIVE_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-target-triple.h.cmake b/llvm/include/llvm/Config/llvm-config-target-triple.h.cmake
new file mode 100644
index 000000000000000..0d603f2c4c9ab35
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-target-triple.h.cmake
@@ -0,0 +1,22 @@
+/*===------- llvm/Config/llvm-config-target-triple.h --------------*- C -*-===*/
+/*                                                                            */
+/* 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 defines macros about the targets configuration. */
+
+#ifndef LLVM_CONFIG_TARGET_TRIPLE_H
+#define LLVM_CONFIG_TARGET_TRIPLE_H
+
+/* Target triple LLVM will generate code for by default */
+/* Doesn't use `cmakedefine` because it is allowed to be empty. */
+#define LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
+
+/* Host triple LLVM will be executed on */
+#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
+
+#endif // LLVM_CONFIG_TARGET_TRIPLE_H
\ No newline at end of file
diff --git a/llvm/include/llvm/Config/llvm-config-unreachable-optimize.h.cmake b/llvm/include/llvm/Config/llvm-config-unreachable-optimize.h.cmake
new file mode 100644
index 000000000000000..8ebf74fcfda7ed5
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-unreachable-optimize.h.cmake
@@ -0,0 +1,17 @@
+/*===------- llvm/Config/llvm-config-unreachable-optimize.h.cmake -*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_UNREACHABLE_OPTIMIZE_H
+#define LLVM_CONFIG_UNREACHABLE_OPTIMIZE_H
+
+/* Define if llvm_unreachable should be optimized with undefined behavior
+ * in non assert builds */
+#cmakedefine01 LLVM_UNREACHABLE_OPTIMIZE
+
+#endif // LLVM_CONFIG_UNREACHABLE_OPTIMIZE_H
diff --git a/llvm/include/llvm/Config/llvm-config-use-intel-jit-events.h.cmake b/llvm/include/llvm/Config/llvm-config-use-intel-jit-events.h.cmake
new file mode 100644
index 000000000000000..e3b45ef9a8e6c14
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-use-intel-jit-events.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-use-intel-jit-events.h.cmake -*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_USE_INTEL_JITEVENTS_H
+#define LLVM_CONFIG_USE_INTEL_JITEVENTS_H
+
+/* Define if we have the Intel JIT API runtime support library */
+#cmakedefine01 LLVM_USE_INTEL_JITEVENTS
+
+#endif // LLVM_CONFIG_USE_INTEL_JITEVENTS_H
diff --git a/llvm/include/llvm/Config/llvm-config-use-oprofile.h.cmake b/llvm/include/llvm/Config/llvm-config-use-oprofile.h.cmake
new file mode 100644
index 000000000000000..374ed154c59dc99
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-use-oprofile.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-oprofile.h -------------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_USE_OPROFILE_H
+#define LLVM_CONFIG_USE_OPROFILE_H
+
+/* Define if we have the oprofile JIT-support library */
+#cmakedefine01 LLVM_USE_OPROFILE
+
+#endif // LLVM_CONFIG_USE_OPROFILE_H
diff --git a/llvm/include/llvm/Config/llvm-config-use-perf.h.cmake b/llvm/include/llvm/Config/llvm-config-use-perf.h.cmake
new file mode 100644
index 000000000000000..9c4cb6baacf8bbf
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-use-perf.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-use-perf.h.cmake -------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_USE_PERF_H
+#define LLVM_CONFIG_USE_PERF_H
+
+/* Define if we have the perf JIT-support library */
+#cmakedefine01 LLVM_USE_PERF
+
+#endif // LLVM_CONFIG_USE_PERF_H
diff --git a/llvm/include/llvm/Config/llvm-config-version.h.cmake b/llvm/include/llvm/Config/llvm-config-version.h.cmake
new file mode 100644
index 000000000000000..e443e4d272b90d9
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-version.h.cmake
@@ -0,0 +1,27 @@
+/*===------- llvm/Config/llvm-config-version.h - llvm config ------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_VERSION_H
+#define LLVM_CONFIG_VERSION_H
+
+/* This file defines macros for the LLVM version. */
+
+/* Major version of the LLVM API */
+#define LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR}
+
+/* Minor version of the LLVM API */
+#define LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR}
+
+/* Patch version of the LLVM API */
+#define LLVM_VERSION_PATCH ${LLVM_VERSION_PATCH}
+
+/* LLVM version string */
+#define LLVM_VERSION_STRING "${PACKAGE_VERSION}"
+
+#endif // LLVM_CONFIG_VERSION_H
diff --git a/llvm/include/llvm/Config/llvm-config-with-z3.h.cmake b/llvm/include/llvm/Config/llvm-config-with-z3.h.cmake
new file mode 100644
index 000000000000000..99e6134dc3b1ee1
--- /dev/null
+++ b/llvm/include/llvm/Config/llvm-config-with-z3.h.cmake
@@ -0,0 +1,16 @@
+/*===------- llvm/Config/llvm-config-with-z3.h.cmake --------------*- C -*-===*/
+/*                                                                            */
+/* 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                    */
+/*                                                                            */
+/*===----------------------------------------------------------------------===*/
+
+#ifndef LLVM_CONFIG_WITH_Z3_H
+#define LLVM_CONFIG_WITH_Z3_H
+
+/* Define if we have z3 and want to build it */
+#cmakedefine01 LLVM_WITH_Z3
+
+#endif // LLVM_CONFIG_WITH_Z3_H
diff --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake
index 6605ea60df99e14..7d4953d4f4991c2 100644
--- a/llvm/include/llvm/Config/llvm-config.h.cmake
+++ b/llvm/include/llvm/Config/llvm-config.h.cmake
@@ -7,195 +7,38 @@
 /*                                                                            */
 /*===----------------------------------------------------------------------===*/
 
-/* This file enumerates variables from the LLVM configuration so that they
-   can be in exported headers and won't override package specific directives.
-   This is a C header that can be included in the llvm-c headers. */
-
 #ifndef LLVM_CONFIG_H
 #define LLVM_CONFIG_H
 
-/* Define if LLVM_ENABLE_DUMP is enabled */
-#cmakedefine LLVM_ENABLE_DUMP
-
-/* Target triple LLVM will generate code for by default */
-/* Doesn't use `cmakedefine` because it is allowed to be empty. */
-#define LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}"
-
-/* Define if threads enabled */
-#cmakedefine01 LLVM_ENABLE_THREADS
-
-/* Has gcc/MSVC atomic intrinsics */
-#cmakedefine01 LLVM_HAS_ATOMICS
-
-/* Host triple LLVM will be executed on */
-#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
-
-/* LLVM architecture name for the native architecture, if available */
-#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}
-
-/* LLVM name for the native AsmParser init function, if available */
-#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser
-
-/* LLVM name for the native AsmPrinter init function, if available */
-#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
-
-/* LLVM name for the native Disassembler init function, if available */
-#cmakedefine LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler
-
-/* LLVM name for the native Target init function, if available */
-#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target
-
-/* LLVM name for the native TargetInfo init function, if available */
-#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo
-
-/* LLVM name for the native target MC init function, if available */
-#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC
-
-/* LLVM name for the native target MCA init function, if available */
-#cmakedefine LLVM_NATIVE_TARGETMCA LLVMInitialize${LLVM_NATIVE_ARCH}TargetMCA
-
-/* Define if the AArch64 target is built in */
-#cmakedefine01 LLVM_HAS_AARCH64_TARGET
-
-/* Define if the AMDGPU target is built in */
-#cmakedefine01 LLVM_HAS_AMDGPU_TARGET
-
-/* Define if the ARC target is built in */
-#cmakedefine01 LLVM_HAS_ARC_TARGET
-
-/* Define if the ARM target is built in */
-#cmakedefine01 LLVM_HAS_ARM_TARGET
-
-/* Define if the AVR target is built in */
-#cmakedefine01 LLVM_HAS_AVR_TARGET
-
-/* Define if the BPF target is built in */
-#cmakedefine01 LLVM_HAS_BPF_TARGET
-
-/* Define if the CSKY target is built in */
-#cmakedefine01 LLVM_HAS_CSKY_TARGET
-
-/* Define if the DirectX target is built in */
-#cmakedefine01 LLVM_HAS_DIRECTX_TARGET
-
-/* Define if the Hexagon target is built in */
-#cmakedefine01 LLVM_HAS_HEXAGON_TARGET
-
-/* Define if the Lanai target is built in */
-#cmakedefine01 LLVM_HAS_LANAI_TARGET
-
-/* Define if the LoongArch target is built in */
-#cmakedefine01 LLVM_HAS_LOONGARCH_TARGET
-
-/* Define if the M68k target is built in */
-#cmakedefine01 LLVM_HAS_M68K_TARGET
-
-/* Define if the Mips target is built in */
-#cmakedefine01 LLVM_HAS_MIPS_TARGET
-
-/* Define if the MSP430 target is built in */
-#cmakedefine01 LLVM_HAS_MSP430_TARGET
-
-/* Define if the NVPTX target is built in */
-#cmakedefine01 LLVM_HAS_NVPTX_TARGET
-
-/* Define if the PowerPC target is built in */
-#cmakedefine01 LLVM_HAS_POWERPC_TARGET
-
-/* Define if the RISCV target is built in */
-#cmakedefine01 LLVM_HAS_RISCV_TARGET
-
-/* Define if the Sparc target is built in */
-#cmakedefine01 LLVM_HAS_SPARC_TARGET
-
-/* Define if the SPIRV target is built in */
-#cmakedefine01 LLVM_HAS_SPIRV_TARGET
-
-/* Define if the SystemZ target is built in */
-#cmakedefine01 LLVM_HAS_SYSTEMZ_TARGET
-
-/* Define if the VE target is built in */
-#cmakedefine01 LLVM_HAS_VE_TARGET
-
-/* Define if the WebAssembly target is built in */
-#cmakedefine01 LLVM_HAS_WEBASSEMBLY_TARGET
-
-/* Define if the X86 target is built in */
-#cmakedefine01 LLVM_HAS_X86_TARGET
-
-/* Define if the XCore target is built in */
-#cmakedefine01 LLVM_HAS_XCORE_TARGET
-
-/* Define if the Xtensa target is built in */
-#cmakedefine01 LLVM_HAS_XTENSA_TARGET
-
-/* Define if this is Unixish platform */
-#cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX}
-
-/* Define if we have the Intel JIT API runtime support library */
-#cmakedefine01 LLVM_USE_INTEL_JITEVENTS
-
-/* Define if we have the oprofile JIT-support library */
-#cmakedefine01 LLVM_USE_OPROFILE
-
-/* Define if we have the perf JIT-support library */
-#cmakedefine01 LLVM_USE_PERF
-
-/* Major version of the LLVM API */
-#define LLVM_VERSION_MAJOR ${LLVM_VERSION_MAJOR}
-
-/* Minor version of the LLVM API */
-#define LLVM_VERSION_MINOR ${LLVM_VERSION_MINOR}
-
-/* Patch version of the LLVM API */
-#define LLVM_VERSION_PATCH ${LLVM_VERSION_PATCH}
-
-/* LLVM version string */
-#define LLVM_VERSION_STRING "${PACKAGE_VERSION}"
-
-/* Whether LLVM records statistics for use with GetStatistics(),
- * PrintStatistics() or PrintStatisticsJSON()
- */
-#cmakedefine01 LLVM_FORCE_ENABLE_STATS
-
-/* Define if we have z3 and want to build it */
-#cmakedefine LLVM_WITH_Z3 ${LLVM_WITH_Z3}
-
-/* Define if we have curl and want to use it */
-#cmakedefine LLVM_ENABLE_CURL ${LLVM_ENABLE_CURL}
-
-/* Define if we have cpp-httplib and want to use it */
-#cmakedefine LLVM_ENABLE_HTTPLIB ${LLVM_ENABLE_HTTPLIB}
-
-/* Define if zlib compression is available */
-#cmakedefine01 LLVM_ENABLE_ZLIB
-
-/* Define if zstd compression is available */
-#cmakedefine01 LLVM_ENABLE_ZSTD
-
-/* Define if LLVM is using tflite */
-#cmakedefine LLVM_HAVE_TFLITE
-
-/* Define to 1 if you have the <sysexits.h> header file. */
-#cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H}
-
-/* Define if building libLLVM shared library */
-#cmakedefine LLVM_BUILD_LLVM_DYLIB
-
-/* Define if building LLVM with BUILD_SHARED_LIBS */
-#cmakedefine LLVM_BUILD_SHARED_LIBS
-
-/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */
-#cmakedefine LLVM_FORCE_USE_OLD_TOOLCHAIN ${LLVM_FORCE_USE_OLD_TOOLCHAIN}
-
-/* Define if llvm_unreachable should be optimized with undefined behavior
- * in non assert builds */
-#cmakedefine01 LLVM_UNREACHABLE_OPTIMIZE
-
-/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
-#cmakedefine01 LLVM_ENABLE_DIA_SDK
-
-/* Define if plugins enabled */
-#cmakedefine LLVM_ENABLE_PLUGINS
+// This file is here for backward compatibility: please don't add to it.
+//
+// The configuration is sharded in a few files, it is recommended
+// to include only the one you need to minimize the impact on
+// incremental build and caching.
+#include "llvm-config-build-llvm-dylib.h"
+#include "llvm-config-build-shared-libs.h"
+#include "llvm-config-enable-curl.h"
+#include "llvm-config-enable-dia-sdk.h"
+#include "llvm-config-enable-dump.h"
+#include "llvm-config-enable-httplib.h"
+#include "llvm-config-enable-plugins.h"
+#include "llvm-config-enable-threads.h"
+#include "llvm-config-enable-zlib.h"
+#include "llvm-config-enable-zstd.h"
+#include "llvm-config-force-enable-stats.h"
+#include "llvm-config-force-use-old-toolchain.h"
+#include "llvm-config-has-atomics.h"
+#include "llvm-config-have-sysexits.h"
+#include "llvm-config-have-tflite.h"
+#include "llvm-config-on-unix.h"
+#include "llvm-config-unreachable-optimize.h"
+#include "llvm-config-use-intel-jit-events.h"
+#include "llvm-config-use-oprofile.h"
+#include "llvm-config-use-perf.h"
+#include "llvm-config-with-z3.h"
+
+#include "llvm-config-target-native.h"
+#include "llvm-config-target-triple.h"
+#include "llvm-config-version.h"
 
 #endif
diff --git a/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp b/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp
index 34ad4e6868e157b..d8e86da4384bb5d 100644
--- a/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/SerializeToCubin.cpp
@@ -13,6 +13,7 @@
 
 #include "mlir/Dialect/GPU/Transforms/Passes.h"
 #include "mlir/Dialect/LLVMIR/NVVMDialect.h"
+#include "llvm/Config/llvm-config-target-NVPTX.h"
 #include "llvm/Support/Debug.h"
 
 #if MLIR_GPU_TO_CUBIN_PASS_ENABLE
diff --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index eaf94147e2a6f1f..5e190977eeec0dd 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -21,6 +21,7 @@
 #include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
 #include "mlir/Target/LLVMIR/Export.h"
 
+#include "llvm/Config/llvm-config-target-NVPTX.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/FormatVariadic.h"



More information about the llvm-commits mailing list