[PATCH] D47143: [NewGVN] Do not treat LoadExpressions with differing nonnull as equal.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 13:27:22 PDT 2018


fhahn added a comment.

In https://reviews.llvm.org/D47143#1106580, @dberlin wrote:

> So, actually, this *is* a variant the same issue we have elsewhere with Simplify* (and there are a few newgvn bugs open about it).   These actually *are* congruent, we just don't want it simplifying this hard.
>
> I don't think you want to say these are non-congruent, because you can in fact replace load2 with load1 and load1 with load2, we would just merge metadata.
>  I think we want to be able to tell it what information it's allowed to use when simplifying.


Right, that was what I thought initially as well. We should be better off if we manage to limit simplifications. Unfortunately, there seems to be no option to ignore certain metadata by Simplify*. I suppose we could drop the metadata before we pass instructions to Simplify or maintain a set merged metadata for the congruence classes and use that when passing an instruction to Simplify*. The latter would still allow us to use the nonnull metadata for example, if all members have it, but it may not be worth maintaining a set of merged metadata...

Or do you think it would be better to teach Simplify* to ignore (some) metadata? This seems like a non-trivial change.

What do you think?


https://reviews.llvm.org/D47143





More information about the llvm-commits mailing list