[PATCH] D103660: [ScalarEvolution] Don't form min/max for pointer-type phi/select.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 4 15:56:30 PDT 2021


efriedma added a comment.

I'm happy to take some time to discuss this; if we urgently some other solution for the branch, we can take a more targeted approach.

The ultimate goal here is to make SCEV consistent about the "pointer-ness" of a SCEV value.  If you call getSCEV() on a value, or evaluate a SCEV value at a particular iteration, or something along those lines, the output should be a pointer if and only if the input is a pointer.  And the input and output should have the same pointer base.  Enforcing these restrictions will make it easier to preserve correctness, and to reason about values like non-integral pointers.

As far as I can tell, we're pretty close.  This patch plus D103656 <https://reviews.llvm.org/D103656> handle almost all the interesting cases.  The one remaining issue after these two patches is code outside SCEV that explicitly constructs min/max nodes using pointer values. I have a WIP patch for that which seems to pass tests; I'll try to post some time next week.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103660



More information about the llvm-commits mailing list