@@ -398,10 +398,6 @@ sub time_all_compilers {
398
398
my $expected = $test -> {expected };
399
399
$expected = sub { $expected } unless ref $expected eq ' CODE' ;
400
400
401
- # XXXX: Fix handling of failed runs in below calls to time_command()
402
- # to properly support stress tests; this probably means fallout
403
- # in other places to handle failed as well as missing results.
404
-
405
401
my @all_times ;
406
402
my $scalable = $test -> {scalable } // ((grep /\bSCALE\b/ => @run ) ? 1 : 0);
407
403
if ($scalable ) {
@@ -412,14 +408,13 @@ sub time_all_compilers {
412
408
# Determine 0-scale time (mostly compile time)
413
409
say ' +++ Determining compile time for this test ...' if $verbose ;
414
410
my $run_times = time_command(\@compile , \@run , $overhead_runs , 0, 0, $expected -> (0), $verbose );
411
+ push @all_times , @{$run_times || []};
415
412
if (!$run_times || grep { $_ -> {failed } } @$run_times ) {
416
413
warn " Compiler $name is failing at scale=0 for test $test ->{name}, aborting remaining runs.\n " ;
417
- # XXXX: Should we push onto @all_times before aborting?
418
414
next ;
419
415
}
420
416
421
417
say ' +++ Running scaled timings for this test ...' if $verbose ;
422
- push @all_times , @$run_times ;
423
418
my $min_run_time = min(map { $_ -> {time } } @$run_times );
424
419
my $startup_time = $startup ? $startup -> {$name } || 0 : 0;
425
420
my $ignore_time = max($startup_time , $min_run_time );
@@ -428,12 +423,11 @@ sub time_all_compilers {
428
423
my $scale_points = 0;
429
424
while ($run_times && ($lowest < $enough_time || $scale_points < $min_scaling_points )) {
430
425
$run_times = time_command(\@compile , \@run , $runs , $scale , $work -> ($scale ), $expected -> ($scale ), $verbose );
426
+ push @all_times , @{$run_times || []};
431
427
if (!$run_times || grep { $_ -> {failed } } @$run_times ) {
432
428
warn " Compiler $name is failing at scale=$scale for test $test ->{name}, aborting remaining runs.\n " ;
433
- # XXXX: Should we push onto @all_times before aborting?
434
429
last ;
435
430
}
436
- push @all_times , @$run_times ;
437
431
$scale_points ++;
438
432
439
433
$lowest = min(map { $_ -> {time } } @$run_times );
@@ -444,12 +438,11 @@ sub time_all_compilers {
444
438
}
445
439
else {
446
440
my $run_times = time_command(\@compile , \@run , $runs , 1, 1, $expected -> (1), $verbose );
441
+ push @all_times , @{$run_times || []};
447
442
if (!$run_times || grep { $_ -> {failed } } @$run_times ) {
448
443
warn " Compiler $name is failing for test $test ->{name}, continuing to next compiler/test.\n " ;
449
- # XXXX: Should we push onto @all_times before aborting?
450
444
next ;
451
445
}
452
- push @all_times , @$run_times ;
453
446
}
454
447
455
448
$times {$name } = \@all_times ;
@@ -600,8 +593,11 @@ sub best_times {
600
593
while (my ($comp , $times ) = each %$raw_times ) {
601
594
my %runs_by_scale ;
602
595
for my $run (@$times ) {
603
- push @{$runs_by_scale {$run -> {scale }} ||= []}, $run ;
596
+ push @{$runs_by_scale {$run -> {scale }} ||= []}, $run
597
+ unless $run -> {failed };
604
598
}
599
+ # If all runs failed, don't add the compiler to the best times at all
600
+ next unless %runs_by_scale ;
605
601
606
602
my %best_by_scale ;
607
603
while (my ($scale , $runs ) = each %runs_by_scale ) {
0 commit comments