[graphite] Fix for pr38492 and pr38498

Jack Howarth howarth@bromo.med.uc.edu
Wed Jan 7 04:18:00 GMT 2009


On Tue, Jan 06, 2009 at 03:26:12PM -0800, Jan Sjodin wrote:
> This patch fixes pr38492, which was caused by scalar phi nodes from conditionals. pr38498 was caused by non linear expressions (division) in the number of iterations of a loop. This was not detected early enough to discard the scop and the expression for the number of iterations was ignored later on. 
> 
> Okay for trunk and graphite branch if bootstrap passes?
> 
> Thanks,
> Jan
> 2009-01-06  Jan Sjodin  <jan.sjodin@amd.com>
> 
> 	PR tree-optimization/38492
> 	PR tree-optimization/38498
> 	* tree-check.c (operator_is_linear, scev_is_linear_expression): New.
> 	* tree-chrec.h (scev_is_linear_expression): Declared.
> 	* graphite.c (graphite_cannot_represent_loop_niter): New.
> 	(scopdet_basic_block_info): Call graphite_cannot_represent_loop_niter.
> 	(graphite_loop_normal_form): Use gcc_assert.
> 	(scan_tree_for_params): Use CASE_CONVERT.
> 	(phi_node_is_iv, bb_contains_non_iv_scalar_phi_nodes): New.
> 	(build_scop_conditions_1): Call bb_contains_non_iv_scalar_phi_nodes.
> 	Use gcc_assert.  Discard scops that contain unhandled cases.
> 	(build_scop_conditions): Return a boolean status for unhandled cases.
> 	(strip_mine_profitable_p): Print the loop number, not its depth.
> 	(is_interchange_valid): Pass the depth of the loop nest, don't
> 	recompute it wrongly.
> 	(graphite_trans_bb_block): Same.
> 	(graphite_trans_bb_block): Print tentative of loop blocking.
> 	(graphite_trans_scop_block): Do not print that the loop has been
> 	blocked.
> 	(graphite_transform_loops): Do not handle scops that contain condition
> 	scalar phi nodes.
> 
> 	* testsuite/gcc.dg/graphite/pr38500.c: Fixed warning as committed
> 	in trunk.
> 	* testsuite/gcc.dg/graphite/block-0.c: Update test.
> 	* testsuite/gcc.dg/graphite/block-1.c: Same.
> 	* testsuite/gcc.dg/graphite/block-2.c: Remove xfail and test for blocking.
> 	* testsuite/gcc.dg/graphite/block-4.c: Remove test for strip mine.
> 	* testsuite/gcc.dg/graphite/block-3.c: New.
> 	* testsuite/gcc.dg/graphite/pr38498.c: New.
> 

Jan,
   FYI, this patch also eliminates the remaining wrong result failures in the
capacita and protein polyhedron 2005 benchmarks. With this patch applied to gcc
trunk on i686-apple-darwin9, I am now able to build the polyhedron benchmarks with
"-ffast-math -funroll-loops -msse3 -O3 -fgraphite-identity" and the entire benchmark
builds and passes. Nice.
            Jack

================================================================================
Date & Time     :  6 Jan 2009 20:49:58
Test Name       : gfortran_lin_p4_graphite
Compile Command : gfortran -ffast-math -funroll-loops -msse3 -O3 -fgraphite-identity  %n.f90 -o %n
Benchmarks      : ac aermod air capacita channel doduc fatigue gas_dyn induct linpk mdbx nf protein rnflow test_fpu tfft
Maximum Times   :     2000.0
Target Error %  :      0.100
Minimum Repeats :    10
Maximum Repeats :   100

   Benchmark   Compile  Executable   Ave Run  Number   Estim
        Name    (secs)     (bytes)    (secs) Repeats   Err %
   ---------   -------  ----------   ------- -------  ------
          ac      2.17       10000     12.61      10  0.0780
      aermod     69.70       10000     25.52      10  0.0012
         air      4.17       10000      7.10      13  0.0893
    capacita      2.87       10000     49.59      10  0.0337
     channel      1.16       10000      3.05      10  0.0534
       doduc      9.12       10000     35.06      10  0.0668
     fatigue      2.98       10000     10.11      10  0.0086
     gas_dyn      3.68       10000     13.69      13  0.0870
      induct      6.93       10000     14.62      10  0.0454
       linpk      1.30       10000     15.28      10  0.0608
        mdbx      2.80       10000     12.30      10  0.0057
          nf      2.38       10000     25.44      11  0.0985
     protein      6.90       10000     39.09      10  0.0502
      rnflow      8.62       10000     30.58      10  0.0605
    test_fpu      7.64       10000     10.66      10  0.0467
        tfft      0.83       10000      2.08      15  0.0568

