[PATCH] D124645: [SCEV] Model simple same base pointer `select`s via `umin_seq`

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 16:49:14 PDT 2022


lebedev.ri created this revision.
lebedev.ri added reviewers: efriedma, mkazantsev, reames, fhahn, nikic.
lebedev.ri added a project: LLVM.
Herald added subscribers: javed.absar, hiraditya.
Herald added a project: All.
lebedev.ri requested review of this revision.

We can't model pointer selects (or even fully variable integer selects) in SCEV in their generality.

But, *IFF* we are selecting between pointers with the same base object,
we can instead decompose the pointers into pointer base + integer offset,
try to model the select of said integer offsets, and add the result
to the base pointer, thus modelling the original select,
because we do support limited modelling for partially-variable integer selects.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124645

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/pointer-rounding.ll
  llvm/test/Analysis/ScalarEvolution/pointer-select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124645.425924.patch
Type: text/x-patch
Size: 8701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220428/337af4ac/attachment.bin>


More information about the llvm-commits mailing list