(
mut instructions: Vec<Instruction>,
)
| 239 | let (instructions, source_locations) = |
| 240 | remove_redundant_instructions(instructions, source_locations, exception_table)?; |
| 241 | if let Some(metrics) = metrics.as_mut() { |
| 242 | metrics.observe_pass( |
| 243 | crate::metrics::Optimise2Pass::RedundantInstructionsBefore, |
| 244 | before, |
| 245 | instructions.len(), |
| 246 | ); |
| 247 | } |
| 248 | let before = instructions.len(); |
| 249 | let instructions = thread_jump_targets(instructions)?; |
| 250 | if let Some(metrics) = metrics.as_mut() { |
| 251 | metrics.observe_pass( |
| 252 | crate::metrics::Optimise2Pass::ThreadJumpsBefore, |
| 253 | before, |
| 254 | instructions.len(), |
| 255 | ); |
| 256 | } |
| 257 | let before = instructions.len(); |
| 258 | let (instructions, source_locations) = |
| 259 | fold_branch_over_goto(instructions, source_locations, exception_table)?; |
| 260 | if let Some(metrics) = metrics.as_mut() { |
| 261 | metrics.observe_pass( |
| 262 | crate::metrics::Optimise2Pass::BranchOverGotoBefore, |
| 263 | before, |
| 264 | instructions.len(), |
| 265 | ); |
| 266 | } |
| 267 | let before = instructions.len(); |
| 268 | let (instructions, source_locations) = |
| 269 | remove_unreachable_instructions(instructions, source_locations, exception_table)?; |
| 270 | if let Some(metrics) = metrics.as_mut() { |
| 271 | metrics.observe_pass( |
| 272 | crate::metrics::Optimise2Pass::UnreachableBefore, |
| 273 | before, |
| 274 | instructions.len(), |
| 275 | ); |
| 276 | } |
| 277 | let post_cleanup_baseline = instructions.len(); |
| 278 | let before = instructions.len(); |
| 279 | let (instructions, source_locations) = |
| 280 | rewrite_store_load_pairs(instructions, source_locations, exception_table); |
| 281 | if let Some(metrics) = metrics.as_mut() { |
| 282 | metrics.observe_pass( |
| 283 | crate::metrics::Optimise2Pass::StoreLoadPairs, |
| 284 | before, |
| 285 | instructions.len(), |
| 286 | ); |
| 287 | } |
| 288 | let before = instructions.len(); |
| 289 | let (instructions, source_locations) = |
| 290 | fold_iinc_patterns(instructions, source_locations, exception_table)?; |
| 291 | if let Some(metrics) = metrics.as_mut() { |
| 292 | metrics.observe_pass( |
| 293 | crate::metrics::Optimise2Pass::IincPatterns, |
| 294 | before, |
| 295 | instructions.len(), |
| 296 | ); |
| 297 | } |
| 298 | let before = instructions.len(); |
no test coverage detected