When lowering br_table to branches, delete the old jump tables.

This prevents codegen from emitting unused readonly data.
This commit is contained in:
Dan Gohman
2018-10-26 06:39:30 -07:00
committed by Benjamin Bouvier
parent 997424a4c5
commit bdcc06eb15
2 changed files with 45 additions and 0 deletions

View File

@@ -110,6 +110,11 @@ pub fn legalize_function(func: &mut ir::Function, cfg: &mut ControlFlowGraph, is
}
}
}
// Now that we've lowered all br_tables, we don't need the jump tables anymore.
if !isa.flags().jump_tables_enabled() {
pos.func.jump_tables.clear();
}
}
// Include legalization patterns that were generated by `gen_legalizer.py` from the `XForms` in