llvm6.0, llvm8: removed; no revdeps. ok by duncaen and q66.

This commit is contained in:
Juan RP 2020-04-07 15:01:50 +02:00
parent 3f91211aab
commit 1cdf231fb9
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
30 changed files with 0 additions and 1350 deletions

View File

@ -1 +0,0 @@
llvm6.0

View File

@ -1 +0,0 @@
llvm8

View File

@ -1,9 +0,0 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "config-32.h"
#elif __WORDSIZE == 64
#include "config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -1,9 +0,0 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "llvm-config-32.h"
#elif __WORDSIZE == 64
#include "llvm-config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -1,41 +0,0 @@
From fd3bcfddcdb11757e95bc3a625017cbf234b67ed Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:14:32 +0200
Subject: [PATCH 1/7] fix stdint
---
lib/Headers/stdint.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/Headers/stdint.h b/lib/Headers/stdint.h
index 0303db9..8ca28df 100644
--- a/lib/Headers/stdint.h
+++ b/lib/Headers/stdint.h
@@ -22,8 +22,6 @@
*
\*===----------------------------------------------------------------------===*/
-#ifndef __CLANG_STDINT_H
-#define __CLANG_STDINT_H
/* If we're hosted, fall back to the system's stdint.h, which might have
* additional definitions.
@@ -72,6 +70,8 @@
# endif
#else
+#ifndef __CLANG_STDINT_H
+#define __CLANG_STDINT_H
/* C99 7.18.1.1 Exact-width integer types.
* C99 7.18.1.2 Minimum-width integer types.
@@ -703,5 +703,5 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#define INTMAX_C(v) __INTN_C(__INTMAX_WIDTH__, v)
#define UINTMAX_C(v) __UINTN_C(__INTMAX_WIDTH__, v)
-#endif /* __STDC_HOSTED__ */
#endif /* __CLANG_STDINT_H */
+#endif /* __STDC_HOSTED__ */
--
2.5.1

View File

@ -1,45 +0,0 @@
From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:14:57 +0200
Subject: [PATCH 2/7] fix unwind chain inclusion
---
lib/Headers/unwind.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index 303d792..44e10cc 100644
--- a/lib/Headers/unwind.h
+++ b/lib/Headers/unwind.h
@@ -23,9 +23,6 @@
/* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
-#ifndef __CLANG_UNWIND_H
-#define __CLANG_UNWIND_H
-
#if defined(__APPLE__) && __has_include_next(<unwind.h>)
/* Darwin (from 11.x on) provide an unwind.h. If that's available,
* use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
@@ -53,6 +50,9 @@
# endif
#else
+#ifndef __CLANG_UNWIND_H
+#define __CLANG_UNWIND_H
+
#include <stdint.h>
#ifdef __cplusplus
@@ -277,6 +277,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
}
#endif
+#endif /* __CLANG_UNWIND_H */
+
#endif
-#endif /* __CLANG_UNWIND_H */
--
2.5.1

View File

@ -1,39 +0,0 @@
--- clang/lib/Driver/ToolChains/Gnu.cpp.orig
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1802,7 +1802,8 @@
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
static const char *const AArch64Triples[] = {
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-linux-android",
- "aarch64-redhat-linux", "aarch64-suse-linux"};
+ "aarch64-redhat-linux", "aarch64-suse-linux",
+ "aarch64-linux-musl"};
static const char *const AArch64beLibDirs[] = {"/lib"};
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
"aarch64_be-linux-gnu"};
@@ -1813,7 +1814,9 @@
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
"armv7hl-redhat-linux-gnueabi",
"armv6hl-suse-linux-gnueabi",
- "armv7hl-suse-linux-gnueabi"};
+ "armv7hl-suse-linux-gnueabi",
+ "arm-linux-musleabihf",
+ "armv7l-linux-musleabihf"};
static const char *const ARMebLibDirs[] = {"/lib"};
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
"armeb-linux-androideabi"};
@@ -1827,6 +1830,7 @@
"x86_64-redhat-linux", "x86_64-suse-linux",
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
"x86_64-slackware-linux", "x86_64-linux-android",
+ "x86_64-linux-musl",
"x86_64-unknown-linux"};
static const char *const X32LibDirs[] = {"/libx32"};
static const char *const X86LibDirs[] = {"/lib32", "/lib"};
@@ -1835,6 +1839,7 @@
"i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux",
"i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux",
"i486-slackware-linux", "i686-montavista-linux", "i686-linux-android",
+ "i686-linux-musl",
"i586-linux-gnu"};
static const char *const MIPSLibDirs[] = {"/lib"};

View File

@ -1,11 +0,0 @@
--- lldb-5.0.0.src/include/lldb/Host/Editline.h.orig
+++ lldb-5.0.0.src/include/lldb/Host/Editline.h
@@ -44,7 +44,7 @@
// used in cases where this is true. This is a compile time dependecy, for now
// selected per target Platform
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
- defined(__OpenBSD__)
+ defined(__OpenBSD__) || defined(__linux__)
#define LLDB_EDITLINE_USE_WCHAR 1
#include <codecvt>
#else

