[all-commits] [llvm/llvm-project] ef22d5: [NFCI][SCEV] getPtrToIntExpr(): use SCEVRewriteVis...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Oct 30 07:05:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ef22d500f7505d02a3861a9acf7eaacb375c7652
      https://github.com/llvm/llvm-project/commit/ef22d500f7505d02a3861a9acf7eaacb375c7652
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2020-10-30 (Fri, 30 Oct 2020)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [NFCI][SCEV] getPtrToIntExpr(): use SCEVRewriteVisitor<> for ptrtoint cast sinking

This is functionally-identical to the previous implementation,
just using a generic interface to do that instead of hand-rolled one,
with caching as a bonus. Thought the sinking is still recursive..

Note that SCEVRewriteVisitor<>'s default implementations
don't preserve NoWrap flags on Add/Mul (but does on AddRec!),
but here we know we can preserve them,
so `visitAddExpr()`/`visitMulExpr()` are specialized.




More information about the All-commits mailing list