[PATCH] D98147: [SCEV] Improve modelling for pointer constants

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 7 10:30:08 PST 2021


lebedev.ri created this revision.
lebedev.ri added reviewers: efriedma, mkazantsev, Meinersbur.
lebedev.ri added a project: LLVM.
Herald added subscribers: kerbowa, javed.absar, hiraditya, nhaehnle, jvesely, nemanjai.
Herald added a reviewer: bollu.
lebedev.ri requested review of this revision.

This is a continuation of D89456 <https://reviews.llvm.org/D89456>.

As it was suggested there, now that SCEV models `PtrToInt`,
we can try to improve it's pointer handling.
In particular, i believe, i will need this in the future
to further fix `SCEVAddExpr` type handling.

This removes special handling of `ConstantPointerNull` from `ScalarEvolution::createSCEV()`,
and add constant folding into `ScalarEvolution::getPtrToIntExpr()`.
This way, `null` constants stay as such in SCEV's.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98147

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Analysis/ScalarEvolution/load.ll
  llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
  llvm/test/Analysis/ScalarEvolution/ptrtoint.ll
  llvm/test/Analysis/ScalarEvolution/scalable-vector.ll
  llvm/test/CodeGen/AMDGPU/splitkit-getsubrangeformask.ll
  llvm/test/CodeGen/PowerPC/pr43527.ll
  llvm/test/CodeGen/PowerPC/pr48519.ll
  llvm/test/CodeGen/PowerPC/sms-phi.ll
  llvm/test/Other/constant-fold-gep.ll
  llvm/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
  llvm/test/Transforms/IndVarSimplify/widen-i32-i8ptr.ll
  llvm/test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll
  llvm/test/Transforms/LoopStrengthReduce/AMDGPU/lsr-postinc-pos-addrspace.ll
  llvm/test/Transforms/LoopVectorize/X86/cost-model-assert.ll
  llvm/test/Transforms/LoopVectorize/pointer-induction.ll
  llvm/unittests/Transforms/Utils/ScalarEvolutionExpanderTest.cpp
  polly/test/Isl/CodeGen/partial_write_impossible_restriction.ll
  polly/test/Isl/CodeGen/scev_looking_through_bitcasts.ll
  polly/test/ScopInfo/constant_functions_outside_scop_as_unknown.ll
  polly/test/ScopInfo/memset_null.ll
  polly/test/ScopInfo/mod_ref_read_pointee_arguments.ll
  polly/test/ScopInfo/multidim_2d_with_modref_call_2.ll
  polly/test/ScopInfo/pointer-type-expressions.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98147.328883.patch
Type: text/x-patch
Size: 64368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210307/fee4327d/attachment-0001.bin>


More information about the llvm-commits mailing list