View File

@ -1,25 +0,0 @@
--- lldb/source/Plugins/Process/Linux/Procfs.h.orig
+++ lldb/source/Plugins/Process/Linux/Procfs.h
@@ -11,21 +11,6 @@
// sys/procfs.h on Android/Linux for all supported architectures.
#include <sys/ptrace.h>
+#include <asm/ptrace.h>
-#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 struct user_fpsimd_state elf_fpregset_t;
-#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,74 +0,0 @@
From bc72a21666a9efc78e71b0296313f6e1449649fa Mon Sep 17 00:00:00 2001
From: Konstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Date: Wed, 22 Mar 2017 21:48:18 +0000
Subject: [PATCH] [AMDGPU] Fix bug 31610
Differential Revision: https://reviews.llvm.org/D31258
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298551 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/Target/AMDGPU/AMDGPURuntimeMetadata.h | 8 ++++----
lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp | 5 ++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h b/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h
index ed147ff4c43..36e7a0c42a9 100644
--- a/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h
+++ b/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h
@@ -40,8 +40,8 @@ namespace AMDGPU {
namespace RuntimeMD {
// Version and revision of runtime metadata
- const unsigned char MDVersion = 2;
- const unsigned char MDRevision = 0;
+ const uint32_t MDVersion = 2;
+ const uint32_t MDRevision = 0;
// Name of keys for runtime metadata.
namespace KeyName {
@@ -215,7 +215,7 @@ namespace RuntimeMD {
struct Metadata {
std::string Name;
std::string Language;
- std::vector<uint8_t> LanguageVersion;
+ std::vector<uint32_t> LanguageVersion;
std::vector<uint32_t> ReqdWorkGroupSize;
std::vector<uint32_t> WorkGroupSizeHint;
std::string VecTypeHint;
@@ -265,7 +265,7 @@ namespace RuntimeMD {
namespace Program {
// In-memory representation of program information.
struct Metadata {
- std::vector<uint8_t> MDVersionSeq;
+ std::vector<uint32_t> MDVersionSeq;
std::vector<std::string> PrintfInfo;
std::vector<Kernel::Metadata> Kernels;
diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp b/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
index 0e87d750f5d..7c96898297c 100644
--- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
+++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
@@ -49,7 +49,6 @@ static cl::opt<bool>
CheckRuntimeMDParser("amdgpu-check-rtmd-parser", cl::Hidden,
cl::desc("Check AMDGPU runtime metadata YAML parser"));
-LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint8_t)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(std::string)
LLVM_YAML_IS_SEQUENCE_VECTOR(Kernel::Metadata)
@@ -297,9 +296,9 @@ static Kernel::Metadata getRuntimeMDForKernel(const Function &F) {
auto Node = MD->getOperand(0);
if (Node->getNumOperands() > 1) {
Kernel.Language = "OpenCL C";
- uint16_t Major = mdconst::extract<ConstantInt>(Node->getOperand(0))
+ uint32_t Major = mdconst::extract<ConstantInt>(Node->getOperand(0))
->getZExtValue();
- uint16_t Minor = mdconst::extract<ConstantInt>(Node->getOperand(1))
+ uint32_t Minor = mdconst::extract<ConstantInt>(Node->getOperand(1))
->getZExtValue();
Kernel.LanguageVersion.push_back(Major);
Kernel.LanguageVersion.push_back(Minor);
--
2.12.2

View File

@ -1,27 +0,0 @@
This patches LLVM to use ELFv2 on ppc64 uncoditionally unless overridden. We
need this because unlike most distros we use ELFv2 for both glibc and musl
on big endian ppc64.
--- a/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -197,9 +197,9 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
switch (TT.getArch()) {
case Triple::ppc64le:
- return PPCTargetMachine::PPC_ABI_ELFv2;
case Triple::ppc64:
- return PPCTargetMachine::PPC_ABI_ELFv1;
+ /* we use elfv2 by default for both endians and both libcs */
+ return PPCTargetMachine::PPC_ABI_ELFv2;
default:
return PPCTargetMachine::PPC_ABI_UNKNOWN;
}
--- a/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+++ b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
@@ -1,4 +1,5 @@
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2

View File

@ -1,79 +0,0 @@
From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:03:02 +0200
Subject: [PATCH 3/3] musl
---
include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
lib/Analysis/TargetLibraryInfo.cpp | 5 +++--
lib/Support/DynamicLibrary.cpp | 2 +-
lib/Support/Unix/Signals.inc | 6 +++---
utils/unittest/googletest/src/gtest.cc | 1 +
5 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
index e0a1ee3..465b65a 100644
--- a/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/include/llvm/Analysis/TargetLibraryInfo.h
@@ -18,6 +18,15 @@
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
+#undef fopen64
+#undef fseeko64
+#undef fstat64
+#undef fstatvfs64
+#undef ftello64
+#undef lstat64
+#undef stat64
+#undef tmpfile64
+
namespace llvm {
/// VecDesc - Describes a possible vectorization of a function.
/// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
index 5780764..1d548c1 100644
--- a/utils/unittest/googletest/src/gtest.cc
+++ b/utils/unittest/googletest/src/gtest.cc
@@ -120,6 +120,7 @@
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
+# include <sys/socket.h> // NOLINT
# include <netdb.h> // NOLINT
#endif
--
2.5.1
--- llvm-5.0.0.src/lib/Analysis/TargetLibraryInfo.cpp.orig
+++ llvm-5.0.0.src/lib/Analysis/TargetLibraryInfo.cpp
@@ -439,14 +439,15 @@
}
// The following functions are available on at least Linux:
- if (!T.isOSLinux()) {
+ if (!T.isOSLinux())
+ TLI.setUnavailable(LibFunc_memalign);
+ if (1 /*!T.isGlibc()*/) {
TLI.setUnavailable(LibFunc_dunder_strdup);
TLI.setUnavailable(LibFunc_dunder_strtok_r);
TLI.setUnavailable(LibFunc_dunder_isoc99_scanf);
TLI.setUnavailable(LibFunc_dunder_isoc99_sscanf);
TLI.setUnavailable(LibFunc_under_IO_getc);
TLI.setUnavailable(LibFunc_under_IO_putc);
- TLI.setUnavailable(LibFunc_memalign);
TLI.setUnavailable(LibFunc_fopen64);
TLI.setUnavailable(LibFunc_fseeko64);
TLI.setUnavailable(LibFunc_fstat64);
--- llvm-5.0.0.src/lib/Support/Unix/DynamicLibrary.inc.orig
+++ llvm-5.0.0.src/lib/Support/Unix/DynamicLibrary.inc
@@ -103,7 +103,7 @@
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(SymbolName, #SYM)) return &SYM
+ if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
// Under glibc we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we

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,101 +0,0 @@
# Template file for 'llvm6.0'
pkgname=llvm6.0
version=6.0.1
revision=6
wrksrc="llvm-${version}.src"
lib32disabled=yes
build_style=cmake
configure_args="
-DCMAKE_BUILD_TYPE=Release
-DLLVM_INSTALL_UTILS=ON
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_FFI=ON
-DLLVM_BINUTILS_INCDIR=/usr/include"
short_desc="Low Level Virtual Machine (6.0.x series)"
maintainer="Orphaned <orphan@voidlinux.org>"
homepage="https://www.llvm.org"
license="NCSA"
distfiles="https://www.llvm.org/releases/${version}/llvm-${version}.src.tar.xz"
checksum=b6d6c324f9c71494c0ccaf3dac1f16236d970002b42bb24a6c9e1634f7d0f4e2
# 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 libatomic-devel"
depends="libllvm6.0"
conflicts="llvm>=0"
subpackages="libllvm6.0"
post_extract() {
# patches
cd ${XBPS_BUILDDIR}/llvm-${version}.src
for i in ${FILESDIR}/patches/llvm/llvm-*.patch; do
msg_normal "Applying $i to llvm\n"
patch -sNp1 -i ${i}
done
}
pre_configure() {
# Vastly reduce size of debugging symbols:
CFLAGS=${CFLAGS/ -g/ -g1}
CXXFLAGS=${CXXFLAGS/ -g/ -g1}
if [ "$CROSS_BUILD" ]; then
msg_normal "Building host tblgen\n"
mkdir -p build/HOST
cd build/HOST
CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
cmake ../.. -DCMAKE_BUILD_TYPE=Release
make ${makejobs} -C utils/TableGen
configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/build/HOST/bin/llvm-tblgen"
cd ../..
fi
case "$XBPS_TARGET_MACHINE" in
i686*) _arch="X86";;
x86_64*) _arch="X86";;
armv5*) _arch="Armv5te";;
armv6*) _arch="Armv6";;
armv7*) _arch="Armv7";;
aarch64*) _arch="AArch64";;
mips*) _arch="Mips";;
ppc*) _arch="PowerPC";;
esac
configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}"
}
do_install() {
vlicense LICENSE.TXT
cd build
cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
# Fix permissions of static libs
chmod -x ${DESTDIR}/usr/lib/*.a
# Required for multilib.
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
for _header in llvm-config; do
mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
usr/include/llvm/Config ${_header}.h
done
fi
# Remove llvm-config-host in cross builds.
if [ "$CROSS_BUILD" ]; then
rm -f ${DESTDIR}/usr/bin/llvm-config-host
fi
}
libllvm6.0_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove "usr/lib/libLLVM-*.so*"
}
}

View File

@ -1,3 +0,0 @@
site=https://releases.llvm.org/
pattern="'\K[\d\.]*(?=')"
ignore="[!6]*"

View File

@ -1,9 +0,0 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "config-32.h"
#elif __WORDSIZE == 64
#include "config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -1,9 +0,0 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "llvm-config-32.h"
#elif __WORDSIZE == 64
#include "llvm-config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -1,41 +0,0 @@
From fd3bcfddcdb11757e95bc3a625017cbf234b67ed Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:14:32 +0200
Subject: [PATCH 1/7] fix stdint
---
lib/Headers/stdint.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/Headers/stdint.h b/lib/Headers/stdint.h
index 0303db9..8ca28df 100644
--- a/lib/Headers/stdint.h
+++ b/lib/Headers/stdint.h
@@ -22,8 +22,6 @@
*
\*===----------------------------------------------------------------------===*/
-#ifndef __CLANG_STDINT_H
-#define __CLANG_STDINT_H
/* If we're hosted, fall back to the system's stdint.h, which might have
* additional definitions.
@@ -72,6 +70,8 @@
# endif
#else
+#ifndef __CLANG_STDINT_H
+#define __CLANG_STDINT_H
/* C99 7.18.1.1 Exact-width integer types.
* C99 7.18.1.2 Minimum-width integer types.
@@ -703,5 +703,5 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#define INTMAX_C(v) __INTN_C(__INTMAX_WIDTH__, v)
#define UINTMAX_C(v) __UINTN_C(__INTMAX_WIDTH__, v)
-#endif /* __STDC_HOSTED__ */
#endif /* __CLANG_STDINT_H */
+#endif /* __STDC_HOSTED__ */
--
2.5.1

View File

@ -1,45 +0,0 @@
From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:14:57 +0200
Subject: [PATCH 2/7] fix unwind chain inclusion
---
lib/Headers/unwind.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index 303d792..44e10cc 100644
--- a/lib/Headers/unwind.h
+++ b/lib/Headers/unwind.h
@@ -23,9 +23,6 @@
/* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
-#ifndef __CLANG_UNWIND_H
-#define __CLANG_UNWIND_H
-
#if defined(__APPLE__) && __has_include_next(<unwind.h>)
/* Darwin (from 11.x on) provide an unwind.h. If that's available,
* use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
@@ -53,6 +50,9 @@
# endif
#else
+#ifndef __CLANG_UNWIND_H
+#define __CLANG_UNWIND_H
+
#include <stdint.h>
#ifdef __cplusplus
@@ -277,6 +277,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
}
#endif
+#endif /* __CLANG_UNWIND_H */
+
#endif
-#endif /* __CLANG_UNWIND_H */
--
2.5.1

View File

@ -1,91 +0,0 @@
--- a/lib/Driver/ToolChains/Gnu.cpp.orig 2019-03-30 15:08:33.136000000 +0100
+++ b/lib/Driver/ToolChains/Gnu.cpp 2019-03-30 15:10:24.666000000 +0100
@@ -1882,7 +1882,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
"armv7hl-redhat-linux-gnueabi",
"armv6hl-suse-linux-gnueabi",
- "armv7hl-suse-linux-gnueabi"};
+ "armv7hl-suse-linux-gnueabi",
+ "armv7l-linux-gnueabihf"};
static const char *const ARMebLibDirs[] = {"/lib"};
static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
"armeb-linux-androideabi"};
@@ -2014,6 +2015,78 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
return;
}
+ if (TargetTriple.isMusl()) {
+ static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
+ static const char *const ARMHFMuslTriples[] = {
+ "arm-linux-musleabihf", "armv7l-linux-musleabihf"
+ };
+ static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
+ static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
+ static const char *const X86MuslTriples[] = {"i686-linux-musl"};
+ static const char *const MIPSMuslTriples[] = {
+ "mips-linux-musl", "mipsel-linux-musl",
+ "mipsel-linux-muslhf", "mips-linux-muslhf"
+ };
+ static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
+ static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
+ static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
+
+ switch (TargetTriple.getArch()) {
+ case llvm::Triple::aarch64:
+ LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
+ TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
+ BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
+ BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
+ break;
+ case llvm::Triple::arm:
+ LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
+ if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
+ TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
+ } else {
+ TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
+ }
+ break;
+ case llvm::Triple::x86_64:
+ LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+ TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
+ BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
+ BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
+ break;
+ case llvm::Triple::x86:
+ LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
+ TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
+ BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
+ BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
+ break;
+ case llvm::Triple::mips:
+ LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
+ TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
+ break;
+ case llvm::Triple::ppc:
+ LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
+ TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
+ BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
+ BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
+ break;
+ case llvm::Triple::ppc64:
+ LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
+ TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
+ BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
+ BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
+ break;
+ case llvm::Triple::ppc64le:
+ LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
+ TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
+ break;
+ default:
+ break;
+ }
+ TripleAliases.push_back(TargetTriple.str());
+ if (TargetTriple.str() != BiarchTriple.str())
+ BiarchTripleAliases.push_back(BiarchTriple.str());
+ return;
+ }
+
// Android targets should not use GNU/Linux tools or libraries.
if (TargetTriple.isAndroid()) {
static const char *const AArch64AndroidTriples[] = {

View File

@ -1,18 +0,0 @@
--- a/lib/Driver/ToolChains/Linux.cpp
+++ b/lib/Driver/ToolChains/Linux.cpp
@@ -590,12 +590,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
Loader = "ld.so.1";
break;
case llvm::Triple::ppc64:
- LibDir = "lib64";
+ LibDir = "lib";
Loader =
- (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+ (tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
break;
case llvm::Triple::ppc64le:
- LibDir = "lib64";
+ LibDir = "lib";
Loader =
(tools::ppc::hasPPCAbiArg(Args, "elfv1")) ? "ld64.so.1" : "ld64.so.2";
break;

View File

@ -1,26 +0,0 @@
--- a/lib/Basic/Targets/PPC.h
+++ b/lib/Basic/Targets/PPC.h
@@ -364,11 +364,10 @@ public:
if ((Triple.getArch() == llvm::Triple::ppc64le)) {
resetDataLayout("e-m:e-i64:64-n32:64");
- ABI = "elfv2";
} else {
resetDataLayout("E-m:e-i64:64-n32:64");
- ABI = "elfv1";
}
+ ABI = "elfv2";
switch (getTriple().getOS()) {
case llvm::Triple::FreeBSD:
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -1745,7 +1745,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
break;
}
- ABIName = "elfv1";
+ ABIName = "elfv2";
break;
}
case llvm::Triple::ppc64le:

View File

@ -1,38 +0,0 @@
We need this to ensure musl ppc targets use 64-bit long double, as our libgcc
ships without the 128-bit long double runtime funcs enabled for musl and even
if it did, the resulting binary would be incorrect.
--- a/lib/Basic/Targets/PPC.h
+++ b/lib/Basic/Targets/PPC.h
@@ -342,6 +342,15 @@ public:
break;
}
+ switch (getTriple().getEnvironment()) {
+ case llvm::Triple::Musl:
+ LongDoubleWidth = LongDoubleAlign = 64;
+ LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+ break;
+ default:
+ break;
+ }
+
// PPC32 supports atomics up to 4 bytes.
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
}
@@ -378,6 +387,15 @@ public:
break;
}
+ switch (getTriple().getEnvironment()) {
+ case llvm::Triple::Musl:
+ LongDoubleWidth = LongDoubleAlign = 64;
+ LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+ break;
+ default:
+ break;
+ }
+
// PPC64 supports atomics up to 8 bytes.
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
}

