Address review comments:
- Undo temporary changes to default features (`all-arch`) and a
signal-handler test.
- Remove `SIGTRAP` handler: no longer needed now that we've found an
"undefined opcode" option on ARM64.
- Rename pp.rs to pretty_print.rs in machinst/.
- Only use empty stack-probe on non-x86. As per a comment in
rust-lang/compiler-builtins [1], LLVM only supports stack probes on
x86 and x86-64. Thus, on any other CPU architecture, we cannot refer
to `__rust_probestack`, because it does not exist.
- Rename arm64 to aarch64.
- Use `target` directive in vcode filetests.
- Run the flags verifier, but without encinfo, when using new backends.
- Clean up warning overrides.
- Fix up use of casts: use u32::from(x) and siblings when possible,
u32::try_from(x).unwrap() when not, to avoid silent truncation.
- Take immutable `Function` borrows as input; we don't actually
mutate the input IR.
- Lots of other miscellaneous cleanups.
[1] cae3e6ea23/src/probestack.rs (L39)
This commit is contained in:
@@ -7,14 +7,13 @@ use crate::timing;
|
||||
|
||||
use log::debug;
|
||||
use regalloc::{allocate_registers, RegAllocAlgorithm};
|
||||
use std::env;
|
||||
|
||||
/// Compile the given function down to VCode with allocated registers, ready
|
||||
/// for binary emission.
|
||||
pub fn compile<B: LowerBackend>(
|
||||
f: &mut Function,
|
||||
f: &Function,
|
||||
b: &B,
|
||||
abi: Box<dyn ABIBody<B::MInst>>,
|
||||
abi: Box<dyn ABIBody<I = B::MInst>>,
|
||||
flags: &settings::Flags,
|
||||
) -> VCode<B::MInst>
|
||||
where
|
||||
@@ -28,18 +27,8 @@ where
|
||||
debug!("vcode from lowering: \n{}", vcode.show_rru(Some(universe)));
|
||||
|
||||
// Perform register allocation.
|
||||
let algorithm = match env::var("REGALLOC") {
|
||||
Ok(str) => match str.as_str() {
|
||||
"lsrac" => RegAllocAlgorithm::LinearScanChecked,
|
||||
"lsra" => RegAllocAlgorithm::LinearScan,
|
||||
// to wit: btc doesn't mean "bitcoin" here
|
||||
"btc" => RegAllocAlgorithm::BacktrackingChecked,
|
||||
_ => RegAllocAlgorithm::Backtracking,
|
||||
},
|
||||
// By default use backtracking, which is the fastest.
|
||||
Err(_) => RegAllocAlgorithm::Backtracking,
|
||||
};
|
||||
|
||||
// TODO: select register allocation algorithm from flags.
|
||||
let algorithm = RegAllocAlgorithm::Backtracking;
|
||||
let result = {
|
||||
let _tt = timing::regalloc();
|
||||
allocate_registers(
|
||||
@@ -70,7 +59,5 @@ where
|
||||
vcode.show_rru(Some(universe))
|
||||
);
|
||||
|
||||
//println!("{}\n", vcode.show_rru(Some(&B::MInst::reg_universe())));
|
||||
|
||||
vcode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user