> > That is why I checked for loc != UNKNOWN_LOCATION. I did not expect > > UNKNOWN_LOCATION to have discriminators. What they are good for? > > I have no idea, this was simply a defensive review where it's no > longer obvious that inlined_function_outer_scope_p would still work > in all cases.
Understood. I am not too familiar with discriminator implementation, but it seems that afdo is actually quite useful testsuite for profile info, so I suppose I will learn. Before inline stacks were applied correctly, it was kind of useless to debug other issues. Now the profiles seems much more sane at least when inlining at instrumentation time matches inlining at profile use time. What seems to be common now is profile breakage around loops that has been fully unrolled or vectorized which is bit undderstandbale thought I wonder if we can improve here. I think we can fix problem where profile of loop header stmts is partly or fully lost (which seems to be main issue now that prevents loop optimization since then loop headers looks cold). I suppose this can be fixed by making sure the debug statement is duplicated into the loop variants. However I wonder if we can preserve info that after vectorizaiton one vectorized stmt actualy performs multiple original stmts... Honza