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: [tree-ssa] [PATCH] fix PR 13066, fold being stupid


On Sat, 28 Feb 2004, Andrew Pinski wrote:
> I prefer the not folding patch as it is a memory savings one unless
> someone can prove me wrong.

My personal preference is for the fold_convert version :>  However,
both patches look reasonable, so I won't object if Jeff or Richard
prefer the non folding version.

I agree there is a small memory overhead, however fold_convert doesn't
allocate a new tree node if the argument is already of the appropriate
type, which is often the case.  The alternative is that we disable this
optimization when the types don't match exactly, producing worse code.

Although there is "leakage" from constant folding, normally memory is only
allocated if/when the source code is transformed.  In which case each
allocation is serving a useful purpose, and the old nodes will be garbage
collected if required/unshared.  I think the "small" overheads of constant
folding and RTL simplification are much more beneficial than other passes
that can require a large memory foot-print only to determine their
transformations aren't applicable.  GCSE and CSE for example, can consume
megabytes without propagating a single constant/available expression.


If anyone has numbers that show fold/simplify_rtx are significant memory
consumers, I'll have to rethink my position.  If so, we can conditionalize
transformations such as this one.

Roger
--


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