Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/cleanup-runner
- &install-rust
name: Install Rust
run: |
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- *checkout
- uses: ./.github/actions/cleanup-runner
- *install-rust
- name: Determine midenc release tag
id: midenc-release
Expand Down Expand Up @@ -138,6 +140,7 @@ jobs:
cancel-in-progress: false
steps:
- *checkout
- uses: ./.github/actions/cleanup-runner
- *install-rust
- name: Create release PR
id: release-pr
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/cleanup-runner
- name: Install Rust
run: |
rustup update --no-self-update
Expand Down
12 changes: 10 additions & 2 deletions hir/src/ir/value/aliasing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,30 @@ pub struct ValueOrAlias {
/// on the operand stack as a unique value. The alias identifier is usually generated from a
/// counter of the unique instances of the value, but can be any unique integer value.
alias_id: u8,
/// Cached result of `value.borrow().ty().size_in_felts()`, stored to avoid repeated
/// virtual dispatch through `dyn Value` in hot loops (solver, spill analysis).
stack_size: u8,
}

impl ValueOrAlias {
/// Create a new [ValueOrAlias] from the given [ValueRef]
pub fn new(value: ValueRef) -> Self {
let value_id = value.borrow().id();
let borrowed = value.borrow();
let value_id = borrowed.id();
let stack_size = borrowed.ty().size_in_felts() as u8;
drop(borrowed);
Self {
value,
value_id,
stack_size,
alias_id: 0,
}
}

/// Gets the effective size of this type on the Miden operand stack
#[inline(always)]
pub fn stack_size(&self) -> usize {
self.value.borrow().ty().size_in_felts()
self.stack_size as usize
}

/// Create an aliased copy of this value, using `id` to uniquely identify the alias.
Expand Down
Loading