[notify] mesa: 23.1.8 -> 23.2.1; new optional dependencies
This update added and restructured new and existing dependencies! All of these are optional, see README.md Added: - directx-headers (optional) for gallium d3d12 support - libclc spirv-llvm-translator (optional) for gallium clover OpenCL frontend - libclc rust-bindgen spirv-llvm-translator (optional) for gallium rusticl OpenCL frontend - libunwind (optional) for stack-traces - lm_sensors (optional) for HUD lmsensors support Moved: - glslang (now optional), needed for vulkan support
This commit is contained in:
parent
bb4bb67a99
commit
6cfb6de28e
@ -1,6 +1,4 @@
|
||||
drwxr-xr-x root/root usr/
|
||||
drwxr-xr-x root/root usr/bin/
|
||||
-r-xr-xr-x root/root usr/bin/mesa-overlay-control.py
|
||||
drwxr-xr-x root/root usr/include/
|
||||
drwxr-xr-x root/root usr/include/EGL/
|
||||
-rw-r--r-- root/root usr/include/EGL/eglext_angle.h
|
||||
@ -36,17 +34,12 @@ lrwxrwxrwx root/root usr/lib/libGLX_mesa.so.0 -> libGLX_mesa.so.0.0.0
|
||||
lrwxrwxrwx root/root usr/lib/libOSMesa.so -> libOSMesa.so.8
|
||||
lrwxrwxrwx root/root usr/lib/libOSMesa.so.8 -> libOSMesa.so.8.0.0
|
||||
-rwxr-xr-x root/root usr/lib/libOSMesa.so.8.0.0
|
||||
-rwxr-xr-x root/root usr/lib/libVkLayer_INTEL_nullhw.so
|
||||
-rwxr-xr-x root/root usr/lib/libVkLayer_MESA_device_select.so
|
||||
-rwxr-xr-x root/root usr/lib/libVkLayer_MESA_overlay.so
|
||||
lrwxrwxrwx root/root usr/lib/libgbm.so -> libgbm.so.1
|
||||
lrwxrwxrwx root/root usr/lib/libgbm.so.1 -> libgbm.so.1.0.0
|
||||
-rwxr-xr-x root/root usr/lib/libgbm.so.1.0.0
|
||||
lrwxrwxrwx root/root usr/lib/libglapi.so -> libglapi.so.0
|
||||
lrwxrwxrwx root/root usr/lib/libglapi.so.0 -> libglapi.so.0.0.0
|
||||
-rwxr-xr-x root/root usr/lib/libglapi.so.0.0.0
|
||||
-rwxr-xr-x root/root usr/lib/libvulkan_intel.so
|
||||
-rwxr-xr-x root/root usr/lib/libvulkan_radeon.so
|
||||
lrwxrwxrwx root/root usr/lib/libxatracker.so -> libxatracker.so.2
|
||||
lrwxrwxrwx root/root usr/lib/libxatracker.so.2 -> libxatracker.so.2.5.0
|
||||
-rwxr-xr-x root/root usr/lib/libxatracker.so.2.5.0
|
||||
@ -58,16 +51,6 @@ drwxr-xr-x root/root usr/lib/pkgconfig/
|
||||
drwxr-xr-x root/root usr/share/
|
||||
drwxr-xr-x root/root usr/share/drirc.d/
|
||||
-rw-r--r-- root/root usr/share/drirc.d/00-mesa-defaults.conf
|
||||
-rw-r--r-- root/root usr/share/drirc.d/00-radv-defaults.conf
|
||||
drwxr-xr-x root/root usr/share/glvnd/
|
||||
drwxr-xr-x root/root usr/share/glvnd/egl_vendor.d/
|
||||
-rw-r--r-- root/root usr/share/glvnd/egl_vendor.d/50_mesa.json
|
||||
drwxr-xr-x root/root usr/share/vulkan/
|
||||
drwxr-xr-x root/root usr/share/vulkan/explicit_layer.d/
|
||||
-rw-r--r-- root/root usr/share/vulkan/explicit_layer.d/VkLayer_INTEL_nullhw.json
|
||||
-rw-r--r-- root/root usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json
|
||||
drwxr-xr-x root/root usr/share/vulkan/icd.d/
|
||||
-rw-r--r-- root/root usr/share/vulkan/icd.d/intel_icd.x86_64.json
|
||||
-rw-r--r-- root/root usr/share/vulkan/icd.d/radeon_icd.x86_64.json
|
||||
drwxr-xr-x root/root usr/share/vulkan/implicit_layer.d/
|
||||
-rw-r--r-- root/root usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
|
||||
|
@ -1,5 +1,6 @@
|
||||
untrusted comment: verify with /etc/ports/xorg.pub
|
||||
RWTSGWF5Q7TndMZUh6CtS1yMoEogtMQajMu9S9dkm18VhfmV+wUhI7zVlgVRSTCCjcSgJU6O9EBNcqy2DmSPJOn7bzQH3QvGPQY=
|
||||
SHA256 (Pkgfile) = bb3a938d94e9a807d4cb46464cf215cdf2e123f7a84a8e57a41ea318151ee8bb
|
||||
SHA256 (.footprint) = 0a096e4a6066d23884d972266fbb66a32fe44c44877cebc2b82d4a9c694ece1e
|
||||
SHA256 (mesa-23.1.8.tar.xz) = 45434ff91a709844130a3174d9c0ef39c6b50725b2bb0c13e736f36134db14ad
|
||||
RWTSGWF5Q7TndNu1wro5Rp/Q3d9eriH0b7OG+dHAvMxdlHbKiC4oM+hukQO0JkYggC7mndzaM6eYOmoMv0rf1Q5AlncSf4DMGQ0=
|
||||
SHA256 (Pkgfile) = 63172d7a4ad6e4fb377464bd7bcd1c21023ab121c55ce6f715a5f327c000f938
|
||||
SHA256 (.footprint) = 6924460d44cdb41ff53cb50c2c805ea5a8d2fa2b38127c474fa859b200f82f1c
|
||||
SHA256 (mesa-23.2.1.tar.xz) = 64de0616fc2d801f929ab1ac2a4f16b3e2783c4309a724c8a259b20df8bbc1cc
|
||||
SHA256 (U_clover-llvm-move-to-modern-pass-manager.patch) = 9174cd8a44d3841b2614e0386e212b0dfb56a6e26ea69c7c4415f77918d62f5d
|
||||
|
31
mesa/Pkgfile
31
mesa/Pkgfile
@ -1,29 +1,34 @@
|
||||
# Description: Mesa 3D Graphics Library
|
||||
# URL: https://www.mesa3d.org/
|
||||
# Maintainer: CRUX Xorg Team, xorg-ports at crux dot nu
|
||||
# Depends on: elfutils glslang libdrm libglvnd llvm python3-mako xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm
|
||||
# Optional: libva libvdpau wayland-protocols
|
||||
# Depends on: elfutils libdrm libglvnd llvm python3-mako xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm
|
||||
# Optional: directx-headers glslang libclc libunwind libva libvdpau lm_sensors rust-bindgen spirv-llvm-translator vulkan-loader wayland-protocols
|
||||
|
||||
name=mesa
|
||||
version=23.1.8
|
||||
release=2
|
||||
source=(https://archive.mesa3d.org/$name-$version.tar.xz)
|
||||
version=23.2.1
|
||||
release=1
|
||||
source=(https://archive.mesa3d.org/$name-$version.tar.xz
|
||||
U_clover-llvm-move-to-modern-pass-manager.patch)
|
||||
|
||||
build() {
|
||||
prt-get isinst vulkan-loader && PKGMK_MESA_GALLIUM+='zink,'
|
||||
prt-get isinst directx-headers && PKGMK_MESA_GALLIUM+='d3d12,'
|
||||
prt-get isinst libclc spirv-llvm-translator && PKGMK_MESA+=' -D gallium-opencl=icd'
|
||||
prt-get isinst libclc rust-bindgen spirv-llvm-translator && PKGMK_MESA+=' -D gallium-rusticl=true'
|
||||
prt-get isinst glslang && PKGMK_MESA+=' -D vulkan-drivers=auto -D vulkan-layers=device-select,intel-nullhw,overlay' || PKGMK_MESA+=' -D vulkan-drivers='
|
||||
prt-get isinst libunwind && PKGMK_MESA+=' -D libunwind=enabled'
|
||||
prt-get isinst libva && PKGMK_MESA+=' -D gallium-va=enabled' || PKGMK_MESA+=' -D gallium-va=disabled'
|
||||
prt-get isinst libvdpau && PKGMK_MESA+=' -D gallium-vdpau=enabled' || PKGMK_MESA+=' -D gallium-vdpau=disabled'
|
||||
prt-get isinst lm_sensors && PKGMK_MESA+=' -D lmsensors=enabled'
|
||||
prt-get isinst vulkan-loader && PKGMK_MESA_GALLIUM+='zink,'
|
||||
prt-get isinst wayland-protocols && PKGMK_MESA_PLATFORMS+='wayland'
|
||||
## for future references
|
||||
#prt-get isinst xorg-libxdamage xorg-libxrandr xorg-libxshmfence xorg-libxvmc xorg-libxxf86vm && PKGMK_MESA_PLATFORMS+=',x11'
|
||||
PKGMK_MESA_PLATFORMS+=',x11'
|
||||
|
||||
CFLAGS+=' -mtls-dialect=gnu'
|
||||
CXXFLAGS+=' -mtls-dialect=gnu'
|
||||
# https://build.opensuse.org/package/show/openSUSE:Factory/Mesa
|
||||
patch -Np1 -d $name-$version -i $SRC/U_clover-llvm-move-to-modern-pass-manager.patch
|
||||
|
||||
sed '/Scalar.h/d;/Utils.h/d' \
|
||||
-i mesa-$version/src/gallium/auxiliary/gallivm/lp_bld_init.c
|
||||
|
||||
meson setup build mesa-$version $PKGMK_MESA \
|
||||
meson setup build $name-$version $PKGMK_MESA \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--buildtype=plain \
|
||||
@ -43,8 +48,6 @@ build() {
|
||||
-D gallium-drivers=${PKGMK_MESA_GALLIUM}crocus,iris,nouveau,r300,r600,radeonsi,svga,swrast,virgl,i915 \
|
||||
-D platforms=${PKGMK_MESA_PLATFORMS#,} \
|
||||
-D shared-glapi=enabled \
|
||||
-D vulkan-drivers=amd,intel \
|
||||
-D vulkan-layers=device-select,intel-nullhw,overlay \
|
||||
-D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc \
|
||||
-D glvnd=true
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
Install libva before building mesa to get hardware acceleration for the
|
||||
following drivers:
|
||||
|
||||
usr/lib/dri/nouveau_drv_video.so
|
||||
usr/lib/dri/r600_drv_video.so
|
||||
usr/lib/dri/radeonsi_drv_video.so
|
139
mesa/README.md
Normal file
139
mesa/README.md
Normal file
@ -0,0 +1,139 @@
|
||||
mesa options
|
||||
============
|
||||
|
||||
Infos copied from various places*, built against current CRUX 3.7
|
||||
|
||||
*:
|
||||
- [meson.build · main · Mesa / mesa · GitLab](https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/meson.build?ref_type=heads)
|
||||
- [meson_options.txt · main · Mesa / mesa · GitLab](https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/meson_options.txt?ref_type=heads)
|
||||
- [BLFS: Mesa-23.1.8](https://www.linuxfromscratch.org/blfs/view/svn/x/mesa.html)
|
||||
- [File Mesa.spec of Package Mesa - openSUSE Build Service](https://build.opensuse.org/package/view_file/openSUSE:Factory/Mesa/Mesa.spec?expand=1)
|
||||
|
||||
## directx-headers
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW -rwxr-xr-x root/root usr/lib/dri/d3d12_dri.so
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## glslang
|
||||
|
||||
glslang (for vulkan drivers)
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW drwxr-xr-x root/root usr/bin/
|
||||
NEW -r-xr-xr-x root/root usr/bin/mesa-overlay-control.py
|
||||
NEW -rwxr-xr-x root/root usr/lib/libVkLayer_MESA_overlay.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/libvulkan_intel.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/libvulkan_radeon.so
|
||||
NEW -rw-r--r-- root/root usr/share/drirc.d/00-radv-defaults.conf
|
||||
NEW -rw-r--r-- root/root usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json
|
||||
NEW -rw-r--r-- root/root usr/share/vulkan/icd.d/intel_icd.x86_64.json
|
||||
NEW -rw-r--r-- root/root usr/share/vulkan/icd.d/radeon_icd.x86_64.json
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## libclc spirv-llvm-translator
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW drwxr-xr-x root/root etc/
|
||||
NEW drwxr-xr-x root/root etc/OpenCL/
|
||||
NEW drwxr-xr-x root/root etc/OpenCL/vendors/
|
||||
NEW -rw-r--r-- root/root etc/OpenCL/vendors/mesa.icd
|
||||
NEW drwxr-xr-x root/root usr/lib/gallium-pipe/
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_crocus.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_i915.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_iris.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_nouveau.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_r300.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_r600.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_radeonsi.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_swrast.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/gallium-pipe/pipe_vmwgfx.so
|
||||
NEW lrwxrwxrwx root/root usr/lib/libMesaOpenCL.so -> libMesaOpenCL.so.1
|
||||
NEW lrwxrwxrwx root/root usr/lib/libMesaOpenCL.so.1 -> libMesaOpenCL.so.1.0.0
|
||||
NEW -rwxr-xr-x root/root usr/lib/libMesaOpenCL.so.1.0.0
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## libclc rust-bindgen spirv-llvm-translator
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW drwxr-xr-x root/root etc/
|
||||
NEW drwxr-xr-x root/root etc/OpenCL/
|
||||
NEW drwxr-xr-x root/root etc/OpenCL/vendors/
|
||||
NEW -rw-r--r-- root/root etc/OpenCL/vendors/rusticl.icd
|
||||
NEW lrwxrwxrwx root/root usr/lib/libRusticlOpenCL.so -> libRusticlOpenCL.so.1
|
||||
NEW lrwxrwxrwx root/root usr/lib/libRusticlOpenCL.so.1 -> libRusticlOpenCL.so.1.0.0
|
||||
NEW -rwxr-xr-x root/root usr/lib/libRusticlOpenCL.so.1.0.0
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## libunwind
|
||||
|
||||
[unchanged]
|
||||
|
||||
## libva
|
||||
|
||||
Install libva before building mesa to get hardware acceleration for the
|
||||
following drivers:
|
||||
|
||||
> libva-2.19.0 (to provide VA-API support for some gallium drivers, note that
|
||||
> there is a circular dependency. You must build libva first without EGL and
|
||||
> GLX support, install this package, and rebuild libva)
|
||||
[BLFS: Mesa-23.1.8](https://www.linuxfromscratch.org/blfs/view/svn/x/mesa.html)
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW -rwxr-xr-x root/root usr/lib/dri/nouveau_drv_video.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/dri/r600_drv_video.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/dri/radeonsi_drv_video.so
|
||||
NEW -rwxr-xr-x root/root usr/lib/dri/virtio_gpu_drv_video.so
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## libvdpau
|
||||
|
||||
libvdpau-1.5 (to build VDPAU drivers)
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW drwxr-xr-x root/root usr/lib/vdpau/
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_nouveau.so -> libvdpau_nouveau.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_nouveau.so.1 -> libvdpau_nouveau.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_nouveau.so.1.0 -> libvdpau_nouveau.so.1.0.0
|
||||
NEW -rwxr-xr-x root/root usr/lib/vdpau/libvdpau_nouveau.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r600.so -> libvdpau_r600.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r600.so.1 -> libvdpau_r600.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_r600.so.1.0 -> libvdpau_r600.so.1.0.0
|
||||
NEW -rwxr-xr-x root/root usr/lib/vdpau/libvdpau_r600.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_radeonsi.so -> libvdpau_radeonsi.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_radeonsi.so.1 -> libvdpau_radeonsi.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_radeonsi.so.1.0 -> libvdpau_radeonsi.so.1.0.0
|
||||
NEW -rwxr-xr-x root/root usr/lib/vdpau/libvdpau_radeonsi.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_virtio_gpu.so -> libvdpau_virtio_gpu.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_virtio_gpu.so.1 -> libvdpau_virtio_gpu.so.1.0.0
|
||||
NEW lrwxrwxrwx root/root usr/lib/vdpau/libvdpau_virtio_gpu.so.1.0 -> libvdpau_virtio_gpu.so.1.0.0
|
||||
NEW -rwxr-xr-x root/root usr/lib/vdpau/libvdpau_virtio_gpu.so.1.0.0
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## lm_sensors
|
||||
|
||||
[unchanged]
|
||||
|
||||
## vulkan-loader
|
||||
|
||||
```
|
||||
=======> New files found:
|
||||
NEW -rwxr-xr-x root/root usr/lib/dri/zink_dri.so
|
||||
=======> Building '/home/pkgmk/packages/mesa#23.2.1-1.pkg.tar.xz' succeeded.
|
||||
```
|
||||
|
||||
## wayland-protocols
|
||||
|
||||
[unchanged]
|
126
mesa/U_clover-llvm-move-to-modern-pass-manager.patch
Normal file
126
mesa/U_clover-llvm-move-to-modern-pass-manager.patch
Normal file
@ -0,0 +1,126 @@
|
||||
From 2d4fe5f229791fde52846b3f583c12508b5109d6 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Airlie <airlied@redhat.com>
|
||||
Date: Fri, 25 Aug 2023 12:43:44 +1000
|
||||
Subject: [PATCH] clover/llvm: move to modern pass manager.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This seems like it should work, but I haven't tested it yet.
|
||||
|
||||
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
|
||||
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
|
||||
---
|
||||
.../frontends/clover/llvm/invocation.cpp | 64 +++++++++++++++----
|
||||
1 file changed, 51 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
|
||||
index 7a50fea3323..43d26fe1abb 100644
|
||||
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
|
||||
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
|
||||
@@ -27,13 +27,17 @@
|
||||
#include <llvm/IR/DiagnosticPrinter.h>
|
||||
#include <llvm/IR/DiagnosticInfo.h>
|
||||
#include <llvm/IR/LLVMContext.h>
|
||||
+#include <llvm/IR/Module.h>
|
||||
#include <llvm/Support/raw_ostream.h>
|
||||
-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
|
||||
+#include <llvm/Transforms/IPO/Internalize.h>
|
||||
#include <llvm-c/Target.h>
|
||||
#ifdef HAVE_CLOVER_SPIRV
|
||||
#include <LLVMSPIRVLib/LLVMSPIRVLib.h>
|
||||
#endif
|
||||
|
||||
+#include <llvm-c/TargetMachine.h>
|
||||
+#include <llvm-c/Transforms/PassBuilder.h>
|
||||
+#include <llvm/Support/CBindingWrapping.h>
|
||||
#include <clang/CodeGen/CodeGenAction.h>
|
||||
#include <clang/Lex/PreprocessorOptions.h>
|
||||
#include <clang/Frontend/TextDiagnosticBuffer.h>
|
||||
@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
|
||||
|
||||
namespace {
|
||||
void
|
||||
- optimize(Module &mod, unsigned optimization_level,
|
||||
+ optimize(Module &mod,
|
||||
+ const std::string& ir_target,
|
||||
+ unsigned optimization_level,
|
||||
bool internalize_symbols) {
|
||||
- ::llvm::legacy::PassManager pm;
|
||||
-
|
||||
// By default, the function internalizer pass will look for a function
|
||||
// called "main" and then mark all other functions as internal. Marking
|
||||
// functions as internal enables the optimizer to perform optimizations
|
||||
@@ -458,19 +462,53 @@ namespace {
|
||||
if (internalize_symbols) {
|
||||
std::vector<std::string> names =
|
||||
map(std::mem_fn(&Function::getName), get_kernels(mod));
|
||||
- pm.add(::llvm::createInternalizePass(
|
||||
+ internalizeModule(mod,
|
||||
[=](const ::llvm::GlobalValue &gv) {
|
||||
return std::find(names.begin(), names.end(),
|
||||
gv.getName()) != names.end();
|
||||
- }));
|
||||
+ });
|
||||
}
|
||||
|
||||
- ::llvm::PassManagerBuilder pmb;
|
||||
- pmb.OptLevel = optimization_level;
|
||||
- pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
|
||||
- ::llvm::Triple(mod.getTargetTriple()));
|
||||
- pmb.populateModulePassManager(pm);
|
||||
- pm.run(mod);
|
||||
+
|
||||
+ const char *opt_str = NULL;
|
||||
+ LLVMCodeGenOptLevel level;
|
||||
+ switch (optimization_level) {
|
||||
+ case 0:
|
||||
+ default:
|
||||
+ opt_str = "default<O0>";
|
||||
+ level = LLVMCodeGenLevelNone;
|
||||
+ break;
|
||||
+ case 1:
|
||||
+ opt_str = "default<O1>";
|
||||
+ level = LLVMCodeGenLevelLess;
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ opt_str = "default<O2>";
|
||||
+ level = LLVMCodeGenLevelDefault;
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ opt_str = "default<O3>";
|
||||
+ level = LLVMCodeGenLevelAggressive;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ const target &target = ir_target;
|
||||
+ LLVMTargetRef targ;
|
||||
+ char *err_message;
|
||||
+
|
||||
+ if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
|
||||
+ return;
|
||||
+ LLVMTargetMachineRef tm =
|
||||
+ LLVMCreateTargetMachine(targ, target.triple.c_str(),
|
||||
+ target.cpu.c_str(), "", level,
|
||||
+ LLVMRelocDefault, LLVMCodeModelDefault);
|
||||
+
|
||||
+ if (!tm)
|
||||
+ return;
|
||||
+ LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
|
||||
+ LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
|
||||
+
|
||||
+ LLVMDisposeTargetMachine(tm);
|
||||
}
|
||||
|
||||
std::unique_ptr<Module>
|
||||
@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
|
||||
auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
|
||||
auto mod = link(*ctx, *c, binaries, r_log);
|
||||
|
||||
- optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
|
||||
+ optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
|
||||
|
||||
static std::atomic_uint seq(0);
|
||||
const std::string id = "." + mod->getModuleIdentifier() + "-" +
|
||||
--
|
||||
2.42.0
|
Loading…
x
Reference in New Issue
Block a user