This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fixes to estimate_num_insns from pretty-ipa branch


>   3) When making original cost model I simply listed expensive nodes including DIV_EXPR.
>      This is very unrealistic for expressions like a/8, a/12 that are common in my dumps.
>      Now I basically just mark division by variable expensive.  Divisions by constant are cheap.
>      (this is not quite true for particularly ugly constants, but they are rare and we don't
>      have very easy way to ask div expansion).

Yeah, a div is basically as expensive as a multiply.

You can get better estimates for mod by constant, if you make it cost 3
(one multiply for the division, one real multiply, and a subtraction).
GCC will rarely generate a div instruction for a mod by constant, so it
works well for all three weight vectors.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]