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

Fix bit packing of bundle params #192

Merged
merged 2 commits into from
Sep 11, 2024
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
12 changes: 1 addition & 11 deletions src/ion/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ impl LiveBundle {
self.spill_weight_and_props & (1 << 29) != 0
}

#[inline(always)]
pub fn cached_stack(&self) -> bool {
self.spill_weight_and_props & (1 << 28) != 0
}

#[inline(always)]
pub fn set_cached_fixed(&mut self) {
self.spill_weight_and_props |= 1 << 30;
Expand All @@ -254,14 +249,9 @@ impl LiveBundle {
self.spill_weight_and_props |= 1 << 29;
}

#[inline(always)]
pub fn set_cached_stack(&mut self) {
self.spill_weight_and_props |= 1 << 28;
}

#[inline(always)]
pub fn cached_spill_weight(&self) -> u32 {
self.spill_weight_and_props & ((1 << 28) - 1)
self.spill_weight_and_props & BUNDLE_MAX_SPILL_WEIGHT
}
}

Expand Down
12 changes: 1 addition & 11 deletions src/ion/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ impl<'a, F: Function> Env<'a, F> {
}

// Check for a requirements conflict.
if self.bundles[from].cached_stack()
|| self.bundles[from].cached_fixed()
|| self.bundles[to].cached_stack()
|| self.bundles[to].cached_fixed()
{
if self.bundles[from].cached_fixed() || self.bundles[to].cached_fixed() {
if self.merge_bundle_requirements(from, to).is_err() {
trace!(" -> conflicting requirements; aborting merge");
return false;
Expand Down Expand Up @@ -155,9 +151,6 @@ impl<'a, F: Function> Env<'a, F> {
}
self.bundles[to].ranges = list;

if self.bundles[from].cached_stack() {
self.bundles[to].set_cached_stack();
}
if self.bundles[from].cached_fixed() {
self.bundles[to].set_cached_fixed();
}
Expand Down Expand Up @@ -224,9 +217,6 @@ impl<'a, F: Function> Env<'a, F> {
*to_range = to_range.join(from_range);
}

if self.bundles[from].cached_stack() {
self.bundles[to].set_cached_stack();
}
if self.bundles[from].cached_fixed() {
self.bundles[to].set_cached_fixed();
}
Expand Down
Loading