ARM64 backend, part 8 / 11: integration.
This patch ties together the new backend infrastructure with the existing Cranelift codegen APIs. With all patches in this series up to this patch applied, the ARM64 compiler is now functional and can be used. Two uses of this functionality -- filecheck-based tests and integration into wasmtime -- will come in subsequent patches.
This commit is contained in:
@@ -360,6 +360,7 @@ fn optimize_complex_addresses(pos: &mut EncCursor, inst: Inst, isa: &dyn TargetI
|
||||
pub fn do_postopt(func: &mut Function, isa: &dyn TargetIsa) {
|
||||
let _tt = timing::postopt();
|
||||
let mut pos = EncCursor::new(func, isa);
|
||||
let is_mach_backend = isa.get_mach_backend().is_some();
|
||||
while let Some(_block) = pos.next_block() {
|
||||
let mut last_flags_clobber = None;
|
||||
while let Some(inst) = pos.next_inst() {
|
||||
@@ -367,13 +368,15 @@ pub fn do_postopt(func: &mut Function, isa: &dyn TargetIsa) {
|
||||
// Optimize instructions to make use of flags.
|
||||
optimize_cpu_flags(&mut pos, inst, last_flags_clobber, isa);
|
||||
|
||||
// Track the most recent seen instruction that clobbers the flags.
|
||||
if let Some(constraints) = isa
|
||||
.encoding_info()
|
||||
.operand_constraints(pos.func.encodings[inst])
|
||||
{
|
||||
if constraints.clobbers_flags {
|
||||
last_flags_clobber = Some(inst)
|
||||
if !is_mach_backend {
|
||||
// Track the most recent seen instruction that clobbers the flags.
|
||||
if let Some(constraints) = isa
|
||||
.encoding_info()
|
||||
.operand_constraints(pos.func.encodings[inst])
|
||||
{
|
||||
if constraints.clobbers_flags {
|
||||
last_flags_clobber = Some(inst)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user