Hi Erik, On Tue, Mar 08 2022, Erick Ochoa via Gcc wrote: > Hi, > > I have one function (F) that has been specialized for two different calling > contexts (F1 and F2) and two late SIMPLE_IPA_PASSes (A and B). Pass A > changes some MEM_REFs such that the type of MEM_REF is compatible with the > type of the first operand of the expression. Pass A changes both F1 and F2. > I have printed the function bodies of both F1 and F2 during Pass A and > everything looks correct. Pass B uses these changes. > > However I noticed this interesting behaviour: > > 1. If I fix F1 first and then F2, then pass B will see F2 correctly but > some of F1 MEM_REFs will be incorrect. > 2. If I fix F2 first and then F1, then pass B will see F1 correctly but > some of F2 MEM_REFs will be incorrect. >
I try to avoid SIMPLE_IPA_PASSes and so would have to look how exactly they fit into the big picture. Also, I am not sure what you mean by "incorrect" above (modified when you'd not have expected it to be)? > My question is do different specialized functions share the same trees? How > would I then change the bodies of specialized functions? Virtual clones are, until they are "materialized." But it a simple IPA pass it does not really make sense to create virtual clones, does it? Do you create your clones with create_version_clone_with_body? Martin