On 12/7/18 3:55 AM, Richard Biener wrote: > On Fri, 7 Dec 2018, Richard Biener wrote: > >> >> The following fixes PR63184 by using tree-affine to resolve pointer >> comparisons. Instead of trying to stick this into a match.pd pattern >> the following does this in the more constrained forwprop environment. >> >> I've only implemented the cases where the comparison resolves to a >> compile-time value, not the case where for example &a[i] < &a[j] >> could be simplified to i < j. I'm not sure I can trust the >> tree-affine machinery enough here to do that. >> >> Both testcases require some CSE to happen thus the first forwprop >> pass doesn't catch it. >> >> Bootstrap & regtest running on x86_64-unknown-linux-gnu. >> >> I'll collect some statistics from bootstrap. > > Somewhat depressing. There's a single instance in > libiberty/rust-demangle.c that gets resolved (a ordered compare). > This instance triggers 4 times during a c,c++ bootstrap compared > to 258098 affine expansion combinations tried. > > It doesn't trigger in tramp3d at all (just to try a C++ code base). > > I suspect the cases in PR63184 are arcane enough and usually we > have simpler addresses that are resolved with the existing > patterns. > > I'll attach the patch to the PR and leave it alone. Seems reasonable to me as well. It's originally your BZ and somewhere in it I think you indicated you didn't think it was terribly important.
I'd suggest pushing it out to P4. But I know you don't like that, so I won't actually do it :-) Jeff