Skip to content
Closed
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 @@ -25,6 +25,7 @@ jobs:
releases: ${{ steps.publish.outputs.releases }}
releases_created: ${{ steps.publish.outputs.releases_created }}
steps:
- uses: ./.github/actions/cleanup-runner
- &checkout
uses: actions/checkout@v5
with:
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: ./.github/actions/cleanup-runner
- *checkout
- *install-rust
- name: Determine midenc release tag
Expand Down Expand Up @@ -137,6 +139,7 @@ jobs:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- uses: ./.github/actions/cleanup-runner
- *checkout
- *install-rust
- name: Create 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 @@ -21,6 +21,7 @@ jobs:
permissions:
contents: read
steps:
- uses: ./.github/actions/cleanup-runner
- uses: actions/checkout@v5
- name: Install Rust
run: |
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