Lines Matching refs:loop_analysis

165         let _tt = timing::loop_analysis();  in compute()
310 use crate::loop_analysis::{Loop, LoopAnalysis};
342 let mut loop_analysis = LoopAnalysis::new(); in nested_loops_detection() localVariable
347 loop_analysis.compute(&func, &cfg, &domtree); in nested_loops_detection()
349 let loops = loop_analysis.loops().collect::<Vec<Loop>>(); in nested_loops_detection()
351 assert_eq!(loop_analysis.loop_header(loops[0]), block0); in nested_loops_detection()
352 assert_eq!(loop_analysis.loop_header(loops[1]), block1); in nested_loops_detection()
353 assert_eq!(loop_analysis.loop_parent(loops[1]), Some(loops[0])); in nested_loops_detection()
354 assert_eq!(loop_analysis.loop_parent(loops[0]), None); in nested_loops_detection()
355 assert_eq!(loop_analysis.is_in_loop(block0, loops[0]), true); in nested_loops_detection()
356 assert_eq!(loop_analysis.is_in_loop(block0, loops[1]), false); in nested_loops_detection()
357 assert_eq!(loop_analysis.is_in_loop(block1, loops[1]), true); in nested_loops_detection()
358 assert_eq!(loop_analysis.is_in_loop(block1, loops[0]), true); in nested_loops_detection()
359 assert_eq!(loop_analysis.is_in_loop(block2, loops[1]), true); in nested_loops_detection()
360 assert_eq!(loop_analysis.is_in_loop(block2, loops[0]), true); in nested_loops_detection()
361 assert_eq!(loop_analysis.is_in_loop(block3, loops[0]), true); in nested_loops_detection()
362 assert_eq!(loop_analysis.is_in_loop(block0, loops[1]), false); in nested_loops_detection()
363 assert_eq!(loop_analysis.loop_level(block0).level(), 1); in nested_loops_detection()
364 assert_eq!(loop_analysis.loop_level(block1).level(), 2); in nested_loops_detection()
365 assert_eq!(loop_analysis.loop_level(block2).level(), 2); in nested_loops_detection()
366 assert_eq!(loop_analysis.loop_level(block3).level(), 1); in nested_loops_detection()
406 let mut loop_analysis = LoopAnalysis::new(); in complex_loop_detection() localVariable
409 loop_analysis.compute(&func, &cfg, &domtree); in complex_loop_detection()
411 let loops = loop_analysis.loops().collect::<Vec<Loop>>(); in complex_loop_detection()
413 assert_eq!(loop_analysis.loop_header(loops[0]), block0); in complex_loop_detection()
414 assert_eq!(loop_analysis.loop_header(loops[1]), block3); in complex_loop_detection()
415 assert_eq!(loop_analysis.loop_header(loops[2]), block1); in complex_loop_detection()
416 assert_eq!(loop_analysis.loop_parent(loops[1]), Some(loops[0])); in complex_loop_detection()
417 assert_eq!(loop_analysis.loop_parent(loops[2]), Some(loops[0])); in complex_loop_detection()
418 assert_eq!(loop_analysis.loop_parent(loops[0]), None); in complex_loop_detection()
419 assert_eq!(loop_analysis.is_in_loop(block0, loops[0]), true); in complex_loop_detection()
420 assert_eq!(loop_analysis.is_in_loop(block1, loops[2]), true); in complex_loop_detection()
421 assert_eq!(loop_analysis.is_in_loop(block2, loops[2]), true); in complex_loop_detection()
422 assert_eq!(loop_analysis.is_in_loop(block3, loops[1]), true); in complex_loop_detection()
423 assert_eq!(loop_analysis.is_in_loop(block4, loops[1]), true); in complex_loop_detection()
424 assert_eq!(loop_analysis.is_in_loop(block5, loops[0]), true); in complex_loop_detection()
425 assert_eq!(loop_analysis.loop_level(block0).level(), 1); in complex_loop_detection()
426 assert_eq!(loop_analysis.loop_level(block1).level(), 2); in complex_loop_detection()
427 assert_eq!(loop_analysis.loop_level(block2).level(), 2); in complex_loop_detection()
428 assert_eq!(loop_analysis.loop_level(block3).level(), 2); in complex_loop_detection()
429 assert_eq!(loop_analysis.loop_level(block4).level(), 2); in complex_loop_detection()
430 assert_eq!(loop_analysis.loop_level(block5).level(), 1); in complex_loop_detection()