On Thu, Nov 29, 2012 at 1:14 PM, Tom de Vries <tom_devr...@mentor.com> wrote: > On 29/11/12 11:26, Richard Biener wrote: >> I'm continuing trying to move value-ids back to PRE land. Your patch >> would be nice in a form that verifies the order is indeed topological, >> maybe you can re-work it in a way that does this in >> sorted_array_from_bitmap_set in a ENABLE_CHECKING piece? > > Richard, > > These are my current patches, tested together with tree-ssa.exp. > > > The first patch checks the topological order in sorted_array_from_bitmap_set. > Testing only this one with tree-ssa.exp gives 400 failures. > > Btw, I'm not 100% sure if this patch checks the required order. It's clear > what > topological order means if there is one expression per value. I've ran > tree-ssa.exp with an assert that the number of expressions and values in the > bitmap_set is equal in sorted_array_from_bitmap_set, and that passed, so that > seems to be the case generally, but I don't know if that's by design. > If there are more expressions with the same value, this patch is a 'weak' > check, > meaning a value is considered available if one expression with that value is > available. A 'strong' check would consider a value available if all > expressions > with that value are available. I can imagine doing clean on a strongly or > weakly > ordered array could give different results. > > > The second patch calculates value_id during pre. If you're working on the > value_id part, I'll stop here.
Thanks. For the moment I am fixing value-id assigns in tree-ssa-sccvn.c but there seems to be an issue with possibly assigning the same value-ids for conflicting topology: if () { a = b + c; d = a + 1; } else { f = g + h; i = f - 1; } if for some reason we value-number 'a' and 'i' the same and 'd' and 'f' the same then there is no value-id ordering that sorts correctly according to expression dependencies (some reason being for example g == b + c, h = 2). So I'm indeed not sure that simply sorting after value-id and assigning "proper" value-ids will work at all. patch that adjusts value-id assignment in SCCVN according to PREs expectations attached. Richard. > Thanks, > - Tom > > 2012-11-29 Tom de Vries <t...@codesourcery.com> > > * tree-ssa-pre.c (sorted_array_from_bitmap_set): Use > EXECUTE_IF_AND_IN_BITMAP instead of EXECUTE_IF_SET_IN_BITMAP. Check > sort result ifdef ENABLE_CHECKING. Check if the sorted array has the > same number of expressions as the bitmap_set. > >
p2
Description: Binary data