View File

@ -1,31 +0,0 @@
--- a/source/Plugins/Process/Linux/Procfs.h
+++ b/source/Plugins/Process/Linux/Procfs.h
@@ -11,21 +11,12 @@
// sys/procfs.h on Android/Linux for all supported architectures.
#include <sys/ptrace.h>
+#include <asm/ptrace.h>
-#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 struct user_fpsimd_state elf_fpregset_t;
-#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__
+#if !defined(__GLIBC__) && defined(__powerpc__)
+#define pt_regs musl_pt_regs
+#include <sys/procfs.h>
+#undef pt_regs
+#else
#include <sys/procfs.h>
-#endif // __ANDROID__
+#endif

View File

@ -1,58 +0,0 @@
From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:03:02 +0200
Subject: [PATCH 3/3] musl
---
include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
lib/Support/DynamicLibrary.cpp | 2 +-
lib/Support/Unix/Signals.inc | 6 +++---
utils/unittest/googletest/src/gtest.cc | 1 +
5 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
index e0a1ee3..465b65a 100644
--- a/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/include/llvm/Analysis/TargetLibraryInfo.h
@@ -18,6 +18,15 @@
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
+#undef fopen64
+#undef fseeko64
+#undef fstat64
+#undef fstatvfs64
+#undef ftello64
+#undef lstat64
+#undef stat64
+#undef tmpfile64
+
namespace llvm {
/// VecDesc - Describes a possible vectorization of a function.
/// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
index 5780764..1d548c1 100644
--- a/utils/unittest/googletest/src/gtest.cc
+++ b/utils/unittest/googletest/src/gtest.cc
@@ -120,6 +120,7 @@
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
+# include <sys/socket.h> // NOLINT
# include <netdb.h> // NOLINT
#endif
--
2.5.1
--- llvm-5.0.0.src/lib/Support/Unix/DynamicLibrary.inc.orig
+++ llvm-5.0.0.src/lib/Support/Unix/DynamicLibrary.inc
@@ -103,7 +103,7 @@
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(SymbolName, #SYM)) return &SYM
+ if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
// Under glibc we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we

View File

@ -1,27 +0,0 @@
This patches LLVM to use ELFv2 on ppc64 uncoditionally unless overridden. We
need this because unlike most distros we use ELFv2 for both glibc and musl
on big endian ppc64.
--- a/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -197,9 +197,9 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
switch (TT.getArch()) {
case Triple::ppc64le:
- return PPCTargetMachine::PPC_ABI_ELFv2;
case Triple::ppc64:
- return PPCTargetMachine::PPC_ABI_ELFv1;
+ /* we use elfv2 by default for both endians and both libcs */
+ return PPCTargetMachine::PPC_ABI_ELFv2;
default:
return PPCTargetMachine::PPC_ABI_UNKNOWN;
}
--- a/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+++ b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
@@ -1,4 +1,5 @@
-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2

View File

@ -1,219 +0,0 @@
Taken from Adélie Linux.
--- llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -138,6 +138,10 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
if (isDarwin())
HasLazyResolverStubs = true;
+ // Force SecurePlt for all 32-bit Linux targets
+ if (isTargetLinux() && !IsPPC64)
+ SecurePlt = true;
+
if (HasSPE && IsPPC64)
report_fatal_error( "SPE is only supported for 32-bit targets.\n", false);
if (HasSPE && (HasAltivec || HasQPX || HasVSX || HasFPU))
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -2769,8 +2769,12 @@ SDValue PPCTargetLowering::LowerGlobalTLSAddress(SDValue Op,
SDValue GOTReg = DAG.getRegister(PPC::X2, MVT::i64);
GOTPtr = DAG.getNode(PPCISD::ADDIS_GOT_TPREL_HA, dl,
PtrVT, GOTReg, TGA);
- } else
- GOTPtr = DAG.getNode(PPCISD::PPC32_GOT, dl, PtrVT);
+ } else {
+ if (isPositionIndependent())
+ GOTPtr = DAG.getNode(PPCISD::PPC32_PICGOT, dl, PtrVT);
+ else
+ GOTPtr = DAG.getNode(PPCISD::PPC32_GOT, dl, PtrVT);
+ }
SDValue TPOffset = DAG.getNode(PPCISD::LD_GOT_TPREL_L, dl,
PtrVT, TGA, GOTPtr);
return DAG.getNode(PPCISD::ADD_TLS, dl, PtrVT, TPOffset, TGATLS);
@@ -4941,7 +4945,8 @@ PrepareCall(SelectionDAG &DAG, SDValue &Callee, SDValue &InFlag, SDValue &Chain,
if (auto *G = dyn_cast<GlobalAddressSDNode>(Callee))
GV = G->getGlobal();
bool Local = TM.shouldAssumeDSOLocal(*Mod, GV);
- bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64;
+ bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64 &&
+ TM.isPositionIndependent();
if (isFunctionGlobalAddress(Callee)) {
GlobalAddressSDNode *G = cast<GlobalAddressSDNode>(Callee);
--- llvm/test/CodeGen/PowerPC/2008-10-28-f128-i32.ll
+++ llvm/test/CodeGen/PowerPC/2008-10-28-f128-i32.ll
@@ -62,7 +62,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: lfd 4, 328(1)
; CHECK-NEXT: fmr 1, 31
; CHECK-NEXT: fmr 2, 30
-; CHECK-NEXT: bl __gcc_qmul@PLT
+; CHECK-NEXT: bl __gcc_qmul
; CHECK-NEXT: lis 3, 16864
; CHECK-NEXT: stfd 1, 280(1)
; CHECK-NEXT: fmr 29, 1
@@ -84,7 +84,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: lfd 4, 360(1)
; CHECK-NEXT: lfd 1, 352(1)
; CHECK-NEXT: lfd 2, 344(1)
-; CHECK-NEXT: bl __gcc_qsub@PLT
+; CHECK-NEXT: bl __gcc_qsub
; CHECK-NEXT: mffs 0
; CHECK-NEXT: mtfsb1 31
; CHECK-NEXT: lis 3, .LCPI0_1@ha
@@ -117,7 +117,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: .LBB0_5: # %bb1
; CHECK-NEXT: li 4, 0
; CHECK-NEXT: mr 3, 30
-; CHECK-NEXT: bl __floatditf@PLT
+; CHECK-NEXT: bl __floatditf
; CHECK-NEXT: lis 3, 17392
; CHECK-NEXT: stfd 1, 208(1)
; CHECK-NEXT: fmr 29, 1
@@ -140,7 +140,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: lfd 4, 232(1)
; CHECK-NEXT: lfd 1, 224(1)
; CHECK-NEXT: lfd 2, 216(1)
-; CHECK-NEXT: bl __gcc_qadd@PLT
+; CHECK-NEXT: bl __gcc_qadd
; CHECK-NEXT: blt 2, .LBB0_7
; CHECK-NEXT: # %bb.6: # %bb1
; CHECK-NEXT: fmr 2, 28
@@ -163,7 +163,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: stw 3, 248(1)
; CHECK-NEXT: lfd 3, 256(1)
; CHECK-NEXT: lfd 4, 248(1)
-; CHECK-NEXT: bl __gcc_qsub@PLT
+; CHECK-NEXT: bl __gcc_qsub
; CHECK-NEXT: stfd 2, 176(1)
; CHECK-NEXT: fcmpu 0, 2, 27
; CHECK-NEXT: stfd 1, 168(1)
@@ -205,7 +205,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: lfd 4, 72(1)
; CHECK-NEXT: lfd 1, 64(1)
; CHECK-NEXT: lfd 2, 56(1)
-; CHECK-NEXT: bl __gcc_qsub@PLT
+; CHECK-NEXT: bl __gcc_qsub
; CHECK-NEXT: mffs 0
; CHECK-NEXT: mtfsb1 31
; CHECK-NEXT: lis 3, .LCPI0_2@ha
@@ -260,7 +260,7 @@ define i64 @__fixunstfdi(ppc_fp128 %a) nounwind readnone {
; CHECK-NEXT: lfd 4, 136(1)
; CHECK-NEXT: lfd 1, 128(1)
; CHECK-NEXT: lfd 2, 120(1)
-; CHECK-NEXT: bl __gcc_qsub@PLT
+; CHECK-NEXT: bl __gcc_qsub
; CHECK-NEXT: mffs 0
; CHECK-NEXT: mtfsb1 31
; CHECK-NEXT: lis 3, .LCPI0_0@ha
--- llvm/test/CodeGen/PowerPC/2010-02-12-saveCR.ll
+++ llvm/test/CodeGen/PowerPC/2010-02-12-saveCR.ll
@@ -11,7 +11,7 @@ entry:
; CHECK-DAG: ori [[T2:[0-9]+]], [[T2]], 34492
; CHECK-DAG: stwx [[T1]], 1, [[T2]]
; CHECK-DAG: addi 3, 1, 28
-; CHECK: bl bar@PLT
+; CHECK: bl bar
%x = alloca [100000 x i8] ; <[100000 x i8]*> [#uses=1]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%x1 = bitcast [100000 x i8]* %x to i8* ; <i8*> [#uses=1]
--- llvm/test/CodeGen/PowerPC/available-externally.ll
+++ llvm/test/CodeGen/PowerPC/available-externally.ll
@@ -14,7 +14,7 @@ target triple = "powerpc-unknown-linux-gnu"
define i32 @foo(i64 %x) nounwind {
entry:
; STATIC: foo:
-; STATIC: bl exact_log2@PLT
+; STATIC: bl exact_log2
; STATIC: blr
; PIC: foo:
--- llvm/test/CodeGen/PowerPC/stubs.ll
+++ llvm/test/CodeGen/PowerPC/stubs.ll
@@ -6,4 +6,4 @@ entry:
}
; CHECK: test1:
-; CHECK: bl __floatditf@PLT
+; CHECK: bl __floatditf
--- llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll
+++ llvm/test/CodeGen/PowerPC/umulo-128-legalisation-lowering.ll
@@ -72,7 +72,7 @@ define { i128, i8 } @muloti_test(i128 %l, i128 %r) unnamed_addr #0 {
; PPC32-NEXT: mr 28, 9
; PPC32-NEXT: mr 23, 6
; PPC32-NEXT: mr 24, 5
-; PPC32-NEXT: bl __multi3@PLT
+; PPC32-NEXT: bl __multi3
; PPC32-NEXT: mr 7, 4
; PPC32-NEXT: mullw 4, 24, 30
; PPC32-NEXT: mullw 8, 29, 23
--- llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
+++ llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
@@ -442,13 +442,22 @@
// On PPC64, VariantKind is VK_None, but on PPC32, it's VK_PLT, and it must
// come at the _end_ of the expression.
const MCOperand &Op = MI->getOperand(OpNo);
- const MCSymbolRefExpr &refExp = cast<MCSymbolRefExpr>(*Op.getExpr());
- O << refExp.getSymbol().getName();
+ const MCSymbolRefExpr *RefExp = nullptr;
+ const MCConstantExpr *ConstExp = nullptr;
+ if (const MCBinaryExpr *BinExpr = dyn_cast<MCBinaryExpr>(Op.getExpr())) {
+ RefExp = cast<MCSymbolRefExpr>(BinExpr->getLHS());
+ ConstExp = cast<MCConstantExpr>(BinExpr->getRHS());
+ } else
+ RefExp = cast<MCSymbolRefExpr>(Op.getExpr());
+
+ O << RefExp->getSymbol().getName();
O << '(';
printOperand(MI, OpNo+1, O);
O << ')';
- if (refExp.getKind() != MCSymbolRefExpr::VK_None)
- O << '@' << MCSymbolRefExpr::getVariantKindName(refExp.getKind());
+ if (RefExp->getKind() != MCSymbolRefExpr::VK_None)
+ O << '@' << MCSymbolRefExpr::getVariantKindName(RefExp->getKind());
+ if (ConstExp != nullptr)
+ O << '+' << ConstExp->getValue();
}
/// showRegistersWithPercentPrefix - Check if this register name should be
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -487,8 +487,14 @@
if (!Subtarget->isPPC64() && !Subtarget->isDarwin() &&
isPositionIndependent())
Kind = MCSymbolRefExpr::VK_PLT;
- const MCSymbolRefExpr *TlsRef =
+ const MCExpr *TlsRef =
MCSymbolRefExpr::create(TlsGetAddr, Kind, OutContext);
+
+ // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+ if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt())
+ TlsRef = MCBinaryExpr::createAdd(TlsRef,
+ MCConstantExpr::create(32768, OutContext),
+ OutContext);
const MachineOperand &MO = MI->getOperand(2);
const GlobalValue *GValue = MO.getGlobal();
MCSymbol *MOSymbol = getSymbol(GValue);
--- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -4054,7 +4054,20 @@
if (trySETCC(N))
return;
break;
-
+ // These nodes will be transformed into GETtlsADDR32 node, which
+ // later becomes BL_TLS __tls_get_addr(sym at tlsgd)@PLT
+ case PPCISD::ADDI_TLSLD_L_ADDR:
+ case PPCISD::ADDI_TLSGD_L_ADDR: {
+ const Module *Mod = MF->getFunction().getParent();
+ if (PPCLowering->getPointerTy(CurDAG->getDataLayout()) != MVT::i32 ||
+ !PPCSubTarget->isSecurePlt() || !PPCSubTarget->isTargetELF() ||
+ Mod->getPICLevel() == PICLevel::SmallPIC)
+ break;
+ // Attach global base pointer on GETtlsADDR32 node in order to
+ // generate secure plt code for TLS symbols.
+ getGlobalBaseReg();
+ }
+ break;
case PPCISD::CALL: {
const Module *M = MF->getFunction().getParent();

View File

@ -1,18 +0,0 @@
This allows us to override the optimization level as not all platforms can
deal with -O3.
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -847,6 +847,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
endif()
+set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
+
+if(NOT VOID_CXX_OPT_FLAGS STREQUAL "")
+ llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
+endif()
+
# Put this before tblgen. Else we have a circular dependence.
add_subdirectory(lib/Demangle)
add_subdirectory(lib/Support)

View File

@ -1,113 +0,0 @@
# Template file for 'llvm8'
pkgname=llvm8
version=8.0.1
revision=3
wrksrc="llvm-${version}.src"
build_style=cmake
configure_args="
-DCMAKE_BUILD_TYPE=Release
-DLLVM_INSTALL_UTILS=ON
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_FFI=ON
-DLLVM_BINUTILS_INCDIR=/usr/include"
hostmakedepends="groff perl python zlib-devel libffi-devel swig"
makedepends="python-devel zlib-devel libffi-devel libedit-devel
libxml2-devel binutils-devel libatomic-devel"
depends="libllvm8"
short_desc="Low Level Virtual Machine"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="NCSA"
homepage="https://www.llvm.org"
distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-${version}.src.tar.xz"
checksum="44787a6d02f7140f145e2250d56c9f849334e11f9ae379827510ed72f12b75e7"
disable_parallel_builds=yes
lib32disabled=yes
# all of these provide llvm-config
conflicts="llvm>=0 llvm3.9>=0 llvm6.0>=0 llvm7>=0 llvm9>=0"
subpackages="libllvm8"
case "$XBPS_TARGET_MACHINE" in
armv5*) broken="Tries to assemble VFP instructions with armv5tel arch";;
esac
post_patch() {
# patches
cd ${XBPS_BUILDDIR}/llvm-${version}.src
for i in ${FILESDIR}/patches/llvm/llvm-*.patch; do
msg_normal "Applying $i to llvm\n"
patch -sNp1 -i ${i}
done
}
pre_configure() {
# Vastly reduce size of debugging symbols:
CFLAGS=${CFLAGS/ -g/ -g1}
CXXFLAGS=${CXXFLAGS/ -g/ -g1}
# since gcc9, the build likes to blow up for ppc32 apparently because
# of clang being too large for a 24-bit relative call to the PLT, so
# optimize for size instead
case "$XBPS_TARGET_MACHINE" in
ppc|ppc-musl) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
esac
if [ "$CROSS_BUILD" ]; then
msg_normal "Building host tblgen\n"
mkdir -p build/HOST
cd build/HOST
CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
cmake ../.. -DCMAKE_BUILD_TYPE=Release
make ${makejobs} -C utils/TableGen
configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/build/HOST/bin/llvm-tblgen"
cd ../..
fi
case "$XBPS_TARGET_MACHINE" in
i686*) _arch="X86";;
x86_64*) _arch="X86";;
armv5*) _arch="Armv5te";;
armv6*) _arch="Armv6";;
armv7*) _arch="Armv7";;
aarch64*) _arch="AArch64";;
mips*) _arch="Mips";;
ppc*) _arch="PowerPC";;
esac
configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}"
}
do_install() {
vlicense LICENSE.TXT
cd build
cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
# Fix permissions of static libs
chmod -x ${DESTDIR}/usr/lib/*.a
# Required for multilib.
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
for _header in llvm-config; do
mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
usr/include/llvm/Config ${_header}.h
done
fi
# Remove llvm-config-host in cross builds.
if [ "$CROSS_BUILD" ]; then
rm -f ${DESTDIR}/usr/bin/llvm-config-host
fi
}
libllvm8_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove "usr/lib/libLLVM-*.so*"
}
}

View File

@ -1,2 +0,0 @@
site=https://releases.llvm.org/
pattern="'\K[\d\.]*(?=')"