llvm: update to 4.0.0.

- Switch back to dynamic linking, seems to work again.  Fixes #4722.
- Disable libedit on musl (weird input bugs).
This commit is contained in:
Leah Neukirchen 2017-03-15 16:25:08 +01:00 committed by Christian Neukirchen
parent 0f23ee75d5
commit 5adcb02d08
7 changed files with 37 additions and 185 deletions

View file

@ -957,6 +957,7 @@ libyajl.so.2 yajl-2.0.1_1
libconfuse.so.1 confuse-3.0_1
libclang.so clang-3.4.2_1
libclang.so.3.9 clang-3.9.1_2
libclang.so.4 clang-4.0.0_1
liblldb.so lldb-3.5.1_1
libLLVM-3.5.so libllvm-3.5.0_1
libLLVM-3.6.so libllvm3.6-3.6.0_1
@ -965,6 +966,7 @@ libLLVM-3.7.1.so libllvm3.7-3.7.1_1
libLLVM-3.8.so libllvm3.8-3.8.0_1
libLLVM-3.8.1.so libllvm3.8-3.8.1_1
libLLVM-3.9.so libllvm3.9-3.9.0_1
libLLVM-4.0.so libllvm4.0-4.0.0_1
libisofs.so.6 libisofs-0.6.24_1
libbfd-2.22.so binutils-2.22_1<2.23_1
libopcodes-2.22.so binutils-2.22_1<2.23_1

View file

@ -23,19 +23,6 @@ index ceb094b..a48620d 100644
#ifndef _MSC_VER
#include <libgen.h>
#endif
diff --git a/source/Plugins/Process/Linux/Procfs.h b/source/Plugins/Process/Linux/Procfs.h
index 1b383fb..4ebe390 100644
--- a/source/Plugins/Process/Linux/Procfs.h
+++ b/source/Plugins/Process/Linux/Procfs.h
@@ -12,7 +12,7 @@
#include <sys/ptrace.h>
-#ifdef __ANDROID__
+#ifndef __GLIBC__
#if defined (__arm64__) || defined (__aarch64__)
typedef unsigned long elf_greg_t;
typedef elf_greg_t elf_gregset_t[(sizeof (struct user_pt_regs) / sizeof(elf_greg_t))];
--
2.5.1

View file

@ -1,17 +1,25 @@
--- lldb/source/Plugins/Process/Linux/Procfs.h.orig
+++ lldb/source/Plugins/Process/Linux/Procfs.h
@@ -11,12 +11,11 @@
@@ -11,21 +11,6 @@
// sys/procfs.h on Android/Linux for all supported architectures.
#include <sys/ptrace.h>
+#include <asm/ptrace.h>
#ifndef __GLIBC__
#if defined (__arm64__) || defined (__aarch64__)
-#ifdef __ANDROID__
-#if defined(__arm64__) || defined(__aarch64__)
-typedef unsigned long elf_greg_t;
-typedef elf_greg_t elf_gregset_t[(sizeof (struct user_pt_regs) / sizeof(elf_greg_t))];
-typedef elf_greg_t
- elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
-typedef struct user_fpsimd_state elf_fpregset_t;
+#include <sys/procfs.h>
#ifndef NT_FPREGSET
#define NT_FPREGSET NT_PRFPREG
#endif // NT_FPREGSET
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#elif defined(__mips__)
-#ifndef NT_FPREGSET
-#define NT_FPREGSET NT_PRFPREG
-#endif // NT_FPREGSET
-#endif
-#else // __ANDROID__
#include <sys/procfs.h>
-#endif // __ANDROID__

View file

