http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23830

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-03-23 
15:38:32 UTC ---
Inline predicates handle this case for both ipa-constant propagation and
inliner.
We will now work out that y-prec-x_prec and x_prec-y_prec will be constant and
that the conditionals will be decided at compile time.

We now inline ChangePrecision at -Os.
We however still won't get that y_prec>x_prec can be resolved at compile time.
Only tests comparing with constants.

 BB 2 predicate:(true)
  if (y_prec_2(D) > x_prec_3(D))
                freq:1.00 size:  2 time:  2
                Accounting size:2.00, time:2.00 on new predicate:(op2 changed
|| op1 changed)

 BB 3 predicate:(true)
  D.1717_4 = y_prec_2(D) - x_prec_3(D);
                freq:0.39 size:  1 time:  1
                Accounting size:1.00, time:0.39 on predicate:(op2 changed ||
op1 changed)
  D.1716_6 = x_5(D) << D.1717_4;
                freq:0.39 size:  1 time:  1
                Accounting size:1.00, time:0.39 on new predicate:(op2 changed
|| op1 changed || op0 changed)

 BB 4 predicate:(true)
  if (y_prec_2(D) < x_prec_3(D))
                freq:0.61 size:  2 time:  2
                Accounting size:2.00, time:1.22 on predicate:(op2 changed ||
op1 changed)

 BB 5 predicate:(true)
  D.1720_7 = x_prec_3(D) - y_prec_2(D);
                freq:0.37 size:  1 time:  1
                Accounting size:1.00, time:0.37 on predicate:(op2 changed ||
op1 changed)
  D.1716_8 = x_5(D) >> D.1720_7;
                freq:0.37 size:  1 time:  1
                Accounting size:1.00, time:0.37 on predicate:(op2 changed ||
op1 changed || op0 changed)

 BB 6 predicate:(true)
  return D.1716_1;
                freq:1.00 size:  1 time:  2
                Will be eliminated by inlining
                Accounting size:1.00, time:2.00 on predicate:(not inlined)

....

Considering changePrecision.constprop.0 with 5 size
 to be inlined into t in t.c:12
 Estimated growth after inlined into all is -8 insns.
 Estimated badness is -1073741827, frequency 1.00.
    Badness calculation for t -> changePrecision.constprop.0
      size growth -3, time growth -12
      -1073741827: Growth -3 <= 0
                Accounting size:2.00, time:0.76 on new predicate:(op0 changed)

Reply via email to