Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deterministic tagging for stack allocations #13

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
109 changes: 64 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions cranelift/codegen/meta/src/shared/instructions.rs
Original file line number Diff line number Diff line change
@@ -3794,6 +3794,24 @@ pub(crate) fn define(
.operands_out(vec![Operand::new("a", iAddr)]),
);

ig.push(
Inst::new(
"arm64_add_to_tag",
r#"
Add immediate to tag
"#,
&formats.binary_imm8,
)
.operands_in(vec![
Operand::new("Xn", iAddr).with_doc("Source register"),
Operand::new("imm4", &imm.uimm8)
.with_doc("Unsigned immediate that is added to tag of the address"),
])
.operands_out(vec![
Operand::new("Xd", iAddr).with_doc("Destination register")
]),
);

ig.push(
Inst::new(
"arm64_stg",
6 changes: 6 additions & 0 deletions cranelift/codegen/src/ir/dfg.rs
Original file line number Diff line number Diff line change
@@ -310,6 +310,12 @@ impl<'a> Iterator for Values<'a> {
///
/// Values are either block parameters or instruction results.
impl DataFlowGraph {
/// Insert a value.
pub fn insert_value(&mut self, ty: Type, val: Value) -> Value {
let data = ValueData::Alias { ty, original: val };
self.make_value(data.into())
}

/// Allocate an extended value entry.
fn make_value(&mut self, data: ValueData) -> Value {
self.values.push(data.into())
Loading