[PATCH] rtl-optimization/80960 - avoid creating garbage RTL in DSE

Jakub Jelinek jakub@redhat.com
Tue Feb 2 08:47:27 GMT 2021


On Tue, Feb 02, 2021 at 08:51:07AM +0100, Richard Biener wrote:
> > Shouldn't we gather statistics from larger codebase first and perhaps
> > compare against tree-ssa-dse statistics?  I mean, in many functions there
> > are no DSE opportunities at all.
> 
> Of course.  Some DSE will definitely be required because we expose
> ABI details only on RTL and expand sometimes is quite stupid.  ISTR
> either DCE or CSE performs some limited amount of DSE as well?
> 
> The most needed and interesting work will be to disentangle RTL expansion
> into the "complex" bits to be done on (lowered) GIMPLE and the
> mechanical detail of GIMPLE to RTL one instruction at a time.  I guess
> only during this work we'll learn what we need in lowered GIMPLE.

BTW, more complete RTL DSE statistics (from x86_64-linux and i686-linux
bootstraps/regtests together) are below (columns are number of occurences of
specific local and global deletion pairs, local deletions, global
deletions), so it is true RTL DSE only removed something in 1.6% of
functions during those.  But RTL DSE is also doing the SCCVN-like
optimization of optimizing memory reads into constants if those constants
were stored before and that isn't tracked in this.

5908970 0 0
  20144 1 0
  14162 0 3
  11413 0 1
  10862 2 0
   5268 0 2
   5256 3 0
   4924 0 6
   3506 4 0
   2838 0 4
   1734 0 9
   1621 5 0
   1449 0 5
   1014 0 8
    856 0 12
    754 0 7
    729 6 0
    487 7 0
    464 8 0
    422 14 0
    412 9 0
    381 0 15
    373 0 10
    297 1 1
    259 0 18
    248 2 2
    245 0 11
    237 3 3
    230 12 0
    220 10 0
    168 0 16
    144 11 0
    138 0 14
    133 4 6
    133 0 13
    123 0 24
    115 15 0
    114 0 21
     94 0 20
     91 0 17
     88 1 4
     84 1 2
     75 16 0
     74 17 0
     71 0 27
     69 0 30
     55 2 1
     50 4 1
     50 1 9
     50 1 3
     46 0 36
     44 0 33
     44 0 25
     42 2 3
     41 18 0
     40 5 3
     39 34 0
     36 13 0
     35 2 18
     35 0 19
     34 3 1
     33 1 7
     31 1 5
     31 0 48
     31 0 23
     30 4 3
     30 1 6
     30 0 22
     28 0 29
     28 0 26
     26 0 28
     25 24 0
     24 1 18
     22 2 6
     21 0 32
     20 4 4
     20 3 2
     19 4 2
     18 0 40
     17 39 0
     17 22 0
     16 5 9
     16 5 5
     15 129 0
     15 0 66
     15 0 31
     14 20 0
     14 19 0
     13 6 3
     12 1 8
     12 0 42
     11 32 0
     11 2 4
     10 4 9
     10 42 0
     10 0 44
      9 3 4
      9 30 0
      9 259 0
      9 0 57
      9 0 39
      8 4 8
      8 46 0
      8 31 0
      8 25 35
      8 1 15
      8 0 56
      8 0 54
      8 0 45
      8 0 43
      8 0 38
      7 3 8
      7 35 0
      7 33 0
      7 130 0
      7 1 24
      7 12 1
      7 1 14
      7 0 60
      6 9 3
      6 5 6
      6 5 4
      6 5 1
      6 4 49
      6 3 13
      6 15 9
      6 12 6
      6 0 84
      6 0 41
      5 6 12
      5 44 0
      5 27 0
      5 2 7
      5 25 0
      5 23 0
      5 14 12
      5 12 2
      5 1 21
      5 10 2
      5 0 35
      5 0 150
      4 86 0
      4 7 6
      4 69 0
      4 6 8
      4 56 0
      4 45 0
      4 4 16
      4 29 0
      4 266 0
      4 263 0
      4 258 0
      4 2 22
      4 12 4
      4 1 12
      4 0 83
      4 0 61
      4 0 51
      4 0 34
      3 8 9
      3 8 6
      3 6 1
      3 55 0
      3 5 10
      3 49 0
      3 4 77
      3 4 5
      3 4 18
      3 4 13
      3 2 9
      3 28 0
      3 2 38
      3 2 12
      3 14 6
      3 1 13
      3 0 88
      3 0 86
      3 0 75
      3 0 69
      3 0 198
      3 0 100
      2 90 0
      2 6 39
      2 6 21
      2 53 0
      2 5 2
      2 512 0
      2 5 11
      2 50 0
      2 4 7
      2 4 33
      2 4 10
      2 40 0
      2 3 9
      2 3 6
      2 33 1
      2 2 8
      2 262 0
      2 26 0
      2 252 0
      2 24 12
      2 24 1
      2 23 29
      2 22 22
      2 21 5
      2 21 0
      2 16 5
      2 14 18
      2 128 0
      2 12 5
      2 1 20
      2 11 40
      2 1 11
      2 0 91
      2 0 37
      2 0 158
      2 0 136
      2 0 128
      2 0 104
      2 0 103
      1 9 6
      1 9 10
      1 8 7
      1 8 2
      1 8 16
      1 8 15
      1 81 0
      1 8 1
      1 7 5
      1 74 0
      1 73 6
      1 7 12
      1 7 1
      1 6 7
      1 54 0
      1 52 0
      1 48 0
      1 36 0
      1 3 5
      1 31 3
      1 2 5
      1 2 21
      1 2 13
      1 21 18
      1 2 10
      1 19 20
      1 19 2
      1 18 12
      1 17 10
      1 16 1
      1 14 9
      1 145 0
      1 14 15
      1 13 1
      1 12 8
      1 11 11
      1 1 10
      1 10 7
      1 10 11
      1 10 1
      1 0 89
      1 0 80
      1 0 70
      1 0 67
      1 0 59
      1 0 55
      1 0 49
      1 0 244
      1 0 148
      1 0 140

	Jakub



More information about the Gcc-patches mailing list