Geometric Mean Execution Time =      14.32 seconds

================================================================================
Polyhedron Benchmark Validator
Copyright (C) Polyhedron Software Ltd - 2004 - All rights reserved

Test File        : gfortran_lin_p4_graphite.run
Instruction File : ../../f90valid.in

> Value=            14159 Target=            14159 Tolerance=                0
> Value=               16 Target=               16 Tolerance=                0
> Value=          1000000 Target=          1000000 Tolerance=                0
> Value=0.44068679351     Target=0.44068679400     Tolerance=0.10000000000E-06
> Value=            10000 Target=            10000 Tolerance=                0
> Value= 1.4530259062     Target= 1.4530259100     Tolerance=0.10000000000E-02
> Value=0.60312607314E-07 Target=0.60312607300E-07 Tolerance=0.10000000000E-06
> Value=0.54549700079     Target=0.54549700100     Tolerance=0.30000000000E-03
> Value=0.25209045155E-04 Target=0.25209045200E-04 Tolerance=0.10000000000E-06
> Value= 139.68826600     Target= 139.68826600     Tolerance=0.10000000000    
> Value=0.15138495928E-01 Target=0.15138495900E-01 Tolerance=0.20000000000E-04

ac PASSED   11 tests - no failures

> Value= 2191.1145000     Target= 2191.1145000     Tolerance=0.10000000000E-02
> Value= 34310.421880     Target= 34310.421880     Tolerance=0.30000000000E-01
> Value= 4260.9589800     Target= 4260.9716800     Tolerance=0.50000000000E-01
> Value= 37094.359380     Target= 37094.375000     Tolerance=0.20000000000E-01
> Value= 7924.8901400     Target= 7924.8842800     Tolerance=0.30000000000E-01
> Value= 37094.359380     Target= 37094.375000     Tolerance= 1.0000000000    

aermod PASSED    6 tests - no failures

= Value=1737 Target=1737
> Value=0.99606856460E-02 Target=0.99606856460E-02 Tolerance=0.10000000000E-06
> Value=0.10000000000E-01 Target=0.10000000000E-01 Tolerance=0.10000000000E-06
> Value=0.41528600000     Target=0.41528600000     Tolerance=0.10000000000E-06
> Value=0.57795248195E-05 Target=0.57795248200E-05 Tolerance=0.10000000000E-06
> Value=0.10001137147E-01 Target=0.10001137100E-01 Tolerance=0.10000000000E-06
= Value=1744 Target=1744

air PASSED    7 tests - no failures

> Value=0.25749206500E-04 Target= 0.0000000000     Tolerance=0.60000000000E-04
> Value= 35.406155000     Target= 35.408000000     Tolerance=0.20000000000E-02
> Value=0.16246922300E-04 Target= 0.0000000000     Tolerance=0.60000000000E-04
> Value= 5.8967729000     Target= 5.8980000000     Tolerance=0.20000000000E-02

capacita PASSED    4 tests - no failures

> Value=0.42933170509E-01 Target=0.42933170400E-01 Tolerance=0.10000000000E-08
> Value= 667696.66776     Target= 667696.66000     Tolerance=0.10000000000E-01
> Value= 9.7805700000     Target= 9.7805700000     Tolerance=0.10000000000E-04
> Value= 6.4000000000     Target= 6.4000000000     Tolerance=0.10000000000    
> Value= 6.9000000000     Target= 6.9000000000     Tolerance=0.10000000000    
> Value= 7.4000000000     Target= 7.4000000000     Tolerance=0.10000000000    
> Value= 7.8000000000     Target= 7.8000000000     Tolerance=0.10000000000    
> Value= 8.2000000000     Target= 8.2000000000     Tolerance=0.10000000000    
> Value= 8.5000000000     Target= 8.5000000000     Tolerance=0.10000000000    
> Value= 8.7000000000     Target= 8.7000000000     Tolerance=0.10000000000    
> Value= 8.6000000000     Target= 8.6000000000     Tolerance=0.10000000000    
> Value= 8.5000000000     Target= 8.5000000000     Tolerance=0.10000000000    
> Value= 7.9000000000     Target= 7.9000000000     Tolerance=0.10000000000    
> Value= 7.4000000000     Target= 7.4000000000     Tolerance=0.10000000000    
> Value= 6.1000000000     Target= 6.1000000000     Tolerance=0.10000000000    
> Value= 5.0000000000     Target= 5.0000000000     Tolerance=0.10000000000    
> Value= 2.9000000000     Target= 2.9000000000     Tolerance=0.10000000000    
> Value=0.60000000000     Target=0.60000000000     Tolerance=0.10000000000    

