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: [PATCH]: Handle pow10 like exp10 optab


Hi Roger and Kaveh,

> > 	* builtins.c (expand_builtin_mathfn): Add pow10* to the
> > 	existing exp10* case.
> > 	(expand_builtin): Likewise.

You might be interested in knowing that these builtin optimizations
probably never trigger on tree-ssa.  (See PR 14541.)

According to Andrew Pinski and Daniel Berlin, an expression like
"a = log (exp (x))" is gimplified first like

  T = exp (x);
  a = log (T);

before fold() [CALL_EXPR] gets to see "log (exp (x))".

One reasonable thing we can do is to port these optimizations to
tree-ssa-dom.c's simplify_{rhs,cond}_*() or something.  This way, your
optimizations would work even if the original code has temporary
variables in the way.

Kazu Hirata


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