[PATCH] D134178: [SCEV] Calculate PHI range based on its underlying values instead of just its inputs

Dmitry Makogon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 05:42:03 PDT 2022


dmakogon created this revision.
dmakogon added reviewers: mkazantsev, nikic, reames, fhahn.
Herald added subscribers: javed.absar, hiraditya.
Herald added a project: All.
dmakogon requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This teaches SCEV to calculate range of a PHI as a union of its underlying values ranges.
Currently we do it by uniting ranges of its inputs, but there are cases where two or more PHIs
are cycled so such approach would give the full range.
This uses PhiValues analysis to get underlying values for PHIs and then unite their ranges.


https://reviews.llvm.org/D134178

Files:
  llvm/include/llvm/Analysis/ScalarEvolution.h
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/lib/CodeGen/SafeStack.cpp
  llvm/test/Analysis/ScalarEvolution/cycled_phis.ll
  llvm/test/Analysis/ScalarEvolution/unknown_phis.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134178.461188.patch
Type: text/x-patch
Size: 13143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220919/88a2a05e/attachment.bin>


More information about the llvm-commits mailing list