[all-commits] [llvm/llvm-project] 61f006: [SCEV] Improve modelling for (null) pointer constants

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Mar 12 11:12:27 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 61f006ac655431bd44b9e089f74c73bec0c1a48c
      https://github.com/llvm/llvm-project/commit/61f006ac655431bd44b9e089f74c73bec0c1a48c
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-03-12 (Fri, 12 Mar 2021)

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

  Log Message:
  -----------
  [SCEV] Improve modelling for (null) pointer constants

This is a continuation of D89456.

As it was suggested there, now that SCEV models `PtrToInt`,
we can try to improve SCEV's pointer handling.
In particular, i believe, i will need this in the future
to further fix `SCEVAddExpr`operation 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,
but gracefully become zero integers when asked.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D98147




More information about the All-commits mailing list