channel PASSED   18 tests - no failures

> Value= 2000.0032001     Target= 2000.0024122     Tolerance=0.10000000000E-01
> Value=           535482 Target=           533050 Tolerance=             5000

doduc PASSED    2 tests - no failures

= Value=10 Target=10
> Value=0.60325000000E-04 Target=0.60325000000E-04 Tolerance=0.10000000000E-08
= Value=9 Target=9
> Value=0.53975000000E-04 Target=0.53975000000E-04 Tolerance=0.10000000000E-08
= Value=8 Target=8
> Value=0.47625000000E-04 Target=0.47625000000E-04 Tolerance=0.10000000000E-08
> Value= 17.558100000     Target= 17.558100000     Tolerance=0.10000000000E-03
> Value=0.53463000000     Target=0.53463000000     Tolerance=0.10000000000E-05

fatigue PASSED    8 tests - no failures

> Value=0.86774900000E-06 Target=0.86774900000E-06 Tolerance=0.10000000000E-10

gas_dyn PASSED    1 tests - no failures

= Value=10 Target=10
> Value=0.13333333333E-04 Target=0.13333333333E-04 Tolerance=0.10000000000E-11
> Value=0.33333333333E-03 Target=0.33333333333E-03 Tolerance=0.10000000000E-10
> Value=0.22940707222E-10 Target=0.22940707222E-10 Tolerance=0.10000000000E-16
> Value=0.57351768056E-09 Target=0.57351768056E-09 Tolerance=0.10000000000E-16
> Value=0.10000000000E+21 Target=0.10000000000E+21 Tolerance= 1000.0000000    
> Value=-.10000000000E+21 Target=-.10000000000E+21 Tolerance= 1000.0000000    
> Value=0.10000000000E+21 Target=0.10000000000E+21 Tolerance= 1000.0000000    
> Value=-.10000000000E+21 Target=-.10000000000E+21 Tolerance= 1000.0000000    
> Value= 0.0000000000     Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.59537942844E-01 Target=0.59537942844E-01 Tolerance=0.10000000000E-09
> Value= 0.0000000000     Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.96399525024E-01 Target=0.96399525024E-01 Tolerance=0.10000000000E-09
= Value=120000 Target=120000
= Value=0 Target=0
= Value=0 Target=0
= Value=360000 Target=360000
= Value=241200 Target=241200
= Value=120000 Target=120000
= Value=80400 Target=80400

induct PASSED   20 tests - no failures

> Value= 25.095297500     Target= 23.100000000     Tolerance= 2.0000000000    
> Value=0.27858826400E-10 Target=0.27858826400E-10 Tolerance=0.10000000000E-09
> Value=0.22204460500E-15 Target=0.22204460500E-15 Tolerance=0.10000000000E-14
> Value= 1.0000000000     Target= 1.0000000000     Tolerance=0.10000000000E-07
> Value= 1.0000000000     Target= 1.0000000000     Tolerance=0.10000000000E-07

linpk PASSED    5 tests - no failures

= Value=1000 Target=1000
> Value=0.27380000000     Target=0.27000000000     Tolerance=0.10000000000E-01
> Value=-3.3217000000     Target=-3.3200000000     Tolerance=0.20000000000E-01
> Value=-3.0478000000     Target=-3.0450000000     Tolerance=0.50000000000E-02
> Value= 17.474300000     Target= 17.100000000     Tolerance= 1.0000000000    
> Value=0.20000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=-.50000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.90000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
= Value=100 Target=100
> Value=0.29620000000     Target=0.29620000000     Tolerance=0.20000000000E-03
> Value=-3.3440000000     Target=-3.3440000000     Tolerance=0.20000000000E-03
> Value=-3.0478000000     Target=-3.0478000000     Tolerance=0.50000000000E-03
> Value= 1.0012000000     Target= 1.0012000000     Tolerance=0.20000000000E-03
> Value=0.70000000000E-14 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.10000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=-.10000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
= Value=100 Target=100
> Value=0.29620000000     Target=0.29620000000     Tolerance=0.20000000000E-03
> Value=-3.3440000000     Target=-3.3440000000     Tolerance=0.20000000000E-03
> Value=-3.0478000000     Target=-3.0478000000     Tolerance=0.50000000000E-03
> Value= 1.0012000000     Target= 1.0012000000     Tolerance=0.20000000000E-03
> Value=0.20000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.50000000000E-14 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.10000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
= Value=1000 Target=1000
> Value=0.26990000000     Target=0.27450000000     Tolerance=0.10000000000E-01
> Value=-3.3176000000     Target=-3.3220000000     Tolerance=0.10000000000E-01
> Value=-3.0477000000     Target=-3.0477000000     Tolerance=0.50000000000E-03
> Value= 18.294600000     Target= 18.400000000     Tolerance=0.80000000000    
> Value=0.20000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=-.30000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=0.50000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
= Value=100 Target=100
> Value=0.28970000000     Target=0.28970000000     Tolerance=0.50000000000E-03
> Value=-3.3413000000     Target=-3.3413000000     Tolerance=0.10000000000E-02
> Value=-3.0517000000     Target=-3.0517000000     Tolerance=0.50000000000E-03
> Value= 1.1007000000     Target= 1.1007000000     Tolerance=0.10000000000E-02
> Value=0.70000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=-.40000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11
> Value=-.20000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-11

