mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-25 00:04:11 +00:00
Update to nightly-2022-10-15
This commit is contained in:
parent
dfd285e735
commit
fc19ab58fb
@ -10,9 +10,9 @@ use std::process::{Command, ExitCode};
|
||||
/// `cargo publish`. We need to figure out a way to do this properly, but let's hardcode it for now :/
|
||||
//const REQUIRED_RUST_TOOLCHAIN: &str = include_str!("../../rust-toolchain");
|
||||
const REQUIRED_RUST_TOOLCHAIN: &str = r#"[toolchain]
|
||||
channel = "nightly-2022-10-01"
|
||||
channel = "nightly-2022-10-15"
|
||||
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
|
||||
# commit_hash = 8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6"#;
|
||||
# commit_hash = bf15a9e5263fcea065a7ae9c179b2d24c2deb670"#;
|
||||
|
||||
fn get_rustc_commit_hash() -> Result<String, Box<dyn Error>> {
|
||||
let rustc = std::env::var("RUSTC").unwrap_or_else(|_| String::from("rustc"));
|
||||
|
@ -244,7 +244,7 @@ fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>)
|
||||
Target::Method(MethodKind::Inherent)
|
||||
}
|
||||
}
|
||||
hir::ImplItemKind::TyAlias(..) => Target::AssocTy,
|
||||
hir::ImplItemKind::Type(..) => Target::AssocTy,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ use rustc_codegen_ssa::MemFlags;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::Ty;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::abi::{Abi, Align, Scalar, Size, WrappingRange};
|
||||
use std::convert::TryInto;
|
||||
use std::iter::{self, empty};
|
||||
@ -795,6 +796,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
||||
fn invoke(
|
||||
&mut self,
|
||||
llty: Self::Type,
|
||||
fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
|
||||
llfn: Self::Value,
|
||||
args: &[Self::Value],
|
||||
then: Self::BasicBlock,
|
||||
@ -802,7 +804,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
||||
funclet: Option<&Self::Funclet>,
|
||||
) -> Self::Value {
|
||||
// Exceptions don't exist, jump directly to then block
|
||||
let result = self.call(llty, llfn, args, funclet);
|
||||
let result = self.call(llty, fn_abi, llfn, args, funclet);
|
||||
self.emit().branch(then).unwrap();
|
||||
result
|
||||
}
|
||||
@ -1009,13 +1011,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
||||
result_id.with_type(ptr_ty)
|
||||
}
|
||||
|
||||
fn dynamic_alloca(&mut self, ty: Self::Type, align: Align) -> Self::Value {
|
||||
let result = self.alloca(ty, align);
|
||||
self.err("dynamic alloca is not supported yet");
|
||||
result
|
||||
}
|
||||
|
||||
fn array_alloca(&mut self, _ty: Self::Type, _len: Self::Value, _align: Align) -> Self::Value {
|
||||
fn byte_array_alloca(&mut self, _len: Self::Value, _align: Align) -> Self::Value {
|
||||
self.fatal("array alloca not supported yet")
|
||||
}
|
||||
|
||||
@ -2291,6 +2287,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
||||
fn call(
|
||||
&mut self,
|
||||
callee_ty: Self::Type,
|
||||
_fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
|
||||
callee: Self::Value,
|
||||
args: &[Self::Value],
|
||||
funclet: Option<&Self::Funclet>,
|
||||
|
@ -364,8 +364,6 @@ impl<'a, 'tcx> ArgAbiMethods<'tcx> for Builder<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> AbiBuilderMethods<'tcx> for Builder<'a, 'tcx> {
|
||||
fn apply_attrs_callsite(&mut self, _fn_abi: &FnAbi<'tcx, Ty<'tcx>>, _callsite: Self::Value) {}
|
||||
|
||||
fn get_param(&mut self, index: usize) -> Self::Value {
|
||||
self.function_parameter_values.borrow()[&self.current_fn.def(self)][index]
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ impl<'tcx> CodegenCx<'tcx> {
|
||||
);
|
||||
}
|
||||
bx.set_span(span);
|
||||
bx.call(entry_func.ty, entry_func, &call_args, None);
|
||||
bx.call(entry_func.ty, None, entry_func, &call_args, None);
|
||||
bx.ret_void();
|
||||
|
||||
let stub_fn_id = stub_fn.def_cx(self);
|
||||
|
@ -558,14 +558,6 @@ impl<'tcx> MiscMethods<'tcx> for CodegenCx<'tcx> {
|
||||
self.codegen_unit
|
||||
}
|
||||
|
||||
fn used_statics(&self) -> &RefCell<Vec<Self::Value>> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn compiler_used_statics(&self) -> &RefCell<Vec<Self::Value>> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn set_frame_pointer_type(&self, _llfn: Self::Function) {
|
||||
todo!()
|
||||
}
|
||||
@ -574,14 +566,6 @@ impl<'tcx> MiscMethods<'tcx> for CodegenCx<'tcx> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn create_used_variable(&self) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn create_compiler_used_variable(&self) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn declare_c_main(&self, _fn_type: Self::Type) -> Option<Self::Function> {
|
||||
todo!()
|
||||
}
|
||||
|
@ -288,7 +288,6 @@ impl WriteBackendMethods for SpirvCodegenBackend {
|
||||
type Module = Vec<u32>;
|
||||
type TargetMachine = ();
|
||||
type ModuleBuffer = SpirvModuleBuffer;
|
||||
type Context = ();
|
||||
type ThinData = ();
|
||||
type ThinBuffer = SpirvThinBuffer;
|
||||
|
||||
@ -402,7 +401,7 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
|
||||
) -> (ModuleCodegen<Self::Module>, u64) {
|
||||
let _timer = tcx
|
||||
.prof
|
||||
.extra_verbose_generic_activity("codegen_module", cgu_name.to_string());
|
||||
.verbose_generic_activity_with_arg("codegen_module", cgu_name.to_string());
|
||||
|
||||
// TODO: Do dep_graph stuff
|
||||
let cgu = tcx.codegen_unit(cgu_name);
|
||||
@ -467,14 +466,6 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
|
||||
{
|
||||
Arc::new(|_| Ok(()))
|
||||
}
|
||||
|
||||
fn target_cpu<'b>(&self, _: &'b Session) -> &'b str {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn tune_cpu<'b>(&self, _: &'b Session) -> Option<&'b str> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
struct DumpModuleOnPanic<'a, 'cx, 'tcx> {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use rspirv::spirv::MemoryModel;
|
||||
use rustc_target::spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions};
|
||||
use rustc_target::spec::{Cc, LinkerFlavor, PanicStrategy, Target, TargetOptions};
|
||||
use spirv_tools::TargetEnv;
|
||||
|
||||
const ARCH: &str = "spirv";
|
||||
@ -84,7 +84,7 @@ impl SpirvTarget {
|
||||
o.dll_suffix = ".spv".into();
|
||||
o.dynamic_linking = true;
|
||||
o.emit_debug_gdb_scripts = false;
|
||||
o.linker_flavor = LinkerFlavor::Ld;
|
||||
o.linker_flavor = LinkerFlavor::Unix(Cc::No);
|
||||
o.panic_strategy = PanicStrategy::Abort;
|
||||
o.os = "unknown".into();
|
||||
o.env = self.env.to_string().into();
|
||||
|
@ -5,9 +5,9 @@
|
||||
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
|
||||
|
||||
[toolchain]
|
||||
channel = "nightly-2022-10-01"
|
||||
channel = "nightly-2022-10-15"
|
||||
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
|
||||
# commit_hash = 8ce3204af9463db3192ea1eb31c45c2f6d4b5ae6
|
||||
# commit_hash = bf15a9e5263fcea065a7ae9c179b2d24c2deb670
|
||||
|
||||
# Whenever changing the nightly channel, update the commit hash above, and make
|
||||
# sure to change REQUIRED_TOOLCHAIN in crates/rustc_codegen_spirv/src/build.rs also.
|
||||
|
@ -2,7 +2,7 @@
|
||||
%4 = OpFunctionParameter %5
|
||||
%6 = OpFunctionParameter %5
|
||||
%7 = OpLabel
|
||||
OpLine %8 1117 8
|
||||
OpLine %8 1122 8
|
||||
%9 = OpLoad %10 %4
|
||||
OpLine %11 7 13
|
||||
OpStore %6 %9
|
||||
|
@ -2,7 +2,7 @@
|
||||
%4 = OpFunctionParameter %5
|
||||
%6 = OpFunctionParameter %5
|
||||
%7 = OpLabel
|
||||
OpLine %8 1117 8
|
||||
OpLine %8 1122 8
|
||||
%9 = OpLoad %10 %4
|
||||
OpLine %11 7 13
|
||||
OpStore %6 %9
|
||||
|
@ -4,7 +4,7 @@
|
||||
%7 = OpLabel
|
||||
OpLine %8 7 35
|
||||
%9 = OpLoad %10 %4
|
||||
OpLine %11 1310 8
|
||||
OpLine %11 1316 8
|
||||
OpStore %6 %9
|
||||
OpLine %8 8 1
|
||||
OpReturn
|
||||
|
@ -4,7 +4,7 @@
|
||||
%7 = OpLabel
|
||||
OpLine %8 7 37
|
||||
%9 = OpLoad %10 %4
|
||||
OpLine %11 1310 8
|
||||
OpLine %11 1316 8
|
||||
OpStore %6 %9
|
||||
OpLine %8 8 1
|
||||
OpReturn
|
||||
|
@ -4,30 +4,30 @@ OpLine %5 11 11
|
||||
%6 = OpCompositeInsert %7 %8 %9 0
|
||||
OpLine %5 11 11
|
||||
%10 = OpCompositeExtract %11 %6 1
|
||||
OpLine %12 800 14
|
||||
OpLine %12 803 14
|
||||
%13 = OpBitcast %14 %8
|
||||
OpLine %12 800 8
|
||||
OpLine %12 803 8
|
||||
OpSelectionMerge %15 None
|
||||
OpSwitch %13 %16 0 %17 1 %18
|
||||
%16 = OpLabel
|
||||
OpLine %12 800 14
|
||||
OpLine %12 803 14
|
||||
OpUnreachable
|
||||
%17 = OpLabel
|
||||
OpLine %12 802 20
|
||||
OpLine %12 805 20
|
||||
OpBranch %15
|
||||
%18 = OpLabel
|
||||
OpLine %12 801 23
|
||||
OpLine %12 804 23
|
||||
OpBranch %15
|
||||
%15 = OpLabel
|
||||
%19 = OpPhi %20 %21 %17 %22 %18
|
||||
%23 = OpPhi %11 %24 %17 %10 %18
|
||||
OpBranch %25
|
||||
%25 = OpLabel
|
||||
OpLine %12 804 4
|
||||
OpLine %12 807 4
|
||||
OpSelectionMerge %26 None
|
||||
OpBranchConditional %19 %27 %28
|
||||
%27 = OpLabel
|
||||
OpLine %12 804 4
|
||||
OpLine %12 807 4
|
||||
OpBranch %26
|
||||
%28 = OpLabel
|
||||
OpBranch %26
|
||||
|
Loading…
Reference in New Issue
Block a user