Bump minimum required LLVM version to 6.0
This commit is contained in:
parent
b7da2c6e12
commit
706e67b0a0
19 changed files with 14 additions and 65 deletions
|
@ -16,7 +16,7 @@ matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
# Images used in testing PR and try-build should be run first.
|
# Images used in testing PR and try-build should be run first.
|
||||||
- env: IMAGE=x86_64-gnu-llvm-5.0 RUST_BACKTRACE=1
|
- env: IMAGE=x86_64-gnu-llvm-6.0 RUST_BACKTRACE=1
|
||||||
if: type = pull_request OR branch = auto
|
if: type = pull_request OR branch = auto
|
||||||
|
|
||||||
- env: IMAGE=dist-x86_64-linux DEPLOY=1
|
- env: IMAGE=dist-x86_64-linux DEPLOY=1
|
||||||
|
|
|
@ -278,11 +278,11 @@ fn check_llvm_version(builder: &Builder, llvm_config: &Path) {
|
||||||
let mut parts = version.split('.').take(2)
|
let mut parts = version.split('.').take(2)
|
||||||
.filter_map(|s| s.parse::<u32>().ok());
|
.filter_map(|s| s.parse::<u32>().ok());
|
||||||
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
|
||||||
if major >= 5 {
|
if major >= 6 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic!("\n\nbad LLVM version: {}, need >=5.0\n\n", version)
|
panic!("\n\nbad LLVM version: {}, need >=6.0\n\n", version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn configure_cmake(builder: &Builder,
|
fn configure_cmake(builder: &Builder,
|
||||||
|
|
|
@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
cmake \
|
cmake \
|
||||||
sudo \
|
sudo \
|
||||||
gdb \
|
gdb \
|
||||||
llvm-5.0-tools \
|
llvm-6.0-tools \
|
||||||
libedit-dev \
|
libedit-dev \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
xz-utils
|
xz-utils
|
||||||
|
@ -22,6 +22,6 @@ RUN sh /scripts/sccache.sh
|
||||||
# using llvm-link-shared due to libffi issues -- see #34486
|
# using llvm-link-shared due to libffi issues -- see #34486
|
||||||
ENV RUST_CONFIGURE_ARGS \
|
ENV RUST_CONFIGURE_ARGS \
|
||||||
--build=x86_64-unknown-linux-gnu \
|
--build=x86_64-unknown-linux-gnu \
|
||||||
--llvm-root=/usr/lib/llvm-5.0 \
|
--llvm-root=/usr/lib/llvm-6.0 \
|
||||||
--enable-llvm-link-shared
|
--enable-llvm-link-shared
|
||||||
ENV RUST_CHECK_TARGET check
|
ENV RUST_CHECK_TARGET check
|
|
@ -1024,17 +1024,11 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
|
||||||
|
|
||||||
fn minnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
fn minnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("minnum");
|
self.count_insn("minnum");
|
||||||
unsafe {
|
unsafe { llvm::LLVMRustBuildMinNum(self.llbuilder, lhs, rhs) }
|
||||||
let instr = llvm::LLVMRustBuildMinNum(self.llbuilder, lhs, rhs);
|
|
||||||
instr.expect("LLVMRustBuildMinNum is not available in LLVM version < 6.0")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fn maxnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
fn maxnum(&mut self, lhs: &'ll Value, rhs: &'ll Value) -> &'ll Value {
|
||||||
self.count_insn("maxnum");
|
self.count_insn("maxnum");
|
||||||
unsafe {
|
unsafe { llvm::LLVMRustBuildMaxNum(self.llbuilder, lhs, rhs) }
|
||||||
let instr = llvm::LLVMRustBuildMaxNum(self.llbuilder, lhs, rhs);
|
|
||||||
instr.expect("LLVMRustBuildMaxNum is not available in LLVM version < 6.0")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn select(
|
fn select(
|
||||||
|
|
|
@ -1222,12 +1222,12 @@ extern "C" {
|
||||||
B: &Builder<'a>,
|
B: &Builder<'a>,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
) -> Option<&'a Value>;
|
) -> &'a Value;
|
||||||
pub fn LLVMRustBuildMaxNum(
|
pub fn LLVMRustBuildMaxNum(
|
||||||
B: &Builder<'a>,
|
B: &Builder<'a>,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
LHS: &'a Value,
|
LHS: &'a Value,
|
||||||
) -> Option<&'a Value>;
|
) -> &'a Value;
|
||||||
|
|
||||||
// Atomic Operations
|
// Atomic Operations
|
||||||
pub fn LLVMRustBuildAtomicLoad(B: &Builder<'a>,
|
pub fn LLVMRustBuildAtomicLoad(B: &Builder<'a>,
|
||||||
|
|
|
@ -216,16 +216,11 @@ LLVMRustWriteArchive(char *Dst, size_t NumMembers,
|
||||||
Members.push_back(std::move(*MOrErr));
|
Members.push_back(std::move(*MOrErr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Result = writeArchive(Dst, Members, WriteSymbtab, Kind, true, false);
|
auto Result = writeArchive(Dst, Members, WriteSymbtab, Kind, true, false);
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
|
||||||
if (!Result)
|
if (!Result)
|
||||||
return LLVMRustResult::Success;
|
return LLVMRustResult::Success;
|
||||||
LLVMRustSetLastError(toString(std::move(Result)).c_str());
|
LLVMRustSetLastError(toString(std::move(Result)).c_str());
|
||||||
#else
|
|
||||||
if (!Result.second)
|
|
||||||
return LLVMRustResult::Success;
|
|
||||||
LLVMRustSetLastError(Result.second.message().c_str());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return LLVMRustResult::Failure;
|
return LLVMRustResult::Failure;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,21 +17,15 @@
|
||||||
|
|
||||||
#include "llvm/Analysis/TargetLibraryInfo.h"
|
#include "llvm/Analysis/TargetLibraryInfo.h"
|
||||||
#include "llvm/Analysis/TargetTransformInfo.h"
|
#include "llvm/Analysis/TargetTransformInfo.h"
|
||||||
|
#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
||||||
#include "llvm/IR/AutoUpgrade.h"
|
#include "llvm/IR/AutoUpgrade.h"
|
||||||
#include "llvm/IR/AssemblyAnnotationWriter.h"
|
#include "llvm/IR/AssemblyAnnotationWriter.h"
|
||||||
|
#include "llvm/IR/IntrinsicInst.h"
|
||||||
#include "llvm/Support/CBindingWrapping.h"
|
#include "llvm/Support/CBindingWrapping.h"
|
||||||
#include "llvm/Support/FileSystem.h"
|
#include "llvm/Support/FileSystem.h"
|
||||||
#include "llvm/Support/Host.h"
|
#include "llvm/Support/Host.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
|
||||||
#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
|
||||||
#include "llvm/IR/IntrinsicInst.h"
|
|
||||||
#else
|
|
||||||
#include "llvm/Target/TargetSubtargetInfo.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "llvm/Transforms/IPO/AlwaysInliner.h"
|
#include "llvm/Transforms/IPO/AlwaysInliner.h"
|
||||||
#include "llvm/Transforms/IPO/FunctionImport.h"
|
#include "llvm/Transforms/IPO/FunctionImport.h"
|
||||||
#include "llvm/Transforms/Utils/FunctionImportUtils.h"
|
#include "llvm/Transforms/Utils/FunctionImportUtils.h"
|
||||||
|
@ -198,13 +192,9 @@ GEN_SUBTARGETS
|
||||||
|
|
||||||
extern "C" bool LLVMRustHasFeature(LLVMTargetMachineRef TM,
|
extern "C" bool LLVMRustHasFeature(LLVMTargetMachineRef TM,
|
||||||
const char *Feature) {
|
const char *Feature) {
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
|
||||||
TargetMachine *Target = unwrap(TM);
|
TargetMachine *Target = unwrap(TM);
|
||||||
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
|
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
|
||||||
return MCInfo->checkFeatures(std::string("+") + Feature);
|
return MCInfo->checkFeatures(std::string("+") + Feature);
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class LLVMRustCodeModel {
|
enum class LLVMRustCodeModel {
|
||||||
|
@ -392,13 +382,9 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||||
Options.ThreadModel = ThreadModel::Single;
|
Options.ThreadModel = ThreadModel::Single;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
|
||||||
Options.EmitStackSizeSection = EmitStackSizeSection;
|
Options.EmitStackSizeSection = EmitStackSizeSection;
|
||||||
|
|
||||||
Optional<CodeModel::Model> CM;
|
Optional<CodeModel::Model> CM;
|
||||||
#else
|
|
||||||
CodeModel::Model CM = CodeModel::Model::Default;
|
|
||||||
#endif
|
|
||||||
if (RustCM != LLVMRustCodeModel::None)
|
if (RustCM != LLVMRustCodeModel::None)
|
||||||
CM = fromRust(RustCM);
|
CM = fromRust(RustCM);
|
||||||
TargetMachine *TM = TheTarget->createTargetMachine(
|
TargetMachine *TM = TheTarget->createTargetMachine(
|
||||||
|
|
|
@ -297,11 +297,7 @@ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
|
||||||
// enable fpmath flag UnsafeAlgebra
|
// enable fpmath flag UnsafeAlgebra
|
||||||
extern "C" void LLVMRustSetHasUnsafeAlgebra(LLVMValueRef V) {
|
extern "C" void LLVMRustSetHasUnsafeAlgebra(LLVMValueRef V) {
|
||||||
if (auto I = dyn_cast<Instruction>(unwrap<Value>(V))) {
|
if (auto I = dyn_cast<Instruction>(unwrap<Value>(V))) {
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
|
||||||
I->setFast(true);
|
I->setFast(true);
|
||||||
#else
|
|
||||||
I->setHasUnsafeAlgebra(true);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1437,7 +1433,6 @@ LLVMRustBuildVectorReduceFMax(LLVMBuilderRef B, LLVMValueRef Src, bool NoNaN) {
|
||||||
return wrap(unwrap(B)->CreateFPMaxReduce(unwrap(Src), NoNaN));
|
return wrap(unwrap(B)->CreateFPMaxReduce(unwrap(Src), NoNaN));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
|
||||||
extern "C" LLVMValueRef
|
extern "C" LLVMValueRef
|
||||||
LLVMRustBuildMinNum(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS) {
|
LLVMRustBuildMinNum(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS) {
|
||||||
return wrap(unwrap(B)->CreateMinNum(unwrap(LHS),unwrap(RHS)));
|
return wrap(unwrap(B)->CreateMinNum(unwrap(LHS),unwrap(RHS)));
|
||||||
|
@ -1446,13 +1441,3 @@ extern "C" LLVMValueRef
|
||||||
LLVMRustBuildMaxNum(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS) {
|
LLVMRustBuildMaxNum(LLVMBuilderRef B, LLVMValueRef LHS, LLVMValueRef RHS) {
|
||||||
return wrap(unwrap(B)->CreateMaxNum(unwrap(LHS),unwrap(RHS)));
|
return wrap(unwrap(B)->CreateMaxNum(unwrap(LHS),unwrap(RHS)));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
extern "C" LLVMValueRef
|
|
||||||
LLVMRustBuildMinNum(LLVMBuilderRef, LLVMValueRef, LLVMValueRef) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
extern "C" LLVMValueRef
|
|
||||||
LLVMRustBuildMaxNum(LLVMBuilderRef, LLVMValueRef, LLVMValueRef) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// compile-flags: -C no-prepopulate-passes
|
// compile-flags: -C no-prepopulate-passes
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
#![feature(custom_attribute)]
|
#![feature(custom_attribute)]
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// only-macos
|
// only-macos
|
||||||
// no-system-llvm
|
// no-system-llvm
|
||||||
// min-llvm-version 6.0
|
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
|
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
#![crate_type = "lib"]
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// compile-flags: -O
|
// compile-flags: -O
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
#![crate_type="rlib"]
|
#![crate_type="rlib"]
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// ignore-emscripten
|
// ignore-emscripten
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
// compile-flags: -C no-prepopulate-passes
|
// compile-flags: -C no-prepopulate-passes
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// ignore-emscripten
|
// ignore-emscripten
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
// compile-flags: -C no-prepopulate-passes
|
// compile-flags: -C no-prepopulate-passes
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
// ignore-tidy-linelength
|
// ignore-tidy-linelength
|
||||||
// ignore-windows
|
// ignore-windows
|
||||||
// ignore-macos
|
// ignore-macos
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
// compile-flags: -g -C no-prepopulate-passes
|
// compile-flags: -g -C no-prepopulate-passes
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
// run-pass
|
// run-pass
|
||||||
// ignore-emscripten
|
// ignore-emscripten
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
// Test that the simd_{gather,scatter} intrinsics produce the correct results.
|
// Test that the simd_{gather,scatter} intrinsics produce the correct results.
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,9 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![allow(stable_features)]
|
|
||||||
// min-llvm-version 6.0
|
|
||||||
// ^ needs MCSubtargetInfo::checkFeatures()
|
|
||||||
// ignore-cloudabi no std::env
|
// ignore-cloudabi no std::env
|
||||||
|
|
||||||
|
#![allow(stable_features)]
|
||||||
#![feature(cfg_target_feature)]
|
#![feature(cfg_target_feature)]
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
// gate-test-mips_target_feature
|
// gate-test-mips_target_feature
|
||||||
// gate-test-mmx_target_feature
|
// gate-test-mmx_target_feature
|
||||||
// gate-test-wasm_target_feature
|
// gate-test-wasm_target_feature
|
||||||
// min-llvm-version 6.0
|
|
||||||
|
|
||||||
#[target_feature(enable = "avx512bw")]
|
#[target_feature(enable = "avx512bw")]
|
||||||
//~^ ERROR: currently unstable
|
//~^ ERROR: currently unstable
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
|
error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
|
||||||
--> $DIR/target-feature-gate.rs:29:18
|
--> $DIR/target-feature-gate.rs:28:18
|
||||||
|
|
|
|
||||||
LL | #[target_feature(enable = "avx512bw")]
|
LL | #[target_feature(enable = "avx512bw")]
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue