On 05/30/2013 12:08 PM, Tobias Burnus wrote:
+ }
+ else
+ {
+ if (!host_integerp (arg1, 0))
+ break;
+
+ n = TREE_INT_CST_LOW (arg1);
+ result = gimple_expand_builtin_powi (&gsi, loc, arg0, n);
+ }
In this case, why even bother with gimple_expand_builtin_powi. Don't we
know the result simply by looking at N and setting the dest to -1.0 or
1.0 appropriately?
I don't see that powi_as_mults optimizes the case where both args are
constants and thus the result is a trivially computable compile time
constant.
Am I missing something?
Granted, I wouldn't expect it to happen often, but we might have started
with a variable exponent and through various opts eventually collapsed
it down to a known constant.
jeff