Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to LLVM 14 #12001

Merged
merged 62 commits into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
308f727
update cmake files to LLVM 14
andrewrk Feb 3, 2022
3479294
update llvm and clang tools to release/14.x
andrewrk Feb 3, 2022
6095459
apply zig patches to clang and llvm tools
andrewrk Feb 3, 2022
397e055
update C language headers to clang release/14.x
andrewrk Feb 3, 2022
5466e87
update C API bindings to LLVM 14
andrewrk Feb 3, 2022
c89dd15
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 1, 2022
bd68013
update libcxx to llvm 14.0.6
andrewrk Jul 1, 2022
aa964bd
update libcxxabi to llvm 14.0.6
andrewrk Jul 1, 2022
ceb3819
update libunwind to llvm 14.0.6
andrewrk Jul 1, 2022
41a0b81
CMake: disable deprecated function warnings
andrewrk Jul 2, 2022
1fa4a58
stage1: update to LLVM 14 API
andrewrk Jul 2, 2022
d19290e
stage1: update inline asm outputs to LLVM 14
andrewrk Jul 2, 2022
d55d989
update CPU features to LLVM 14
andrewrk Jul 2, 2022
ae0b072
LLD: there are fewer libraries to link against now
andrewrk Jul 2, 2022
3ab5912
LLD: the driver functions now return "false" to mean "error"
andrewrk Jul 2, 2022
c8a00c4
update clang command line options to LLVM 14
andrewrk Jul 2, 2022
f5b4b5d
std.zig.fmtId: revert recent changes
andrewrk Jul 2, 2022
48136c1
libcxx: do not include __config_site
andrewrk Jul 3, 2022
fcf77e0
libcxx: add additional include directory
andrewrk Jul 3, 2022
b1873f2
LLVM: update inline asm to LLVM14 semantics
andrewrk Jul 3, 2022
15f111a
LLVM: update lowering of saturating shift-left
andrewrk Jul 3, 2022
b698168
stage2: update vector alignment logic
andrewrk Jul 3, 2022
cbdd21c
std: disable tests regressed from LLVM 14
andrewrk Jul 3, 2022
d588f88
update C headers to LLVM 14.0.6
andrewrk Jul 3, 2022
15bdba4
update build scripts to LLD and LLVM 14 libraries
andrewrk Jul 4, 2022
fdc24e6
stage1: fix vectors of small int and bool tripping LLVM assertion
andrewrk Jul 4, 2022
6db190c
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 4, 2022
f59bd2b
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 4, 2022
fbd6c88
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 5, 2022
bcfc4f0
CI: update tarballs to LLVM 14
andrewrk Jul 5, 2022
927e59d
CI: fix wrong macos tarball
andrewrk Jul 5, 2022
2ee864c
CLI: add support for -fno-builtin
andrewrk Jul 5, 2022
388520a
fix behavior test which was relying on UB
andrewrk Jul 5, 2022
fc7c0e0
stage2: propagate use_stage1 to sub-compilation
andrewrk Jul 5, 2022
e8ce172
disable regressed wasm32 behavior tests from LLVM 14
andrewrk Jul 5, 2022
9a5c7b4
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 5, 2022
558ad19
disable regressed behavior tests from llvm 14
andrewrk Jul 6, 2022
d8fc8d0
compiler_rt: work around LLVM optimizing __muloti4 to call itself
andrewrk Jul 6, 2022
683ace7
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 6, 2022
38e3063
compiler_rt: RISC-V does not want gnu_f16_abi
andrewrk Jul 6, 2022
fa40bdd
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 6, 2022
6164801
update install_raw_hex test case
andrewrk Jul 6, 2022
222ea69
std: disable aarch64 tests that regressed from LLVM 14
andrewrk Jul 6, 2022
18950e8
std.fmt.parse_float: disable failing aarch64 test from LLVM 14
andrewrk Jul 6, 2022
1b610d7
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 7, 2022
f0fde1d
std.leb128: disable regressed test due to LLVM 14
andrewrk Jul 7, 2022
e5549de
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 7, 2022
1b9a9ee
langref: disable an example that regressed from LLVM 14
andrewrk Jul 7, 2022
e0b9200
llvm c++ wrapper: fix argument index calculations
andrewrk Jul 7, 2022
8e07b0c
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 7, 2022
6a3a0fe
Merge remote-tracking branch 'origin/master' into llvm14
andrewrk Jul 8, 2022
8e492f7
compiler_rt: enable __clear_cache for stage2
andrewrk Jul 8, 2022
bdf3fa1
CI: update scripts to new LLVM 14 tarballs
andrewrk Jul 8, 2022
aade885
CI: update scripts to stage1 LLVM 14 tarballs
andrewrk Jul 9, 2022
3e864c8
CI: azure: update build.zig for LLVM 14
andrewrk Jul 9, 2022
f976758
disable failing riscv64 tests from LLVM 14 upgrade
andrewrk Jul 9, 2022
a1c56ff
disable regressed translate-c test case on freebsd
andrewrk Jul 9, 2022
e0d5ae7
these riscv64 behavior tests work for stage1 but not stage2
andrewrk Jul 9, 2022
4d10fbe
windows_com: add missing __CRT_UUID_DECL() for IEnumSetupInstances
andrewrk Jul 9, 2022
321fec1
disable regressed float formatting test case
andrewrk Jul 9, 2022
31281a7
disable regressed math.sign test case
andrewrk Jul 9, 2022
f9bf488
two more regressed test cases; same cause as last two commits
andrewrk Jul 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ endif()
if(MSVC)
set(EXE_CFLAGS "${EXE_CFLAGS}")
else()
set(EXE_CFLAGS "${EXE_CFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Werror=type-limits -Wno-missing-braces -Wno-comment")
set(EXE_CFLAGS "${EXE_CFLAGS} -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Werror=type-limits -Wno-missing-braces -Wno-comment -Wno-deprecated-declarations")
if(MINGW)
set(EXE_CFLAGS "${EXE_CFLAGS} -Wno-format")
endif()
Expand Down
22 changes: 9 additions & 13 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ pub fn build(b: *Builder) !void {
"llvm-has-csky",
"Whether LLVM has the experimental target csky enabled",
) orelse false;
const llvm_has_ve = b.option(
bool,
"llvm-has-ve",
"Whether LLVM has the experimental target ve enabled",
) orelse false;
const llvm_has_arc = b.option(
bool,
"llvm-has-arc",
Expand Down Expand Up @@ -172,7 +167,6 @@ pub fn build(b: *Builder) !void {
exe_options.addOption(bool, "have_llvm", enable_llvm);
exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
exe_options.addOption(bool, "llvm_has_ve", llvm_has_ve);
exe_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
exe_options.addOption(bool, "force_gpa", force_gpa);

Expand Down Expand Up @@ -396,7 +390,6 @@ pub fn build(b: *Builder) !void {
test_cases_options.addOption(bool, "have_llvm", enable_llvm);
test_cases_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
test_cases_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
test_cases_options.addOption(bool, "llvm_has_ve", llvm_has_ve);
test_cases_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
test_cases_options.addOption(bool, "force_gpa", force_gpa);
test_cases_options.addOption(bool, "enable_qemu", b.enable_qemu);
Expand Down Expand Up @@ -997,15 +990,11 @@ const clang_libs = [_][]const u8{
"clangToolingCore",
};
const lld_libs = [_][]const u8{
"lldDriver",
"lldMinGW",
"lldELF",
"lldCOFF",
"lldMachO",
"lldWasm",
"lldReaderWriter",
"lldCore",
"lldYAML",
"lldMachO",
"lldCommon",
};
// This list can be re-generated with `llvm-config --libfiles` and then
Expand All @@ -1023,6 +1012,7 @@ const llvm_libs = [_][]const u8{
"LLVMXCoreCodeGen",
"LLVMXCoreDesc",
"LLVMXCoreInfo",
"LLVMX86TargetMCA",
"LLVMX86Disassembler",
"LLVMX86AsmParser",
"LLVMX86CodeGen",
Expand All @@ -1034,6 +1024,11 @@ const llvm_libs = [_][]const u8{
"LLVMWebAssemblyDesc",
"LLVMWebAssemblyUtils",
"LLVMWebAssemblyInfo",
"LLVMVEDisassembler",
"LLVMVEAsmParser",
"LLVMVECodeGen",
"LLVMVEDesc",
"LLVMVEInfo",
"LLVMSystemZDisassembler",
"LLVMSystemZAsmParser",
"LLVMSystemZCodeGen",
Expand Down Expand Up @@ -1093,6 +1088,7 @@ const llvm_libs = [_][]const u8{
"LLVMARMDesc",
"LLVMARMUtils",
"LLVMARMInfo",
"LLVMAMDGPUTargetMCA",
"LLVMAMDGPUDisassembler",
"LLVMAMDGPUAsmParser",
"LLVMAMDGPUCodeGen",
Expand Down Expand Up @@ -1138,7 +1134,6 @@ const llvm_libs = [_][]const u8{
"LLVMMIRParser",
"LLVMAsmPrinter",
"LLVMDebugInfoMSF",
"LLVMDebugInfoDWARF",
"LLVMSelectionDAG",
"LLVMCodeGen",
"LLVMIRReader",
Expand All @@ -1154,6 +1149,7 @@ const llvm_libs = [_][]const u8{
"LLVMBitWriter",
"LLVMAnalysis",
"LLVMProfileData",
"LLVMDebugInfoDWARF",
"LLVMObject",
"LLVMTextAPI",
"LLVMMCParser",
Expand Down
21 changes: 9 additions & 12 deletions ci/azure/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ pub fn build(b: *Builder) !void {
"llvm-has-csky",
"Whether LLVM has the experimental target csky enabled",
) orelse false;
const llvm_has_ve = b.option(
bool,
"llvm-has-ve",
"Whether LLVM has the experimental target ve enabled",
) orelse false;
const llvm_has_arc = b.option(
bool,
"llvm-has-arc",
Expand Down Expand Up @@ -131,7 +126,6 @@ pub fn build(b: *Builder) !void {
exe_options.addOption(bool, "have_llvm", enable_llvm);
exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
exe_options.addOption(bool, "llvm_has_ve", llvm_has_ve);
exe_options.addOption(bool, "llvm_has_arc", llvm_has_arc);
exe_options.addOption(bool, "force_gpa", force_gpa);

Expand Down Expand Up @@ -808,15 +802,11 @@ const clang_libs = [_][]const u8{
"clangToolingCore",
};
const lld_libs = [_][]const u8{
"lldDriver",
"lldMinGW",
"lldELF",
"lldCOFF",
"lldMachO",
"lldWasm",
"lldReaderWriter",
"lldCore",
"lldYAML",
"lldMachO",
"lldCommon",
};
// This list can be re-generated with `llvm-config --libfiles` and then
Expand All @@ -834,6 +824,7 @@ const llvm_libs = [_][]const u8{
"LLVMXCoreCodeGen",
"LLVMXCoreDesc",
"LLVMXCoreInfo",
"LLVMX86TargetMCA",
"LLVMX86Disassembler",
"LLVMX86AsmParser",
"LLVMX86CodeGen",
Expand All @@ -845,6 +836,11 @@ const llvm_libs = [_][]const u8{
"LLVMWebAssemblyDesc",
"LLVMWebAssemblyUtils",
"LLVMWebAssemblyInfo",
"LLVMVEDisassembler",
"LLVMVEAsmParser",
"LLVMVECodeGen",
"LLVMVEDesc",
"LLVMVEInfo",
"LLVMSystemZDisassembler",
"LLVMSystemZAsmParser",
"LLVMSystemZCodeGen",
Expand Down Expand Up @@ -904,6 +900,7 @@ const llvm_libs = [_][]const u8{
"LLVMARMDesc",
"LLVMARMUtils",
"LLVMARMInfo",
"LLVMAMDGPUTargetMCA",
"LLVMAMDGPUDisassembler",
"LLVMAMDGPUAsmParser",
"LLVMAMDGPUCodeGen",
Expand Down Expand Up @@ -949,7 +946,6 @@ const llvm_libs = [_][]const u8{
"LLVMMIRParser",
"LLVMAsmPrinter",
"LLVMDebugInfoMSF",
"LLVMDebugInfoDWARF",
"LLVMSelectionDAG",
"LLVMCodeGen",
"LLVMIRReader",
Expand All @@ -965,6 +961,7 @@ const llvm_libs = [_][]const u8{
"LLVMBitWriter",
"LLVMAnalysis",
"LLVMProfileData",
"LLVMDebugInfoDWARF",
"LLVMObject",
"LLVMTextAPI",
"LLVMMCParser",
Expand Down
4 changes: 2 additions & 2 deletions ci/azure/macos_arm64_script
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ ZIGDIR="$(pwd)"
HOST_ARCH="x86_64"
HOST_TARGET="$HOST_ARCH-macos-none"
HOST_MCPU="baseline"
HOST_CACHE_BASENAME="zig+llvm+lld+clang-$HOST_TARGET-0.10.0-dev.2348+d43761808"
HOST_CACHE_BASENAME="zig+llvm+lld+clang-$HOST_TARGET-0.10.0-dev.2931+bdf3fa12f"
HOST_PREFIX="$HOME/$HOST_CACHE_BASENAME"

ARCH="aarch64"
TARGET="$ARCH-macos-none"
MCPU="apple_a14"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.2348+d43761808"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.2931+bdf3fa12f"
PREFIX="$HOME/$CACHE_BASENAME"

JOBS="-j2"
Expand Down
2 changes: 1 addition & 1 deletion ci/azure/macos_script
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ZIGDIR="$(pwd)"
ARCH="x86_64"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.2348+d43761808"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.2931+bdf3fa12f"
PREFIX="$HOME/$CACHE_BASENAME"
JOBS="-j2"

Expand Down
2 changes: 1 addition & 1 deletion ci/azure/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
vmImage: 'windows-2019'
variables:
TARGET: 'x86_64-windows-gnu'
ZIG_LLVM_CLANG_LLD_NAME: 'zig+llvm+lld+clang-${{ variables.TARGET }}-0.9.1'
ZIG_LLVM_CLANG_LLD_NAME: 'zig+llvm+lld+clang-${{ variables.TARGET }}-0.10.0-dev.2931+bdf3fa12f'
ZIG_LLVM_CLANG_LLD_URL: 'https://ziglang.org/deps/${{ variables.ZIG_LLVM_CLANG_LLD_NAME }}.zip'
steps:
- pwsh: |
Expand Down
18 changes: 9 additions & 9 deletions ci/drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,56 @@ platform:

steps:
- name: build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_build

- name: test-1
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 1

- name: test-2
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 2

- name: test-3
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 3

- name: test-4
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 4

- name: test-5
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 5

- name: test-6
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 6

- name: test-7
depends_on:
- build
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
commands:
- ./ci/drone/linux_script_test 7

Expand All @@ -70,7 +70,7 @@ steps:
- test-5
- test-6
- test-7
image: ziglang/static-base:llvm13-aarch64-1
image: ziglang/static-base:llvm14-aarch64-3
environment:
SRHT_OAUTH_TOKEN:
from_secret: SRHT_OAUTH_TOKEN
Expand Down
2 changes: 1 addition & 1 deletion ci/srht/freebsd_script
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sudo pkg update -fq
sudo pkg install -y cmake py39-s3cmd wget curl jq samurai

ZIGDIR="$(pwd)"
CACHE_BASENAME="zig+llvm+lld+clang-x86_64-freebsd-gnu-0.9.1"
CACHE_BASENAME="zig+llvm+lld+clang-x86_64-freebsd-gnu-0.10.0-dev.2931+bdf3fa12f"
PREFIX="$HOME/$CACHE_BASENAME"

cd $HOME
Expand Down
4 changes: 2 additions & 2 deletions ci/zinc/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ workspace:

steps:
- name: test
image: ci/debian-amd64:11.1-3
image: ci/debian-amd64:11.1-6
commands:
- ./ci/zinc/linux_test.sh

Expand All @@ -22,7 +22,7 @@ steps:
- master
event:
- push
image: ci/debian-amd64:11.1-3
image: ci/debian-amd64:11.1-6
environment:
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
Expand Down
46 changes: 23 additions & 23 deletions cmake/Findclang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@

find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
PATHS
/usr/lib/llvm/13/include
/usr/lib/llvm-13/include
/usr/lib/llvm-13.0/include
/usr/local/llvm130/include
/usr/local/llvm13/include
/usr/local/opt/llvm@13/include
/opt/homebrew/opt/llvm@13/include
/usr/lib/llvm/14/include
/usr/lib/llvm-14/include
/usr/lib/llvm-14.0/include
/usr/local/llvm140/include
/usr/local/llvm14/include
/usr/local/opt/llvm@14/include
/opt/homebrew/opt/llvm@14/include
/mingw64/include
)

if(ZIG_PREFER_CLANG_CPP_DYLIB)
find_library(CLANG_LIBRARIES
NAMES
clang-cpp-13.0
clang-cpp130
clang-cpp-14.0
clang-cpp140
clang-cpp
PATHS
${CLANG_LIBDIRS}
/usr/lib/llvm/13/lib
/usr/lib/llvm/13/lib64
/usr/lib/llvm-13/lib
/usr/local/llvm130/lib
/usr/local/llvm13/lib
/usr/local/opt/llvm@13/lib
/opt/homebrew/opt/llvm@13/lib
/usr/lib/llvm/14/lib
/usr/lib/llvm/14/lib64
/usr/lib/llvm-14/lib
/usr/local/llvm140/lib
/usr/local/llvm14/lib
/usr/local/opt/llvm@14/lib
/opt/homebrew/opt/llvm@14/lib
)
endif()

Expand All @@ -43,13 +43,13 @@ if(NOT CLANG_LIBRARIES)
find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
PATHS
${CLANG_LIBDIRS}
/usr/lib/llvm/13/lib
/usr/lib/llvm-13/lib
/usr/lib/llvm-13.0/lib
/usr/local/llvm130/lib
/usr/local/llvm13/lib
/usr/local/opt/llvm@13/lib
/opt/homebrew/opt/llvm@13/lib
/usr/lib/llvm/14/lib
/usr/lib/llvm-14/lib
/usr/lib/llvm-14.0/lib
/usr/local/llvm140/lib
/usr/local/llvm14/lib
/usr/local/opt/llvm@14/lib
/opt/homebrew/opt/llvm@14/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:\\msys64\\mingw64\\lib
Expand Down
Loading