[PATCH] D153624: [SCEV] Make use of non-null pointers for range calculation

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 05:14:42 PDT 2023


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

We know that certain pointers (e.g. non-extern-weak globals or allocas in default address space) are not null, in which case the lowest address they can be allocated at is their alignment.

This allows us to calculate better exit counts for loops that have an additional null check in the guarding condition (see `@alloca_icmp_null_exit_count`).


https://reviews.llvm.org/D153624

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/alloca.ll
  llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll
  llvm/test/Analysis/ScalarEvolution/load.ll
  llvm/test/Analysis/ScalarEvolution/nsw.ll
  llvm/test/Analysis/ScalarEvolution/ptrtoint-global.ll
  llvm/test/Analysis/ScalarEvolution/sdiv.ll
  llvm/test/Analysis/ScalarEvolution/srem.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153624.533930.patch
Type: text/x-patch
Size: 19124 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230623/885fd6e4/attachment.bin>


More information about the llvm-commits mailing list