[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
Thu Jun 3 18:02:00 PDT 2021


efriedma created this revision.
efriedma added reviewers: lebedev.ri, mkazantsev, reames.
Herald added a subscriber: hiraditya.
efriedma requested review of this revision.
Herald added a project: LLVM.

If the operands have different pointer bases, it isn't clear we can return in appropriate value. In other cases, we could probably come up with an appropriate expression. But we currently don't: we mix pointer and integer expressions without any regard for the type and pointer base of the result.

This transform doesn't seem to be important in practice: we have very few regression tests that are affected by this.

Depends on https://reviews.llvm.org/D103656 .

Apparently fixes https://bugs.llvm.org/show_bug.cgi?id=50440 .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103660

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/pr46786.ll
  llvm/test/Analysis/ScalarEvolution/ptrtoint.ll
  llvm/test/Transforms/IndVarSimplify/pr45835.ll
  llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103660.349737.patch
Type: text/x-patch
Size: 15074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210604/a9a231e2/attachment.bin>


More information about the llvm-commits mailing list