Backport patches to fix build with LLVM 15 which is now the default
version in meta-clang master.

Signed-off-by: Anuj Mittal <[email protected]>
---
 ...2ffae0cc12467838bc671e3b089924de90a6.patch | 33 ++++++++++
 ...a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch | 63 +++++++++++++++++++
 .../recipes-core/ispc/ispc_1.18.0.bb          |  2 +
 3 files changed, 98 insertions(+)
 create mode 100644 
dynamic-layers/clang-layer/recipes-core/ispc/ispc/6a1b2ffae0cc12467838bc671e3b089924de90a6.patch
 create mode 100644 
dynamic-layers/clang-layer/recipes-core/ispc/ispc/ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch

diff --git 
a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/6a1b2ffae0cc12467838bc671e3b089924de90a6.patch
 
b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/6a1b2ffae0cc12467838bc671e3b089924de90a6.patch
new file mode 100644
index 00000000..6aac0c79
--- /dev/null
+++ 
b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/6a1b2ffae0cc12467838bc671e3b089924de90a6.patch
@@ -0,0 +1,33 @@
+From 6a1b2ffae0cc12467838bc671e3b089924de90a6 Mon Sep 17 00:00:00 2001
+From: Dmitry Babokin <[email protected]>
+Date: Thu, 5 May 2022 16:34:34 -0700
+Subject: [PATCH] Bump ISPC version v1.19.0dev
+
+Upstream-Status: Backport
+
+Include only the LLVM specific bits and not the ispc version bump.
+
+Signed-off-by: Anuj Mittal <[email protected]>
+---
+diff --git a/src/ispc_version.h b/src/ispc_version.h
+index 0e28dfcfa..2b9d9b0cc 100644
+--- a/src/ispc_version.h
++++ b/src/ispc_version.h
+@@ -51,7 +51,7 @@
+ #define ISPC_LLVM_15_0 150000
+ 
+ #define OLDEST_SUPPORTED_LLVM ISPC_LLVM_10_0
+-#define LATEST_SUPPORTED_LLVM ISPC_LLVM_14_0
++#define LATEST_SUPPORTED_LLVM ISPC_LLVM_15_0
+ 
+ #ifdef __ispc__xstr
+ #undef __ispc__xstr
+@@ -63,7 +63,7 @@
+     __ispc__xstr(LLVM_VERSION_MAJOR) "." __ispc__xstr(LLVM_VERSION_MINOR) "." 
__ispc__xstr(LLVM_VERSION_PATCH)
+ 
+ #if ISPC_LLVM_VERSION < OLDEST_SUPPORTED_LLVM || ISPC_LLVM_VERSION > 
LATEST_SUPPORTED_LLVM
+-#error "Only LLVM 11.0 - 14.0 are supported"
++#error "Only LLVM 11.0 - 14.0 and 15.0 development branch are supported"
+ #endif
+ 
+ #define ISPC_VERSION_STRING                                                   
                                         \
diff --git 
a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch
 
b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch
new file mode 100644
index 00000000..a5ab8c19
--- /dev/null
+++ 
b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch
@@ -0,0 +1,63 @@
+From ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda Mon Sep 17 00:00:00 2001
+From: Arina Neshlyaeva <[email protected]>
+Date: Tue, 23 Aug 2022 15:21:50 -0700
+Subject: [PATCH] Adjust opt passes for LLVM 15
+
+Upstream-Status: Backport
+Signed-off-by: Anuj Mittal <[email protected]>
+---
+ src/opt.cpp | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/src/opt.cpp b/src/opt.cpp
+index 910821e26..86219f384 100644
+--- a/src/opt.cpp
++++ b/src/opt.cpp
+@@ -84,6 +84,9 @@
+ #include <llvm/Transforms/Scalar.h>
+ #include <llvm/Transforms/Scalar/GVN.h>
+ #include <llvm/Transforms/Scalar/InstSimplifyPass.h>
++#if ISPC_LLVM_VERSION >= ISPC_LLVM_15_0
++#include <llvm/Transforms/Scalar/SimpleLoopUnswitch.h>
++#endif
+ #include <llvm/Transforms/Utils.h>
+ #include <llvm/Transforms/Utils/BasicBlockUtils.h>
+ 
+@@ -647,7 +650,11 @@ void ispc::Optimize(llvm::Module *module, int optLevel) {
+         optPM.add(llvm::createCFGSimplificationPass());
+ #endif
+ 
++#if ISPC_LLVM_VERSION < ISPC_LLVM_15_0
++        // Starting LLVM 15.0 this pass is supported with new pass manager 
only (217e857)
++        // TODO: switch ISPC to new pass manager: 
https://github.com/ispc/ispc/issues/2359
+         optPM.add(llvm::createArgumentPromotionPass());
++#endif
+ 
+         optPM.add(llvm::createAggressiveDCEPass());
+         optPM.add(llvm::createInstructionCombiningPass(), 241);
+@@ -722,7 +729,11 @@ void ispc::Optimize(llvm::Module *module, int optLevel) {
+         optPM.add(CreateInstructionSimplifyPass());
+ 
+         optPM.add(llvm::createFunctionInliningPass());
++#if ISPC_LLVM_VERSION < ISPC_LLVM_15_0
++        // Starting LLVM 15.0 this pass is supported with new pass manager 
only (217e857)
++        // TODO: switch ISPC to new pass manager: 
https://github.com/ispc/ispc/issues/2359
+         optPM.add(llvm::createArgumentPromotionPass());
++#endif
+ 
+         optPM.add(llvm::createSROAPass());
+ 
+@@ -736,7 +747,13 @@ void ispc::Optimize(llvm::Module *module, int optLevel) {
+         optPM.add(llvm::createReassociatePass());
+         optPM.add(llvm::createLoopRotatePass());
+         optPM.add(llvm::createLICMPass());
++        // Loop unswitch pass was removed in LLVM 15.0 (fb4113).
++        // Recommended replacement: createSimpleLoopUnswitchLegacyPass
++#if ISPC_LLVM_VERSION < ISPC_LLVM_15_0
+         optPM.add(llvm::createLoopUnswitchPass(false));
++#else
++        optPM.add(llvm::createSimpleLoopUnswitchLegacyPass(false));
++#endif
+         optPM.add(llvm::createInstructionCombiningPass());
+         optPM.add(CreateInstructionSimplifyPass());
+         optPM.add(llvm::createIndVarSimplifyPass());
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb 
b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb
index db674178..24b0988e 100644
--- a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb
+++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.18.0.bb
@@ -15,6 +15,8 @@ SRC_URI = 
"git://github.com/ispc/ispc.git;protocol=https;branch=main \
            
file://0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch \
            file://0002-cmake-don-t-build-for-32-bit-targets.patch \
            file://0001-Fix-QA-Issues.patch \
+           file://6a1b2ffae0cc12467838bc671e3b089924de90a6.patch \
+           file://ec35a6f8e60ba77e59a6f2bfec27011e0ab34dda.patch \
            "
 SRCREV = "f7ec3aa173c816377c215d83196b5c7c3a88db1c"
 
-- 
2.37.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7674): 
https://lists.yoctoproject.org/g/meta-intel/message/7674
Mute This Topic: https://lists.yoctoproject.org/mt/93776858/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to