[PATCH] D65118: Analysis: Don't look through aliases when simplifying GEPs.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 17:06:46 PDT 2019


pcc added a comment.

In D65118#1597984 <https://reviews.llvm.org/D65118#1597984>, @jdoerfert wrote:

> In D65118#1597868 <https://reviews.llvm.org/D65118#1597868>, @pcc wrote:
>
> > For the opt-in behaviour it seems that we should have the `strip*()` ignore the linkage and leave it up to the caller to make the correct determination based on the linkage of the alias. For example, the inliner or global const prop would check `isInterposable()`, and attribute-based optimizations would check `isDefinitionExact()`.
>
>
> Mh, I think that would change how the `strip*()` family currently works.


That's fine I think. Making `strip*()` more restrictive shouldn't break existing users, it should just make them optimize less (and for any in-tree users we would measure the impact and switch to a new API if necessary before doing so).

> What about: Looking through `isDefinitionExact` by default for `strip*()` except for "NoFollowAliases". That way, users have to manually strip non-interposable aliases that do not have an exact definition and they get a somehow sane/sound result if they strip aliases. If needed, we could add a "FollowNonInterposableAliases" later as well.

We shouldn't look through aliases at all by default for the QoI reasons already mentioned. I wouldn't add too many different variants across this dimension since it's already growing into a bit of a mess. Just the always-strip-aliases variant should be enough in combination with the checks in the client. That way things are kept orthogonal.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65118/new/

https://reviews.llvm.org/D65118





More information about the llvm-commits mailing list