From 263b2e0c82483c2d51b76b9fb9ca60e5fd244940 Mon Sep 17 00:00:00 2001 From: Russel Arbore <russel.jma@gmail.com> Date: Fri, 28 Feb 2025 19:28:58 -0600 Subject: [PATCH] whoops --- hercules_opt/src/interprocedural_sroa.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hercules_opt/src/interprocedural_sroa.rs b/hercules_opt/src/interprocedural_sroa.rs index 044d3590..c7ea5836 100644 --- a/hercules_opt/src/interprocedural_sroa.rs +++ b/hercules_opt/src/interprocedural_sroa.rs @@ -1,6 +1,3 @@ -use std::collections::HashMap; -use std::iter::zip; - use hercules_ir::ir::*; use crate::*; @@ -51,24 +48,24 @@ pub fn interprocedural_sroa( let mut old_return_type_map = vec![]; let mut changed = false; - for ret_typ in param_types.iter() { - if !can_sroa_type(editor, *ret_typ) { + for par_typ in param_types.iter() { + if !can_sroa_type(editor, *par_typ) { old_param_type_map.push(IndexTree::Leaf(new_param_types.len())); - new_param_types.push(*ret_typ); + new_param_types.push(*par_typ); } else { - let (types, index) = sroa_type(editor, *ret_typ, new_param_types.len()); + let (types, index) = sroa_type(editor, *par_typ, new_param_types.len()); old_param_type_map.push(index); new_param_types.extend(types); changed = true; } } - for par_typ in return_types.iter() { - if !can_sroa_type(editor, *par_typ) { + for ret_typ in return_types.iter() { + if !can_sroa_type(editor, *ret_typ) { old_return_type_map.push(IndexTree::Leaf(new_return_types.len())); - new_return_types.push(*par_typ); + new_return_types.push(*ret_typ); } else { - let (types, index) = sroa_type(editor, *par_typ, new_return_types.len()); + let (types, index) = sroa_type(editor, *ret_typ, new_return_types.len()); old_return_type_map.push(index); new_return_types.extend(types); changed = true; -- GitLab