This is the mail archive of the
mailing list for the GCC project.
RFC: Adding more expensive tree expression list in stmt_cost
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Sun, 26 Mar 2006 11:08:56 -0800
- Subject: RFC: Adding more expensive tree expression list in stmt_cost
FLOAT_EXPR and FIX_TRUNC_EXPR are both expensive so they really
should be added to this list.
Take the following code:
int f(float a, int *b)
for(i = 0; i<1000;i++)
*b = a;
Compile with -O1 and we get on PPC:
Notice the loop and extra store (to the stack), if we change LIM to pull
out the cast (FIX_TRUNC_EXPR), we get:
Which is much better and there is no loop. Also this is already done
at -O2 but it would be nice if LIM did it also. I should mention
does not care about cost really and always pulls out the calculation
LIM should be doing that instead.