@ -1,140 +0,0 @@
From 25e2616626caafb896517e18cd8aa724fba2b200 Mon Sep 17 00:00:00 2001
From: Tom Stellard <thomas.stellard@amd.com>
Date: Tue, 29 Nov 2016 03:41:28 +0000
Subject: [PATCH] Merging r280589:
------------------------------------------------------------------------
r280589 | nhaehnle | 2016-09-03 05:26:32 -0700 (Sat, 03 Sep 2016) | 19 lines
AMDGPU: Fix an interaction between WQM and polygon stippling
Summary:
This fixes a rare bug in polygon stippling with non-monolithic pixel shaders.
The underlying problem is as follows: the prolog part contains the polygon
stippling sequence, i.e. a kill. The main part then enables WQM based on the
_reduced_ exec mask, effectively undoing most of the polygon stippling.
Since we cannot know whether polygon stippling will be used, the main part
of a non-monolithic shader must always return to exact mode to fix this
problem.
Reviewers: arsenm, tstellarAMD, mareko
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: https://reviews.llvm.org/D23131
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288105 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/Target/AMDGPU/SIInstructions.td | 1 +
lib/Target/AMDGPU/SIWholeQuadMode.cpp | 7 -----
test/CodeGen/AMDGPU/wqm.ll | 49 ++++++++++++++++++++++++++++++++---
3 files changed, 46 insertions(+), 11 deletions(-)
diff --git a/lib/Target/AMDGPU/SIInstructions.td b/lib/Target/AMDGPU/SIInstructions.td
index 18b7d5d..dde5f2f 100644
--- a/lib/Target/AMDGPU/SIInstructions.td
+++ b/lib/Target/AMDGPU/SIInstructions.td
@@ -2029,6 +2029,7 @@ def SI_RETURN : PseudoInstSI <
let hasSideEffects = 1;
let SALU = 1;
let hasNoSchedulingInfo = 1;
+ let DisableWQM = 1;
}
let Uses = [EXEC], Defs = [EXEC, VCC, M0],
diff --git a/lib/Target/AMDGPU/SIWholeQuadMode.cpp b/lib/Target/AMDGPU/SIWholeQuadMode.cpp
index b200c15..1534d58 100644
--- a/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+++ b/lib/Target/AMDGPU/SIWholeQuadMode.cpp
@@ -219,13 +219,6 @@ char SIWholeQuadMode::scanInstructions(MachineFunction &MF,
markInstruction(MI, Flags, Worklist);
GlobalFlags |= Flags;
}
-
- if (WQMOutputs && MBB.succ_empty()) {
- // This is a prolog shader. Make sure we go back to exact mode at the end.
- Blocks[&MBB].OutNeeds = StateExact;
- Worklist.push_back(&MBB);
- GlobalFlags |= StateExact;
- }
}
return GlobalFlags;
diff --git a/test/CodeGen/AMDGPU/wqm.ll b/test/CodeGen/AMDGPU/wqm.ll
index 809a7ba..41e4264 100644
--- a/test/CodeGen/AMDGPU/wqm.ll
+++ b/test/CodeGen/AMDGPU/wqm.ll
@@ -17,17 +17,18 @@ main_body:
;CHECK-LABEL: {{^}}test2:
;CHECK-NEXT: ; %main_body
;CHECK-NEXT: s_wqm_b64 exec, exec
-;CHECK: image_sample
;CHECK-NOT: exec
-;CHECK: _load_dword v0,
-define amdgpu_ps float @test2(<8 x i32> inreg %rsrc, <4 x i32> inreg %sampler, float addrspace(1)* inreg %ptr, <4 x i32> %c) {
+define amdgpu_ps void @test2(<8 x i32> inreg %rsrc, <4 x i32> inreg %sampler, float addrspace(1)* inreg %ptr, <4 x i32> %c) {
main_body:
%c.1 = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %c, <8 x i32> %rsrc, <4 x i32> %sampler, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%c.2 = bitcast <4 x float> %c.1 to <4 x i32>
%c.3 = extractelement <4 x i32> %c.2, i32 0
%gep = getelementptr float, float addrspace(1)* %ptr, i32 %c.3
%data = load float, float addrspace(1)* %gep
- ret float %data
+
+ call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %data, float undef, float undef, float undef)
+
+ ret void
}
; ... but disabled for stores (and, in this simple case, not re-enabled).
@@ -414,6 +415,46 @@ entry:
ret void
}
+; Must return to exact at the end of a non-void returning shader,
+; otherwise the EXEC mask exported by the epilog will be wrong. This is true
+; even if the shader has no kills, because a kill could have happened in a
+; previous shader fragment.
+;
+; CHECK-LABEL: {{^}}test_nonvoid_return:
+; CHECK: s_mov_b64 [[LIVE:s\[[0-9]+:[0-9]+\]]], exec
+; CHECK: s_wqm_b64 exec, exec
+;
+; CHECK: s_and_b64 exec, exec, [[LIVE]]
+; CHECK-NOT: exec
+define amdgpu_ps <4 x float> @test_nonvoid_return() nounwind {
+ %tex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
+ %tex.i = bitcast <4 x float> %tex to <4 x i32>
+ %dtex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %tex.i, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
+ ret <4 x float> %dtex
+}
+
+; CHECK-LABEL: {{^}}test_nonvoid_return_unreachable:
+; CHECK: s_mov_b64 [[LIVE:s\[[0-9]+:[0-9]+\]]], exec
+; CHECK: s_wqm_b64 exec, exec
+;
+; CHECK: s_and_b64 exec, exec, [[LIVE]]
+; CHECK-NOT: exec
+define amdgpu_ps <4 x float> @test_nonvoid_return_unreachable(i32 inreg %c) nounwind {
+entry:
+ %tex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
+ %tex.i = bitcast <4 x float> %tex to <4 x i32>
+ %dtex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %tex.i, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
+
+ %cc = icmp sgt i32 %c, 0
+ br i1 %cc, label %if, label %else
+
+if:
+ store volatile <4 x float> %dtex, <4 x float>* undef
+ unreachable
+
+else:
+ ret <4 x float> %dtex
+}
declare void @llvm.amdgcn.image.store.v4i32(<4 x float>, <4 x i32>, <8 x i32>, i32, i1, i1, i1, i1) #1
declare void @llvm.amdgcn.buffer.store.f32(float, <4 x i32>, i32, i32, i1, i1) #1

View file

