[all-commits] [llvm/llvm-project] d480f9: Revert "[SCEV] Model `ashr exact x, C` as `(abs(x)...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sun Apr 18 06:27:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d480f968ad8b56d3ee4a6b6df5532d485b0ad01e
      https://github.com/llvm/llvm-project/commit/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-04-18 (Sun, 18 Apr 2021)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolution.h
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/ashr.ll
    M llvm/test/Analysis/ScalarEvolution/ptrtoint.ll
    M llvm/test/Transforms/IndVarSimplify/ashr-expansion.ll

  Log Message:
  -----------
  Revert "[SCEV] Model `ashr exact x, C` as `(abs(x) EXACT/u (1<<C)) * signum(x)`"

As being discussed in https://reviews.llvm.org/D100721,
this modelling is lossy, we can't reconstruct `ash`/`ashr exact`
from it, which means that whenever we actually expand the IR,
we've just pessimized the code..

It would be good to model this pattern, after all it comes up every time
you want to compute a distance between two pointers, but not at this cost.

This reverts commit ec54867df5e7f20e12146e628af34f0384308bcb.




More information about the All-commits mailing list