From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 2/3] mesa: Fix build with llvm 18
Date: Wed, 14 Feb 2024 12:47:35 -0800 [thread overview]
Message-ID: <20240214205135.401454-2-raj.khem@gmail.com> (raw)
In-Reply-To: <20240214205135.401454-1-raj.khem@gmail.com>
Backport a relevant patch from mesa 24
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...-18-remove-useless-passes-partially-.patch | 59 +++++++++++++++++++
meta/recipes-graphics/mesa/mesa.inc | 1 +
2 files changed, 60 insertions(+)
create mode 100644 meta/recipes-graphics/mesa/files/0001-fix-ac-llvm-LLVM-18-remove-useless-passes-partially-.patch
diff --git a/meta/recipes-graphics/mesa/files/0001-fix-ac-llvm-LLVM-18-remove-useless-passes-partially-.patch b/meta/recipes-graphics/mesa/files/0001-fix-ac-llvm-LLVM-18-remove-useless-passes-partially-.patch
new file mode 100644
index 00000000000..9acdb09fc64
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-fix-ac-llvm-LLVM-18-remove-useless-passes-partially-.patch
@@ -0,0 +1,59 @@
+From bc7e363f8e1a26342e6fd7241c1f0ebb722338d6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= <kai@dev.carbon-project.org>
+Date: Wed, 22 Nov 2023 20:21:11 +0100
+Subject: [PATCH] fix: ac/llvm: LLVM 18: remove useless passes, partially removed upstream
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream removed llvm::createLoopSinkPass() in commit
+<https://github.com/llvm/llvm-project/commit/b9975cec0ea0a2f10d65b7bd1197d9e1706cbd3d>
+and there is no useful alternative except moving to the new pass
+manager.
+
+On top of that, the usage of this optimisation pass and
+PromoteMemoryToRegisterPass were just useless, according to the
+upstream developer of the commit named above. Therefore the easiest
+solution is, as him, Marek and Dave suggested, to just remove these two
+passes from the pipeline for now.
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26336]
+
+Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10192
+Reference: https://github.com/llvm/llvm-project/pull/72811
+Reference: https://github.com/llvm/llvm-project/commit/b9975cec0ea0a2f10d65b7bd1197d9e1706cbd3d
+Suggested-by: Dave Airlie <airlied@redhat.com>
+Suggested-by: Aiden Grossman <agrossman154@yahoo.com>
+Suggested-by: Marek Olšák <maraeo@gmail.com>
+Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
+Reviewed-by: Marek Olšák <marek.olsak@amd.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26336>
+---
+ src/amd/llvm/ac_llvm_helper.cpp | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
+index 40a4399e705..5d065279ad1 100644
+--- a/src/amd/llvm/ac_llvm_helper.cpp
++++ b/src/amd/llvm/ac_llvm_helper.cpp
+@@ -299,17 +299,12 @@ LLVMPassManagerRef ac_create_passmgr(LLVMTargetLibraryInfoRef target_library_inf
+ */
+ unwrap(passmgr)->add(createBarrierNoopPass());
+
+- /* This pass eliminates all loads and stores on alloca'd pointers. */
+- unwrap(passmgr)->add(createPromoteMemoryToRegisterPass());
+ #if LLVM_VERSION_MAJOR >= 16
+ unwrap(passmgr)->add(createSROAPass(true));
+ #else
+ unwrap(passmgr)->add(createSROAPass());
+ #endif
+ /* TODO: restore IPSCCP */
+- if (LLVM_VERSION_MAJOR >= 16)
+- unwrap(passmgr)->add(createLoopSinkPass());
+- /* TODO: restore IPSCCP */
+ unwrap(passmgr)->add(createLICMPass());
+ unwrap(passmgr)->add(createCFGSimplificationPass());
+ /* This is recommended by the instruction combining pass. */
+--
+2.43.0
+
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index fabc52f0e7b..c48f2be31b7 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -18,6 +18,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \
file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
file://0001-gallium-Fix-build-with-llvm-17.patch \
+ file://0001-fix-ac-llvm-LLVM-18-remove-useless-passes-partially-.patch \
"
SRC_URI[sha256sum] = "dc7e8c077bc5884df95478263b34bdebb7e88e600689cb56fb07be2b8c304c36"
--
2.43.1
next prev parent reply other threads:[~2024-02-14 20:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 20:47 [PATCH 1/3] llvm: Upgrade to LLVM-18 RC2 Khem Raj
2024-02-14 20:47 ` Khem Raj [this message]
2024-02-14 20:47 ` [PATCH 3/3] vulkan-samples: Update to tip of trunk Khem Raj
2024-02-15 21:23 ` [OE-core] " Richard Purdie
2024-02-16 4:06 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240214205135.401454-2-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox