[tree-ssa] CCP and non-destructive folding problems

law@redhat.com law@redhat.com
Tue Feb 25 18:37:00 GMT 2003


In message <1046193790.1694.34.camel@shadowfax>, Diego Novillo writes:
 >On Tue, 2003-02-25 at 12:20, law@redhat.com wrote:
 >
 >> We're clearly missing some important cases in ccp_fold, namely the
 >> truthops, let's get that fixed, then see if there's anything
 >> important still missing (sans builtins, which are a complete issue
 >> unto themselves.).
 >> 
 >Oh, that and builtins are fixed by the patch I sent you already.  That's
 >why I mentioned them.  Those are the two that I caught initially.
Noted.  I'll probably pick them up after the bootstrap & test is finished
which fixes how we handled undefined expressions and re-enables the
VARYING->CONSTANT state checking.

 >> Yes, but if you don't mark it varying, you end up with an algorithm
 >> that you can't prove completes and with a ton of collateral damage
 >> trying to fix it up.
 >> 
 >Au contraire.  The algorithm completes in fewer iterations.  Remember
 >that UNDEFINED values are short circuit for PHI expression evaluations. 
 >They imply no change of state.  Ergo, the main loop finishes sooner.
But if you've got a transition from VARYING back to CONSTANT, what's to
stop you from ping-ponging between VARYING and CONSTANT?  That's one of
the key concepts behind the algorithm and its allowable state changes.

 >Alternately, we can preserve the status quo and allow VARYING->CONSTANT
 >and VARYING->UNDEFINED transitions.
I can't tell you how strongly I feel this is a mistake.
jeff



More information about the Gcc mailing list