Skip to content
Snippets Groups Projects

IP SROA Parameters

Merged rarbore2 requested to merge ip-sroa-params into main
1 unresolved thread
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;
Loading