mdbx PASSED   40 tests - no failures

> Value=               24 Target=               24 Tolerance=                0
> Value=0.21399000000     Target=0.21400000000     Tolerance=0.10000000000E-02
> Value=0.22295000000     Target=0.22295000000     Tolerance=0.10000000000E-03
> Value=-.49289170000E-13 Target= 0.0000000000     Tolerance=0.20000000000E-12
> Value=               38 Target=               37 Tolerance=                1
> Value=               27 Target=               27 Tolerance=                1
> Value=               44 Target=               44 Tolerance=                1

nf PASSED    7 tests - no failures

> Value= 5714.0000000     Target= 5714.0000000     Tolerance=0.10000000000    
> Value= 2214644.0000     Target= 2214644.0000     Tolerance=0.10000000000    
> Value= 22856.000000     Target= 22856.000000     Tolerance=0.10000000000    
> Value= 8858576.0000     Target= 8858576.0000     Tolerance=0.10000000000    
> Value= 22856.000000     Target= 22856.000000     Tolerance=0.10000000000    
> Value= 8858576.0000     Target= 8858576.0000     Tolerance=0.10000000000    
> Value= 22856.000000     Target= 22856.000000     Tolerance=0.10000000000    
> Value= 8858576.0000     Target= 8858576.0000     Tolerance=0.10000000000    
> Value= 22856.000000     Target= 22856.000000     Tolerance=0.10000000000    
> Value= 8858576.0000     Target= 8858576.0000     Tolerance=0.10000000000    

protein PASSED   10 tests - no failures

> Value=               61 Target=               61 Tolerance=                0
= Value=189 Target=189
= Value=13230 Target=13230
= Value=13363 Target=13363
> Value= 1.0000000000     Target= 1.0000000000     Tolerance=0.10000000000E-07
> Value=               85 Target=               85 Tolerance=                0
= Value=101 Target=101
> Value=           357316 Target=           357316 Tolerance=                1
> Value=           356376 Target=           356376 Tolerance=                1
> Value=0.25999999000     Target=0.26000000000     Tolerance=0.10000000000E-07
> Value=              109 Target=              109 Tolerance=                0
= Value=125 Target=125
> Value=          1179816 Target=          1179816 Tolerance=                1
> Value=          1180126 Target=          1180126 Tolerance=                1
> Value=0.29999999300E-01 Target=0.30000000000E-01 Tolerance=0.10000000000E-07
> Value=              205 Target=              205 Tolerance=                0
= Value=213 Target=213
= Value=3278 Target=3278
= Value=3208 Target=3208
> Value= 2.1399999000     Target= 2.1400000000     Tolerance=0.10000000000E-05

rnflow PASSED   20 tests - no failures

> Value=0.60000000000E-14 Target= 0.0000000000     Tolerance=0.10000000000E-10
> Value=0.16000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-10
> Value=0.67000000000E-13 Target= 0.0000000000     Tolerance=0.10000000000E-10
> Value=0.25000000000E-12 Target= 0.0000000000     Tolerance=0.10000000000E-10

test_fpu PASSED    4 tests - no failures

> Value=0.30791526000E-07 Target=0.30000000000E-07 Tolerance=0.30000000000E-07

tfft PASSED    1 tests - no failures

Finished Testing  16 benchmarks -  16 passed, and   0 failed




More information about the Gcc-patches mailing list