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] Fix cgraph related PR opt/13729


> 
> On Mon, 19 Jan 2004, Jan Hubicka wrote:
> > The idea has been that the ifcvt patch will take care of these
> > transfomration later when it has more information about their
> > profitability.  Doing the transformation early confuse some other
> > optimizations such as jump threading, constant propagation and such,
> > becuase originally parseable conditionals were replaced.
> >
> > The tree-SSA for instance has one or two testcases on CCP that are
> > fixed by removing these transformations.
> 
> Ahh, Ok.

Sorry, I sent wrong file, but once we opened this thread...
> 
> However, it might be beneficial to enhance our optimizers to recognize
> these problematic constructs.  Clearly, if the user writes something like:
> 
> 	if ((a | b) == 0)
> 	{
> 	   ...
> 	}

I actually do believe that it makes sense to postnote these
transformations for later.  For instance if profile says that A is
always true, may be profitable to not do the transformation at all.
In addition it is really dificult to special case all the tranformations
in loop optimizers/jump threaders/constant propagation and all the other
places.
> 
> we should be able to deduce the inferences that "a == 0" and "b == 0"
> during "...".  I don't disagree that we should probably disable these
> transformations until a later pass can be sure they're profitable,
> but we should also take this opportunity to analyse the failings of
> "jump threading", "constant propagation" and tree-ssa's CCP now that
> they've been revealed.  None of these problematic constructs is
> uncommon in user written code.

I am not sure how worthwhile this effort is.  It adds several special
cases that may complicate the whole thing.  In fact it may make sense to
rewrite the code above back for early passes.
The '|' trick is easilly rewritable and I think it is the only case
users commonly do.

Honza
> 
> Roger
> --


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