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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 19:40:23 PDT 2021


reames added a comment.

Eli,

The goal stated of having getSCEV(V)->getType()->isPointerTy() == V->getType()->isPointerTy() seems reasonable to me.  I'm not as sure about the baseof(V) == baseof(S) bit, but I tentatively accept that as it's not my main confusion.

My main confusion is why tackle the problem this way?  If we're constructing a SCEV node for an existing IR instruction which has two base pointers involved, then a) we've got a question about what the semantics of that instruction are at all (e.g. it's probably poison), and b) the SCEV result seems like it should have the same set of base pointers as the instruction.

Or, maybe said another way, what makes selects special here?

Can I maybe suggest you split this into a patch which enforces the pointerness property, and then a patch which imposes the baseof property?  The former seems easy-ish to assert in getSCEV(V) and enumerate the cases which violate.


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