On Thu, Mar 31, 2005 at 05:46:40PM -0500, Kaveh R. Ghazi wrote: > And what is the place of fold_builtin_1() given we have > ccp_fold_builtin() ? > > Would someone please enlighten me? > ccp_fold_builtin was mostly an attempt to enhance CCP so that we could propagate constant string attributes from non constant values. It uses a rudimentary use-def chain walker that will do simple things like:
if (random ()) s_1 = "xxx"; else s_2 = "yyy"; s_3 = PHI <s_1, s_2> return strlen (s_3); Even if the value of s_3 is non-constant, we know that strlen(s_3) is always 3. The implementation is very crude and primitive. A better propagator that was able to handle other attributes could now be implemented using the SSA propagation engine. Interested? I never got around to fixing this wart. Diego.