Update Cranelift

This commit is contained in:
bjorn3 2021-10-12 14:47:57 +02:00
parent d195107514
commit b2fed29e1a
6 changed files with 14 additions and 24 deletions

20
Cargo.lock generated
View File

@ -34,7 +34,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cranelift-bforest"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"cranelift-entity",
]
@ -42,7 +42,7 @@ dependencies = [
[[package]]
name = "cranelift-codegen"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"cranelift-bforest",
"cranelift-codegen-meta",
@ -58,7 +58,7 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"cranelift-codegen-shared",
"cranelift-entity",
@ -67,17 +67,17 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
[[package]]
name = "cranelift-entity"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
[[package]]
name = "cranelift-frontend"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"cranelift-codegen",
"log",
@ -88,7 +88,7 @@ dependencies = [
[[package]]
name = "cranelift-jit"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"anyhow",
"cranelift-codegen",
@ -105,7 +105,7 @@ dependencies = [
[[package]]
name = "cranelift-module"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"anyhow",
"cranelift-codegen",
@ -116,7 +116,7 @@ dependencies = [
[[package]]
name = "cranelift-native"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"cranelift-codegen",
"libc",
@ -126,7 +126,7 @@ dependencies = [
[[package]]
name = "cranelift-object"
version = "0.77.0"
source = "git+https://github.com/bytecodealliance/wasmtime.git#bae4ec642798ff448ca88eab771b6fcea71e7884"
source = "git+https://github.com/bytecodealliance/wasmtime.git#783bb1f759705cc1d5116340431015cee6728760"
dependencies = [
"anyhow",
"cranelift-codegen",

View File

@ -204,7 +204,6 @@ pub(super) fn from_casted_value<'tcx>(
// It may also be smaller for example when the type is a wrapper around an integer with a
// larger alignment than the integer.
size: (std::cmp::max(abi_param_size, layout_size) + 15) / 16 * 16,
offset: None,
});
let ptr = Pointer::new(fx.bcx.ins().stack_addr(pointer_ty(fx.tcx), stack_slot, 0));
let mut offset = 0;

View File

@ -203,7 +203,6 @@ pub(crate) fn verify_func(
tcx.sess.err(&format!("{:?}", err));
let pretty_error = cranelift_codegen::print_errors::pretty_verifier_error(
&func,
None,
Some(Box::new(writer)),
err,
);

View File

@ -263,7 +263,6 @@ fn call_inline_asm<'tcx>(
) {
let stack_slot = fx.bcx.func.create_stack_slot(StackSlotData {
kind: StackSlotKind::ExplicitSlot,
offset: None,
size: u32::try_from(slot_size.bytes()).unwrap(),
});
if fx.clif_comments.enabled() {

View File

@ -57,7 +57,7 @@ use std::io::Write;
use cranelift_codegen::{
entity::SecondaryMap,
ir::{entities::AnyEntity, function::DisplayFunctionAnnotations},
ir::entities::AnyEntity,
write::{FuncWriter, PlainWriter},
};
@ -129,7 +129,6 @@ impl FuncWriter for &'_ CommentWriter {
&mut self,
w: &mut dyn fmt::Write,
func: &Function,
reg_info: Option<&isa::RegInfo>,
) -> Result<bool, fmt::Error> {
for comment in &self.global_comments {
if !comment.is_empty() {
@ -142,7 +141,7 @@ impl FuncWriter for &'_ CommentWriter {
writeln!(w)?;
}
self.super_preamble(w, func, reg_info)
self.super_preamble(w, func)
}
fn write_entity_definition(
@ -165,11 +164,10 @@ impl FuncWriter for &'_ CommentWriter {
&mut self,
w: &mut dyn fmt::Write,
func: &Function,
isa: Option<&dyn isa::TargetIsa>,
block: Block,
indent: usize,
) -> fmt::Result {
PlainWriter.write_block_header(w, func, isa, block, indent)
PlainWriter.write_block_header(w, func, block, indent)
}
fn write_instruction(
@ -177,11 +175,10 @@ impl FuncWriter for &'_ CommentWriter {
w: &mut dyn fmt::Write,
func: &Function,
aliases: &SecondaryMap<Value, Vec<Value>>,
isa: Option<&dyn isa::TargetIsa>,
inst: Inst,
indent: usize,
) -> fmt::Result {
PlainWriter.write_instruction(w, func, aliases, isa, inst, indent)?;
PlainWriter.write_instruction(w, func, aliases, inst, indent)?;
if let Some(comment) = self.entity_comments.get(&inst.into()) {
writeln!(w, "; {}", comment.replace('\n', "\n; "))?;
}
@ -249,7 +246,6 @@ pub(crate) fn write_clif_file<'tcx>(
&mut clif_comments,
&mut clif,
&context.func,
&DisplayFunctionAnnotations { isa: Some(isa), value_ranges: None },
)
.unwrap();
@ -278,7 +274,6 @@ impl fmt::Debug for FunctionCx<'_, '_, '_> {
&mut &self.clif_comments,
&mut clif,
&self.bcx.func,
&DisplayFunctionAnnotations::default(),
)
.unwrap();
writeln!(f, "\n{}", clif)

View File

@ -329,7 +329,6 @@ impl<'tcx> CPlace<'tcx> {
// FIXME Don't force the size to a multiple of 16 bytes once Cranelift gets a way to
// specify stack slot alignment.
size: (u32::try_from(layout.size.bytes()).unwrap() + 15) / 16 * 16,
offset: None,
});
CPlace { inner: CPlaceInner::Addr(Pointer::stack_slot(stack_slot), None), layout }
}
@ -472,7 +471,6 @@ impl<'tcx> CPlace<'tcx> {
// FIXME Don't force the size to a multiple of 16 bytes once Cranelift gets a way to
// specify stack slot alignment.
size: (src_ty.bytes() + 15) / 16 * 16,
offset: None,
});
let ptr = Pointer::stack_slot(stack_slot);
ptr.store(fx, data, MemFlags::trusted());