This commit is contained in:
bjorn3
2019-09-28 16:43:00 +02:00
committed by Dan Gohman
parent c274d81b5b
commit bb8fa40ef0
49 changed files with 62 additions and 62 deletions

View File

@@ -429,8 +429,8 @@ where
mod tests { mod tests {
use super::super::NodeData; use super::super::NodeData;
use super::*; use super::*;
use core::mem;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::mem;
#[test] #[test]
fn node_size() { fn node_size() {

View File

@@ -584,8 +584,8 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use core::mem;
use alloc::string::ToString; use alloc::string::ToString;
use core::mem;
// Forest impl for a set implementation. // Forest impl for a set implementation.
struct TF(); struct TF();

View File

@@ -84,9 +84,9 @@ impl<F: Forest> NodePool<F> {
F::Key: fmt::Display, F::Key: fmt::Display,
{ {
use crate::entity::EntitySet; use crate::entity::EntitySet;
use alloc::vec::Vec;
use core::borrow::Borrow; use core::borrow::Borrow;
use core::cmp::Ordering; use core::cmp::Ordering;
use alloc::vec::Vec;
// The root node can't be an inner node with just a single sub-tree. It should have been // The root node can't be an inner node with just a single sub-tree. It should have been
// pruned. // pruned.

View File

@@ -3,10 +3,10 @@
use super::{Comparator, Forest, Node, NodeData, NodePool, Path, SetValue, INNER_SIZE}; use super::{Comparator, Forest, Node, NodeData, NodePool, Path, SetValue, INNER_SIZE};
use crate::packed_option::PackedOption; use crate::packed_option::PackedOption;
#[cfg(test)] #[cfg(test)]
use alloc::string::String;
#[cfg(test)]
use core::fmt; use core::fmt;
use core::marker::PhantomData; use core::marker::PhantomData;
#[cfg(test)]
use alloc::string::String;
/// Tag type defining forest types for a set. /// Tag type defining forest types for a set.
struct SetTypes<K>(PhantomData<K>); struct SetTypes<K>(PhantomData<K>);
@@ -357,8 +357,8 @@ where
mod tests { mod tests {
use super::super::NodeData; use super::super::NodeData;
use super::*; use super::*;
use core::mem;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::mem;
#[test] #[test]
fn node_size() { fn node_size() {

View File

@@ -4,8 +4,8 @@
//! `TargetIsa::legalize_signature()` method. //! `TargetIsa::legalize_signature()` method.
use crate::ir::{AbiParam, ArgumentExtension, ArgumentLoc, Type}; use crate::ir::{AbiParam, ArgumentExtension, ArgumentLoc, Type};
use core::cmp::Ordering;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::cmp::Ordering;
/// Legalization action to perform on a single argument or return value when converting a /// Legalization action to perform on a single argument or return value when converting a
/// signature. /// signature.

View File

@@ -1,7 +1,7 @@
//! The `CFGPrinter` utility. //! The `CFGPrinter` utility.
use core::fmt::{Display, Formatter, Result, Write};
use alloc::vec::Vec; use alloc::vec::Vec;
use core::fmt::{Display, Formatter, Result, Write};
use crate::entity::SecondaryMap; use crate::entity::SecondaryMap;
use crate::flowgraph::{BasicBlock, ControlFlowGraph}; use crate::flowgraph::{BasicBlock, ControlFlowGraph};

View File

@@ -33,8 +33,8 @@ use crate::timing;
use crate::unreachable_code::eliminate_unreachable_code; use crate::unreachable_code::eliminate_unreachable_code;
use crate::value_label::{build_value_labels_ranges, ComparableSourceLoc, ValueLabelsRanges}; use crate::value_label::{build_value_labels_ranges, ComparableSourceLoc, ValueLabelsRanges};
use crate::verifier::{verify_context, verify_locations, VerifierErrors, VerifierResult}; use crate::verifier::{verify_context, verify_locations, VerifierErrors, VerifierResult};
use log::debug;
use alloc::vec::Vec; use alloc::vec::Vec;
use log::debug;
/// Persistent data structures and compilation pipeline. /// Persistent data structures and compilation pipeline.
pub struct Context { pub struct Context {

View File

@@ -6,10 +6,10 @@ use crate::ir::instructions::BranchInfo;
use crate::ir::{Ebb, ExpandedProgramPoint, Function, Inst, Layout, ProgramOrder, Value}; use crate::ir::{Ebb, ExpandedProgramPoint, Function, Inst, Layout, ProgramOrder, Value};
use crate::packed_option::PackedOption; use crate::packed_option::PackedOption;
use crate::timing; use crate::timing;
use alloc::vec::Vec;
use core::cmp; use core::cmp;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::mem; use core::mem;
use alloc::vec::Vec;
/// RPO numbers are not first assigned in a contiguous way but as multiples of STRIDE, to leave /// RPO numbers are not first assigned in a contiguous way but as multiples of STRIDE, to leave
/// room for modifications of the dominator tree. /// room for modifications of the dominator tree.

View File

@@ -10,9 +10,9 @@
use crate::ir::Constant; use crate::ir::Constant;
use crate::HashMap; use crate::HashMap;
use cranelift_entity::EntityRef;
use alloc::collections::BTreeMap; use alloc::collections::BTreeMap;
use alloc::vec::Vec; use alloc::vec::Vec;
use cranelift_entity::EntityRef;
/// This type describes the actual constant data. /// This type describes the actual constant data.
pub type ConstantData = Vec<u8>; pub type ConstantData = Vec<u8>;

View File

@@ -14,12 +14,12 @@ use crate::isa::TargetIsa;
use crate::packed_option::ReservedValue; use crate::packed_option::ReservedValue;
use crate::write::write_operands; use crate::write::write_operands;
use crate::HashMap; use crate::HashMap;
use alloc::vec::Vec;
use core::fmt; use core::fmt;
use core::iter; use core::iter;
use core::mem; use core::mem;
use core::ops::{Index, IndexMut}; use core::ops::{Index, IndexMut};
use core::u16; use core::u16;
use alloc::vec::Vec;
/// A data flow graph defines all instructions and extended basic blocks in a function as well as /// A data flow graph defines all instructions and extended basic blocks in a function as well as
/// the data flow dependencies between them. The DFG also tracks values which can be either /// the data flow dependencies between them. The DFG also tracks values which can be either

View File

@@ -455,8 +455,8 @@ impl From<Table> for AnyEntity {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use core::u32;
use alloc::string::ToString; use alloc::string::ToString;
use core::u32;
#[test] #[test]
fn value_with_number() { fn value_with_number() {

View File

@@ -7,9 +7,9 @@
use crate::ir::{ArgumentLoc, ExternalName, SigRef, Type}; use crate::ir::{ArgumentLoc, ExternalName, SigRef, Type};
use crate::isa::{CallConv, RegInfo, RegUnit}; use crate::isa::{CallConv, RegInfo, RegUnit};
use alloc::vec::Vec;
use core::fmt; use core::fmt;
use core::str::FromStr; use core::str::FromStr;
use alloc::vec::Vec;
/// Function signature. /// Function signature.
/// ///

View File

@@ -120,8 +120,8 @@ impl FromStr for ExternalName {
mod tests { mod tests {
use super::ExternalName; use super::ExternalName;
use crate::ir::LibCall; use crate::ir::LibCall;
use core::u32;
use alloc::string::ToString; use alloc::string::ToString;
use core::u32;
#[test] #[test]
fn display_testcase() { fn display_testcase() {

View File

@@ -4,11 +4,11 @@
//! Each type here should have a corresponding definition in the //! Each type here should have a corresponding definition in the
//! `cranelift-codegen/meta/src/shared/immediates` crate in the meta language. //! `cranelift-codegen/meta/src/shared/immediates` crate in the meta language.
use alloc::vec::Vec;
use core::fmt::{self, Display, Formatter}; use core::fmt::{self, Display, Formatter};
use core::iter::FromIterator; use core::iter::FromIterator;
use core::str::{from_utf8, FromStr}; use core::str::{from_utf8, FromStr};
use core::{i32, u32}; use core::{i32, u32};
use alloc::vec::Vec;
/// Convert a type into a vector of bytes; all implementors in this file must use little-endian /// Convert a type into a vector of bytes; all implementors in this file must use little-endian
/// orderings of bytes to match WebAssembly's little-endianness. /// orderings of bytes to match WebAssembly's little-endianness.
@@ -936,11 +936,11 @@ impl IntoBytes for Ieee64 {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use alloc::string::ToString;
use core::fmt::Display; use core::fmt::Display;
use core::mem; use core::mem;
use core::str::FromStr; use core::str::FromStr;
use core::{f32, f64}; use core::{f32, f64};
use alloc::string::ToString;
#[test] #[test]
fn format_imm64() { fn format_imm64() {

View File

@@ -6,10 +6,10 @@
//! A large part of this module is auto-generated from the instruction descriptions in the meta //! A large part of this module is auto-generated from the instruction descriptions in the meta
//! directory. //! directory.
use alloc::vec::Vec;
use core::fmt::{self, Display, Formatter}; use core::fmt::{self, Display, Formatter};
use core::ops::{Deref, DerefMut}; use core::ops::{Deref, DerefMut};
use core::str::FromStr; use core::str::FromStr;
use alloc::vec::Vec;
use crate::ir; use crate::ir;
use crate::ir::types; use crate::ir::types;

View File

@@ -4,9 +4,9 @@
//! The actual table of destinations is stored in a `JumpTableData` struct defined in this module. //! The actual table of destinations is stored in a `JumpTableData` struct defined in this module.
use crate::ir::entities::Ebb; use crate::ir::entities::Ebb;
use alloc::vec::Vec;
use core::fmt::{self, Display, Formatter}; use core::fmt::{self, Display, Formatter};
use core::slice::{Iter, IterMut}; use core::slice::{Iter, IterMut};
use alloc::vec::Vec;
/// Contents of a jump table. /// Contents of a jump table.
/// ///

View File

@@ -750,8 +750,8 @@ mod tests {
use crate::cursor::{Cursor, CursorPosition}; use crate::cursor::{Cursor, CursorPosition};
use crate::entity::EntityRef; use crate::entity::EntityRef;
use crate::ir::{Ebb, Inst, ProgramOrder, SourceLoc}; use crate::ir::{Ebb, Inst, ProgramOrder, SourceLoc};
use core::cmp::Ordering;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::cmp::Ordering;
struct LayoutCursor<'f> { struct LayoutCursor<'f> {
/// Borrowed function layout. Public so it can be re-borrowed from this cursor. /// Borrowed function layout. Public so it can be re-borrowed from this cursor.

View File

@@ -6,12 +6,12 @@
use crate::entity::{Iter, IterMut, Keys, PrimaryMap}; use crate::entity::{Iter, IterMut, Keys, PrimaryMap};
use crate::ir::{StackSlot, Type}; use crate::ir::{StackSlot, Type};
use crate::packed_option::PackedOption; use crate::packed_option::PackedOption;
use alloc::vec::Vec;
use core::cmp; use core::cmp;
use core::fmt; use core::fmt;
use core::ops::{Index, IndexMut}; use core::ops::{Index, IndexMut};
use core::slice; use core::slice;
use core::str::FromStr; use core::str::FromStr;
use alloc::vec::Vec;
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@@ -15,8 +15,8 @@ use crate::isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encoding
use crate::isa::Builder as IsaBuilder; use crate::isa::Builder as IsaBuilder;
use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use crate::regalloc; use crate::regalloc;
use core::fmt;
use alloc::boxed::Box; use alloc::boxed::Box;
use core::fmt;
use target_lexicon::{Architecture, Triple}; use target_lexicon::{Architecture, Triple};
#[allow(dead_code)] #[allow(dead_code)]

View File

@@ -15,8 +15,8 @@ use crate::isa::enc_tables::{lookup_enclist, Encodings};
use crate::isa::Builder as IsaBuilder; use crate::isa::Builder as IsaBuilder;
use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use crate::regalloc; use crate::regalloc;
use core::fmt;
use alloc::boxed::Box; use alloc::boxed::Box;
use core::fmt;
use target_lexicon::Triple; use target_lexicon::Triple;
#[allow(dead_code)] #[allow(dead_code)]

View File

@@ -63,9 +63,9 @@ use crate::result::CodegenResult;
use crate::settings; use crate::settings;
use crate::settings::SetResult; use crate::settings::SetResult;
use crate::timing; use crate::timing;
use alloc::boxed::Box;
use core::fmt; use core::fmt;
use failure_derive::Fail; use failure_derive::Fail;
use alloc::boxed::Box;
use target_lexicon::{triple, Architecture, PointerWidth, Triple}; use target_lexicon::{triple, Architecture, PointerWidth, Triple};
#[cfg(feature = "riscv")] #[cfg(feature = "riscv")]

View File

@@ -15,8 +15,8 @@ use crate::isa::enc_tables::{self as shared_enc_tables, lookup_enclist, Encoding
use crate::isa::Builder as IsaBuilder; use crate::isa::Builder as IsaBuilder;
use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa}; use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use crate::regalloc; use crate::regalloc;
use core::fmt;
use alloc::boxed::Box; use alloc::boxed::Box;
use core::fmt;
use target_lexicon::{PointerWidth, Triple}; use target_lexicon::{PointerWidth, Triple};
#[allow(dead_code)] #[allow(dead_code)]
@@ -137,8 +137,8 @@ mod tests {
use crate::ir::{Function, InstructionData, Opcode}; use crate::ir::{Function, InstructionData, Opcode};
use crate::isa; use crate::isa;
use crate::settings::{self, Configurable}; use crate::settings::{self, Configurable};
use core::str::FromStr;
use alloc::string::{String, ToString}; use alloc::string::{String, ToString};
use core::str::FromStr;
use target_lexicon::triple; use target_lexicon::triple;
fn encstr(isa: &dyn isa::TargetIsa, enc: Result<isa::Encoding, isa::Legalize>) -> String { fn encstr(isa: &dyn isa::TargetIsa, enc: Result<isa::Encoding, isa::Legalize>) -> String {

View File

@@ -17,8 +17,8 @@ use crate::isa::{EncInfo, RegClass, RegInfo, TargetIsa};
use crate::regalloc; use crate::regalloc;
use crate::result::CodegenResult; use crate::result::CodegenResult;
use crate::timing; use crate::timing;
use core::fmt;
use alloc::boxed::Box; use alloc::boxed::Box;
use core::fmt;
use target_lexicon::{PointerWidth, Triple}; use target_lexicon::{PointerWidth, Triple};
#[allow(dead_code)] #[allow(dead_code)]

View File

@@ -27,8 +27,8 @@ use crate::ir::{
}; };
use crate::isa::TargetIsa; use crate::isa::TargetIsa;
use crate::legalizer::split::{isplit, vsplit}; use crate::legalizer::split::{isplit, vsplit};
use log::debug;
use alloc::vec::Vec; use alloc::vec::Vec;
use log::debug;
/// Legalize all the function signatures in `func`. /// Legalize all the function signatures in `func`.
/// ///

View File

@@ -67,9 +67,9 @@
use crate::cursor::{Cursor, CursorPosition, FuncCursor}; use crate::cursor::{Cursor, CursorPosition, FuncCursor};
use crate::flowgraph::{BasicBlock, ControlFlowGraph}; use crate::flowgraph::{BasicBlock, ControlFlowGraph};
use crate::ir::{self, Ebb, Inst, InstBuilder, InstructionData, Opcode, Type, Value, ValueDef}; use crate::ir::{self, Ebb, Inst, InstBuilder, InstructionData, Opcode, Type, Value, ValueDef};
use alloc::vec::Vec;
use core::iter; use core::iter;
use smallvec::SmallVec; use smallvec::SmallVec;
use alloc::vec::Vec;
/// Split `value` into two values using the `isplit` semantics. Do this by reusing existing values /// Split `value` into two values using the `isplit` semantics. Do this by reusing existing values
/// if possible. /// if possible.

View File

@@ -8,11 +8,11 @@ use crate::isa::TargetIsa;
use crate::result::CodegenError; use crate::result::CodegenError;
use crate::verifier::{VerifierError, VerifierErrors}; use crate::verifier::{VerifierError, VerifierErrors};
use crate::write::{decorate_function, FuncWriter, PlainWriter}; use crate::write::{decorate_function, FuncWriter, PlainWriter};
use core::fmt;
use core::fmt::Write;
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::string::{String, ToString}; use alloc::string::{String, ToString};
use alloc::vec::Vec; use alloc::vec::Vec;
use core::fmt;
use core::fmt::Write;
/// Pretty-print a verifier error. /// Pretty-print a verifier error.
pub fn pretty_verifier_error<'a>( pub fn pretty_verifier_error<'a>(

View File

@@ -12,9 +12,9 @@ use crate::ir::{
}; };
use crate::isa::{RegInfo, RegUnit, TargetIsa}; use crate::isa::{RegInfo, RegUnit, TargetIsa};
use crate::regalloc::RegDiversions; use crate::regalloc::RegDiversions;
use alloc::vec::Vec;
use core::convert::TryInto; use core::convert::TryInto;
use cranelift_entity::{PrimaryMap, SecondaryMap}; use cranelift_entity::{PrimaryMap, SecondaryMap};
use alloc::vec::Vec;
// ============================================================================================= // =============================================================================================
// A description of the redundant-fill-removal algorithm // A description of the redundant-fill-removal algorithm

View File

@@ -17,12 +17,12 @@ use crate::regalloc::affinity::Affinity;
use crate::regalloc::liveness::Liveness; use crate::regalloc::liveness::Liveness;
use crate::regalloc::virtregs::{VirtReg, VirtRegs}; use crate::regalloc::virtregs::{VirtReg, VirtRegs};
use crate::timing; use crate::timing;
use alloc::vec::Vec;
use core::cmp; use core::cmp;
use core::fmt; use core::fmt;
use core::iter; use core::iter;
use core::slice; use core::slice;
use log::debug; use log::debug;
use alloc::vec::Vec;
// # Implementation // # Implementation
// //

View File

@@ -183,9 +183,9 @@ use crate::isa::{EncInfo, OperandConstraint, TargetIsa};
use crate::regalloc::affinity::Affinity; use crate::regalloc::affinity::Affinity;
use crate::regalloc::liverange::LiveRange; use crate::regalloc::liverange::LiveRange;
use crate::timing; use crate::timing;
use alloc::vec::Vec;
use core::mem; use core::mem;
use core::ops::Index; use core::ops::Index;
use alloc::vec::Vec;
/// A set of live ranges, indexed by value number. /// A set of live ranges, indexed by value number.
type LiveRangeSet = SparseMap<Value, LiveRange>; type LiveRangeSet = SparseMap<Value, LiveRange>;

View File

@@ -476,8 +476,8 @@ mod tests {
use crate::entity::EntityRef; use crate::entity::EntityRef;
use crate::ir::{Ebb, Inst, Value}; use crate::ir::{Ebb, Inst, Value};
use crate::ir::{ExpandedProgramPoint, ProgramOrder}; use crate::ir::{ExpandedProgramPoint, ProgramOrder};
use core::cmp::Ordering;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::cmp::Ordering;
// Dummy program order which simply compares indexes. // Dummy program order which simply compares indexes.
// It is assumed that EBBs have indexes that are multiples of 10, and instructions have indexes // It is assumed that EBBs have indexes that are multiples of 10, and instructions have indexes

View File

@@ -275,9 +275,9 @@ mod tests {
use super::Pressure; use super::Pressure;
use crate::isa::{RegClass, TargetIsa}; use crate::isa::{RegClass, TargetIsa};
use crate::regalloc::RegisterSet; use crate::regalloc::RegisterSet;
use alloc::boxed::Box;
use core::borrow::Borrow; use core::borrow::Borrow;
use core::str::FromStr; use core::str::FromStr;
use alloc::boxed::Box;
use target_lexicon::triple; use target_lexicon::triple;
// Make an arm32 `TargetIsa`, if possible. // Make an arm32 `TargetIsa`, if possible.

View File

@@ -21,8 +21,8 @@ use crate::regalloc::live_value_tracker::{LiveValue, LiveValueTracker};
use crate::regalloc::liveness::Liveness; use crate::regalloc::liveness::Liveness;
use crate::timing; use crate::timing;
use crate::topo_order::TopoOrder; use crate::topo_order::TopoOrder;
use log::debug;
use alloc::vec::Vec; use alloc::vec::Vec;
use log::debug;
/// Reusable data structures for the reload pass. /// Reusable data structures for the reload pass.
pub struct Reload { pub struct Reload {

View File

@@ -104,12 +104,12 @@ use crate::entity::{SparseMap, SparseMapValue};
use crate::ir::Value; use crate::ir::Value;
use crate::isa::{RegClass, RegUnit}; use crate::isa::{RegClass, RegUnit};
use crate::regalloc::register_set::RegSetIter; use crate::regalloc::register_set::RegSetIter;
use alloc::vec::Vec;
use core::cmp; use core::cmp;
use core::fmt; use core::fmt;
use core::mem; use core::mem;
use core::u16; use core::u16;
use log::debug; use log::debug;
use alloc::vec::Vec;
/// A variable in the constraint problem. /// A variable in the constraint problem.
/// ///
@@ -1159,8 +1159,8 @@ mod tests {
use crate::ir::Value; use crate::ir::Value;
use crate::isa::{RegClass, RegInfo, RegUnit, TargetIsa}; use crate::isa::{RegClass, RegInfo, RegUnit, TargetIsa};
use crate::regalloc::RegisterSet; use crate::regalloc::RegisterSet;
use core::str::FromStr;
use alloc::boxed::Box; use alloc::boxed::Box;
use core::str::FromStr;
use target_lexicon::triple; use target_lexicon::triple;
// Make an arm32 `TargetIsa`, if possible. // Make an arm32 `TargetIsa`, if possible.

View File

@@ -27,9 +27,9 @@ use crate::regalloc::pressure::Pressure;
use crate::regalloc::virtregs::VirtRegs; use crate::regalloc::virtregs::VirtRegs;
use crate::timing; use crate::timing;
use crate::topo_order::TopoOrder; use crate::topo_order::TopoOrder;
use alloc::vec::Vec;
use core::fmt; use core::fmt;
use log::debug; use log::debug;
use alloc::vec::Vec;
/// Return a top-level register class which contains `unit`. /// Return a top-level register class which contains `unit`.
fn toprc_containing_regunit(unit: RegUnit, reginfo: &RegInfo) -> RegClass { fn toprc_containing_regunit(unit: RegUnit, reginfo: &RegInfo) -> RegClass {

View File

@@ -18,11 +18,11 @@ use crate::entity::{EntityList, ListPool};
use crate::entity::{Keys, PrimaryMap, SecondaryMap}; use crate::entity::{Keys, PrimaryMap, SecondaryMap};
use crate::ir::{Function, Value}; use crate::ir::{Function, Value};
use crate::packed_option::PackedOption; use crate::packed_option::PackedOption;
use alloc::vec::Vec;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::fmt; use core::fmt;
use core::slice; use core::slice;
use smallvec::SmallVec; use smallvec::SmallVec;
use alloc::vec::Vec;
/// A virtual register reference. /// A virtual register reference.
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] #[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]

View File

@@ -22,11 +22,11 @@
use crate::constant_hash::{probe, simple_hash}; use crate::constant_hash::{probe, simple_hash};
use crate::isa::TargetIsa; use crate::isa::TargetIsa;
use alloc::boxed::Box;
use alloc::string::{String, ToString};
use core::fmt; use core::fmt;
use core::str; use core::str;
use failure_derive::Fail; use failure_derive::Fail;
use alloc::boxed::Box;
use alloc::string::{String, ToString};
/// A string-based configurator for settings groups. /// A string-based configurator for settings groups.
/// ///

View File

@@ -5,9 +5,9 @@ use crate::dominator_tree::DominatorTree;
use crate::ir::{Function, Inst, InstructionData, Opcode, Type}; use crate::ir::{Function, Inst, InstructionData, Opcode, Type};
use crate::scoped_hash_map::ScopedHashMap; use crate::scoped_hash_map::ScopedHashMap;
use crate::timing; use crate::timing;
use alloc::vec::Vec;
use core::cell::{Ref, RefCell}; use core::cell::{Ref, RefCell};
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use alloc::vec::Vec;
/// Test whether the given opcode is unsafe to even consider for GVN. /// Test whether the given opcode is unsafe to even consider for GVN.
fn trivially_unsafe_for_gvn(opcode: Opcode) -> bool { fn trivially_unsafe_for_gvn(opcode: Opcode) -> bool {

View File

@@ -2,12 +2,12 @@ use crate::ir::{Function, SourceLoc, Value, ValueLabel, ValueLabelAssignments, V
use crate::isa::TargetIsa; use crate::isa::TargetIsa;
use crate::regalloc::{Context, RegDiversions}; use crate::regalloc::{Context, RegDiversions};
use crate::HashMap; use crate::HashMap;
use alloc::collections::BTreeMap;
use alloc::vec::Vec;
use core::cmp::Ordering; use core::cmp::Ordering;
use core::iter::Iterator; use core::iter::Iterator;
use core::ops::Bound::*; use core::ops::Bound::*;
use core::ops::Deref; use core::ops::Deref;
use alloc::collections::BTreeMap;
use alloc::vec::Vec;
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};

View File

@@ -72,12 +72,12 @@ use crate::isa::TargetIsa;
use crate::iterators::IteratorExtras; use crate::iterators::IteratorExtras;
use crate::settings::FlagsOrIsa; use crate::settings::FlagsOrIsa;
use crate::timing; use crate::timing;
use core::cmp::Ordering;
use core::fmt::{self, Display, Formatter, Write};
use failure_derive::Fail;
use alloc::collections::BTreeSet; use alloc::collections::BTreeSet;
use alloc::string::String; use alloc::string::String;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::cmp::Ordering;
use core::fmt::{self, Display, Formatter, Write};
use failure_derive::Fail;
pub use self::cssa::verify_cssa; pub use self::cssa::verify_cssa;
pub use self::liveness::verify_liveness; pub use self::liveness::verify_liveness;

View File

@@ -14,9 +14,9 @@ use crate::isa::{RegInfo, TargetIsa};
use crate::packed_option::ReservedValue; use crate::packed_option::ReservedValue;
use crate::value_label::ValueLabelsRanges; use crate::value_label::ValueLabelsRanges;
use crate::HashSet; use crate::HashSet;
use core::fmt::{self, Write};
use alloc::string::String; use alloc::string::String;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::fmt::{self, Write};
/// A `FuncWriter` used to decorate functions during printing. /// A `FuncWriter` used to decorate functions during printing.
pub trait FuncWriter { pub trait FuncWriter {

View File

@@ -3,10 +3,10 @@
use crate::iter::{Iter, IterMut}; use crate::iter::{Iter, IterMut};
use crate::keys::Keys; use crate::keys::Keys;
use crate::EntityRef; use crate::EntityRef;
use alloc::boxed::Box;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ops::{Index, IndexMut}; use core::ops::{Index, IndexMut};
use core::slice; use core::slice;
use alloc::boxed::Box;
/// A slice mapping `K -> V` allocating dense entity references. /// A slice mapping `K -> V` allocating dense entity references.
/// ///

View File

@@ -1,9 +1,9 @@
//! Small lists of entity references. //! Small lists of entity references.
use crate::packed_option::ReservedValue; use crate::packed_option::ReservedValue;
use crate::EntityRef; use crate::EntityRef;
use alloc::vec::Vec;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::mem; use core::mem;
use alloc::vec::Vec;
/// A small list of entity references allocated from a pool. /// A small list of entity references allocated from a pool.
/// ///

View File

@@ -3,6 +3,7 @@
use crate::iter::{Iter, IterMut}; use crate::iter::{Iter, IterMut};
use crate::keys::Keys; use crate::keys::Keys;
use crate::EntityRef; use crate::EntityRef;
use alloc::vec::Vec;
use core::cmp::min; use core::cmp::min;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ops::{Index, IndexMut}; use core::ops::{Index, IndexMut};
@@ -13,7 +14,6 @@ use serde::{
ser::{SerializeSeq, Serializer}, ser::{SerializeSeq, Serializer},
Deserialize, Serialize, Deserialize, Serialize,
}; };
use alloc::vec::Vec;
/// A mapping `K -> V` for densely indexed entity references. /// A mapping `K -> V` for densely indexed entity references.
/// ///

View File

@@ -3,14 +3,14 @@ use crate::boxed_slice::BoxedSlice;
use crate::iter::{Iter, IterMut}; use crate::iter::{Iter, IterMut};
use crate::keys::Keys; use crate::keys::Keys;
use crate::EntityRef; use crate::EntityRef;
use alloc::boxed::Box;
use alloc::vec::Vec;
use core::iter::FromIterator; use core::iter::FromIterator;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ops::{Index, IndexMut}; use core::ops::{Index, IndexMut};
use core::slice; use core::slice;
#[cfg(feature = "enable-serde")] #[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use alloc::boxed::Box;
use alloc::vec::Vec;
/// A primary mapping `K -> V` allocating dense entity references. /// A primary mapping `K -> V` allocating dense entity references.
/// ///

View File

@@ -2,8 +2,8 @@
use crate::keys::Keys; use crate::keys::Keys;
use crate::EntityRef; use crate::EntityRef;
use core::marker::PhantomData;
use alloc::vec::Vec; use alloc::vec::Vec;
use core::marker::PhantomData;
/// A set of `K` for densely indexed entity references. /// A set of `K` for densely indexed entity references.
/// ///

View File

@@ -9,10 +9,10 @@
use crate::map::SecondaryMap; use crate::map::SecondaryMap;
use crate::EntityRef; use crate::EntityRef;
use alloc::vec::Vec;
use core::mem; use core::mem;
use core::slice; use core::slice;
use core::u32; use core::u32;
use alloc::vec::Vec;
/// Trait for extracting keys from values stored in a `SparseMap`. /// Trait for extracting keys from values stored in a `SparseMap`.
/// ///

View File

@@ -1,6 +1,7 @@
//! A frontend for building Cranelift IR from other languages. //! A frontend for building Cranelift IR from other languages.
use crate::ssa::{Block, SSABuilder, SideEffects}; use crate::ssa::{Block, SSABuilder, SideEffects};
use crate::variable::Variable; use crate::variable::Variable;
use alloc::vec::Vec;
use cranelift_codegen::cursor::{Cursor, FuncCursor}; use cranelift_codegen::cursor::{Cursor, FuncCursor};
use cranelift_codegen::entity::{EntitySet, SecondaryMap}; use cranelift_codegen::entity::{EntitySet, SecondaryMap};
use cranelift_codegen::ir; use cranelift_codegen::ir;
@@ -13,7 +14,6 @@ use cranelift_codegen::ir::{
}; };
use cranelift_codegen::isa::{TargetFrontendConfig, TargetIsa}; use cranelift_codegen::isa::{TargetFrontendConfig, TargetIsa};
use cranelift_codegen::packed_option::PackedOption; use cranelift_codegen::packed_option::PackedOption;
use alloc::vec::Vec;
/// Structure used for translating a series of functions into Cranelift IR. /// Structure used for translating a series of functions into Cranelift IR.
/// ///
@@ -893,13 +893,13 @@ mod tests {
use super::greatest_divisible_power_of_two; use super::greatest_divisible_power_of_two;
use crate::frontend::{FunctionBuilder, FunctionBuilderContext}; use crate::frontend::{FunctionBuilder, FunctionBuilderContext};
use crate::Variable; use crate::Variable;
use alloc::string::ToString;
use cranelift_codegen::entity::EntityRef; use cranelift_codegen::entity::EntityRef;
use cranelift_codegen::ir::types::*; use cranelift_codegen::ir::types::*;
use cranelift_codegen::ir::{AbiParam, ExternalName, Function, InstBuilder, Signature}; use cranelift_codegen::ir::{AbiParam, ExternalName, Function, InstBuilder, Signature};
use cranelift_codegen::isa::CallConv; use cranelift_codegen::isa::CallConv;
use cranelift_codegen::settings; use cranelift_codegen::settings;
use cranelift_codegen::verifier::verify_function; use cranelift_codegen::verifier::verify_function;
use alloc::string::ToString;
fn sample_function(lazy_seal: bool) { fn sample_function(lazy_seal: bool) {
let mut sig = Signature::new(CallConv::SystemV); let mut sig = Signature::new(CallConv::SystemV);

View File

@@ -6,6 +6,7 @@
//! Lecture Notes in Computer Science, vol 7791. Springer, Berlin, Heidelberg //! Lecture Notes in Computer Science, vol 7791. Springer, Berlin, Heidelberg
use crate::Variable; use crate::Variable;
use alloc::vec::Vec;
use core::mem; use core::mem;
use core::u32; use core::u32;
use cranelift_codegen::cursor::{Cursor, FuncCursor}; use cranelift_codegen::cursor::{Cursor, FuncCursor};
@@ -17,7 +18,6 @@ use cranelift_codegen::ir::{Ebb, Function, Inst, InstBuilder, InstructionData, T
use cranelift_codegen::packed_option::PackedOption; use cranelift_codegen::packed_option::PackedOption;
use cranelift_codegen::packed_option::ReservedValue; use cranelift_codegen::packed_option::ReservedValue;
use smallvec::SmallVec; use smallvec::SmallVec;
use alloc::vec::Vec;
/// Structure containing the data relevant the construction of SSA for a given function. /// Structure containing the data relevant the construction of SSA for a given function.
/// ///

View File

@@ -1,9 +1,9 @@
use super::HashMap; use super::HashMap;
use crate::frontend::FunctionBuilder; use crate::frontend::FunctionBuilder;
use alloc::vec::Vec;
use cranelift_codegen::ir::condcodes::IntCC; use cranelift_codegen::ir::condcodes::IntCC;
use cranelift_codegen::ir::*; use cranelift_codegen::ir::*;
use log::debug; use log::debug;
use alloc::vec::Vec;
type EntryIndex = u64; type EntryIndex = u64;
@@ -290,8 +290,8 @@ impl ContiguousCaseRange {
mod tests { mod tests {
use super::*; use super::*;
use crate::frontend::FunctionBuilderContext; use crate::frontend::FunctionBuilderContext;
use cranelift_codegen::ir::Function;
use alloc::string::ToString; use alloc::string::ToString;
use cranelift_codegen::ir::Function;
macro_rules! setup { macro_rules! setup {
($default:expr, [$($index:expr,)*]) => {{ ($default:expr, [$($index:expr,)*]) => {{