Add a branch relaxation pass for #72.

Compute exact EBB header offsets and check that branches are in range.

Not implemented yet: Relax branches that are not in range.

Invoke the relax_branches() pass from the 'test binemit' file tests so
they can verify the proper encoding of branch instructions too.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-05 14:54:17 -07:00
parent 598c81c12e
commit 81251c3005
6 changed files with 224 additions and 42 deletions

View File

@@ -3,6 +3,10 @@
//! The `binemit` module contains code for translating Cretonne's intermediate representation into
//! binary machine code.
mod relaxation;
pub use self::relaxation::relax_branches;
use ir::{Ebb, FuncRef, JumpTable, Function, Inst};
/// Offset in bytes from the beginning of the function.