@ -1,20 +1,17 @@
# Template file for 'llvm'
pkgname=llvm
version=3.9.1
revision=2
version=4.0.0
revision=1
wrksrc="llvm-${version}.src"
lib32disabled=yes
build_style=cmake
configure_args="
-DCMAKE_BUILD_TYPE=Release
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_LINK_LLVM_DYLIB=OFF
-DLLVM_DYLIB_EXPORT_ALL=ON
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_FFI=ON
-DLLVM_BINUTILS_INCDIR=/usr/include
-DCMAKE_INSTALL_DO_STRIP=0"
nodebug=yes # while -DLLVM_LINK_LLVM_DYLIB=OFF
-DLLVM_BINUTILS_INCDIR=/usr/include"
short_desc="Low Level Virtual Machine"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.llvm.org"
@ -26,20 +23,19 @@ distfiles="
http://www.llvm.org/releases/${version}/cfe-${version}.src.tar.xz
http://www.llvm.org/releases/${version}/clang-tools-extra-${version}.src.tar.xz
http://www.llvm.org/releases/${version}/compiler-rt-${version}.src.tar.xz"
checksum="
1fd90354b9cf19232e8f168faf2220e79be555df3aa743242700879e8fd329ee
7e3311b2a1f80f4d3426e09f9459d079cab4d698258667e50a46dccbaaa460fc
48e128fabb2ddaee64ecb8935f7ac315b6e68106bc48aeaf655d179c65d87f34
e6c4cebb96dee827fa0470af313dff265af391cb6da8d429842ef208c8f25e63
29a5b65bdeff7767782d4427c7c64d54c3a8684bc6b217b74a70e575e4813635
d30967b1a5fa51a2503474aacc913e69fd05ae862d37bf310088955bdb13ec99"
checksum="8d10511df96e73b8ff9e7abbfb4d4d432edbdbe965f1f4f07afaf370b8a533be
2dbd8f05c662c1c9f11270fc9d0c63b419ddc988095e0ad107ed911cf882033d
33e06457b9ce0563c89b11ccc7ccabf9cff71b83571985a5bf8684c9150e7502
cea5f88ebddb30e296ca89130c83b9d46c2d833685e2912303c828054c4dc98a
41b7d37eb128fd362ab3431be5244cf50325bb3bb153895735c5bacede647c99
d3f25b23bef24c305137e6b44f7e81c51bbec764c119e01512a9bd2330be3115"
# XXX Investigate ocaml bindings.
hostmakedepends="groff perl python zlib-devel libffi-devel swig"
makedepends="python-devel zlib-devel libffi-devel libedit-devel libxml2-devel binutils-devel"
depends="libllvm3.9"
depends="libllvm4.0"
subpackages="clang-tools-extra clang clang-analyzer libllvm3.9"
subpackages="clang-tools-extra clang clang-analyzer libllvm4.0"
if [ -z "$CROSS_BUILD" ]; then
# XXX fails to cross compile due to python
subpackages+=" lldb lldb-devel"
@ -54,9 +50,6 @@ post_extract() {
patch -sNp1 -i ${i}
done
# https://bugs.freedesktop.org/show_bug.cgi?id=99078
patch -RsNp1 -i ${FILESDIR}/patches/llvm/reverse-llvm-AMDGPU-Fix-an-interaction-between-WQM-and-polygon-stippling.patch
cd ${XBPS_BUILDDIR}/compiler-rt-${version}.src
for i in ${FILESDIR}/patches/compiler-rt/compiler-rt-*.patch; do
msg_normal "Applying $i to compiler-rt\n"
@ -135,10 +128,14 @@ pre_configure() {
esac
configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}"
case "$XBPS_TARGET_MACHINE" in
*-musl) configure_args+=" -DLLDB_DISABLE_LIBEDIT=ON";;
esac
}
post_configure() {
# Don't leak CFLAGS into llvm-config.
sed -i -e "s|\(-specs=.*hardened-ld\)||g" -e "s|\(-specs=.*hardened-cc1\)||g" tools/llvm-config/BuildVariables.inc
sed -i -e "s|\(-specs=.*hardened-ld\)||g" -e "s|\(-specs=.*hardened-cc1\)||g" tools/llvm-config/BuildVariables.inc
}
do_install() {
@ -159,8 +156,6 @@ do_install() {
done
fi
ln -s /usr/bin/clang ${DESTDIR}/usr/bin/clang-cpp
# Remove llvm-config-host in cross builds.
if [ "$CROSS_BUILD" ]; then
rm -f ${DESTDIR}/usr/bin/llvm-config-host
@ -257,7 +252,7 @@ lldb-devel_package() {
vmove "usr/lib/liblldb*.so"
}
}
libllvm3.9_package() {
libllvm4.0_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove "usr/lib/libLLVM-*.so*"

View file

@ -17,7 +17,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
homepage="http://www.rust-lang.org/"
license="MIT, Apache-2.0"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
checksum=f966b31eb1cd9bd2df817c391a338eeb5b9253ae0a19bf8a11960c560f96e8b4
checksum=4baba3895b75f2492df6ce5a28a916307ecd1c088dc1fd02dbfa8a8e86174f87
case "$XBPS_MACHINE" in
x86_64-musl)