[PATCH] D143129: [GVN] Do not propagate equalities for noalias pointers

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 00:48:12 PST 2023


nikic added a reviewer: nikic.
nikic added a comment.

This looks okay on the surface, but this needs at least a spot check of llvm-test-suite IR diffs to get an idea of how much this affects codegen. If there are no substantial regressions, let's go with it. Otherwise we may need to think harder about how we can mitigate regressions.

The one case I'm probably worried about most are checks of the form `%p == null`, where replacing `%p` with `null` is not generally legal because it has nullary provenance. Replacing two arbitrary pointers likely isn't super important, but replacement with null might be.

Note that it *is* possible to perform the replacement for uses that are provenance-independent, in particular inside `icmp` instructions. Whether we need to make that distinction depends on how the fallout looks like.


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

https://reviews.llvm.org/D143129



More information about the llvm-commits mailing list